import React from 'react'; import PropTypes from 'prop-types'; import { withStyles } from '@material-ui/core/styles'; import Button from '@material-ui/core/Button'; import { TextValidator, ValidatorForm } from 'react-material-ui-form-validator'; import PasswordValidator from '../components/PasswordValidator'; import FormControlLabel from '@material-ui/core/FormControlLabel'; import Switch from '@material-ui/core/Switch'; import FormGroup from '@material-ui/core/FormGroup'; const styles = theme => ({ textField: { width: "100%" }, checkboxControl: { width: "100%" }, chips: { display: 'flex', flexWrap: 'wrap', }, chip: { marginRight: theme.spacing.unit, }, button: { marginRight: theme.spacing.unit * 2, marginTop: theme.spacing.unit * 2, } }); class UserForm extends React.Component { componentWillMount() { ValidatorForm.addValidationRule('uniqueUsername', this.props.uniqueUsername); } render() { const { classes, user, creating, handleValueChange, handleCheckboxChange, onDoneEditing, onCancelEditing } = this.props; return ( } label="Admin?" /> ); } } UserForm.propTypes = { classes: PropTypes.object.isRequired, user: PropTypes.object.isRequired, creating: PropTypes.bool.isRequired, onDoneEditing: PropTypes.func.isRequired, onCancelEditing: PropTypes.func.isRequired, uniqueUsername: PropTypes.func.isRequired, handleValueChange: PropTypes.func.isRequired, handleCheckboxChange: PropTypes.func.isRequired }; export default withStyles(styles)(UserForm);