Implemented editing of users

This commit is contained in:
Philipp Czora
2018-07-17 08:39:51 +02:00
parent 52714b8d3b
commit ea8f8b23c5
7 changed files with 139 additions and 54 deletions

View File

@@ -3,6 +3,7 @@ import React from "react";
type Props = {
label: string,
checked: boolean,
onChange: boolean => void
};
class Checkbox extends React.Component<Props> {
@@ -15,7 +16,11 @@ class Checkbox extends React.Component<Props> {
<div className="field">
<div className="control">
<label className="checkbox">
<input type="checkbox" onChange={this.onCheckboxChange} />{" "}
<input
type="checkbox"
checked={this.props.checked}
onChange={this.onCheckboxChange}
/>
{this.props.label}
</label>
</div>

View File

@@ -4,6 +4,7 @@ import React from "react";
type Props = {
label?: string,
placeholder?: string,
value?: string,
type?: string,
autofocus?: boolean,
onChange: string => void
@@ -36,7 +37,7 @@ class InputField extends React.Component<Props> {
};
render() {
const { type, placeholder } = this.props;
const { type, placeholder, value } = this.props;
return (
<div className="field">
@@ -49,6 +50,7 @@ class InputField extends React.Component<Props> {
className="input"
type={type}
placeholder={placeholder}
value={value}
onChange={this.handleInput}
/>
</div>