diff --git a/client/public/favicon.ico b/client/public/favicon.ico index a11777cc4..08c2369b0 100644 Binary files a/client/public/favicon.ico and b/client/public/favicon.ico differ diff --git a/client/src/components/UserUpdate.js b/client/src/components/UserUpdate.js index 3560cd6aa..6e9b5b7cf 100644 --- a/client/src/components/UserUpdate.js +++ b/client/src/components/UserUpdate.js @@ -3,6 +3,38 @@ import ReactDOM from 'react-dom'; import {graphql, compose} from 'react-apollo'; import {getRolesQuery, updateUserMutation, getUsersQuery} from '../queries/queries'; +//Material-ui +import PropTypes from 'prop-types'; +import { withStyles } from '@material-ui/core/styles'; +import MenuItem from '@material-ui/core/MenuItem'; +import IconButton from '@material-ui/core/IconButton'; +import InputAdornment from '@material-ui/core/InputAdornment'; +import TextField from '@material-ui/core/TextField'; +import Visibility from '@material-ui/icons/Visibility'; +import VisibilityOff from '@material-ui/icons/VisibilityOff'; +import FormControl from '@material-ui/core/FormControl'; +import InputLabel from '@material-ui/core/InputLabel'; +import Input from '@material-ui/core/Input'; +import classNames from 'classnames'; +import Button from '@material-ui/core/Button'; +import AddIcon from '@material-ui/icons/Add'; + +const styles = theme => ({ + container: { + display: 'flex', + flexWrap: 'wrap', + padding: 20 + }, + textField: { + width: '60%', + marginLeft:'20%', + marginTop: 20 + }, + menu: { + width: 200, + }, +}); + class UserUpdate extends Component { constructor(props){ @@ -24,7 +56,7 @@ class UserUpdate extends Component { roleId: '1' }; - console.log("constructor"); + console.log("constructor "); } displayRoles(){ @@ -136,18 +168,9 @@ class UserUpdate extends Component { this.setState({ roleId:e.target.value }) } - componentDidMount(){ -console.log("component did mount"); - this.setState({}); - } - - componentWillUnmount(){ -console.log("component will UNmount"); - } - - componentDidUpdate () + componentWillMount () { - console.log("component did update"); + console.log("componentWillUnmount"); console.log("state", this.state); if (this.defaultValuesSet === false) { @@ -160,7 +183,7 @@ console.log("component will UNmount"); this.defaultValuesSet= true; /* Now we can set the default values for the form fields. */ - + /* this.refs.alias.value = user.alias; this.refs.firstName.value = user.firstName; this.refs.middleName.value = user.middleName; @@ -173,10 +196,13 @@ console.log("component will UNmount"); this.refs.select.value = user.role.id; console.log("select value ", this.refs.select.value); console.log("select ", this.refs.select); - + */ this.setState({ id: user.id, + alias: user.alias, + email: user.email, + emailVerified: user.emailVerified, firstName: user.firstName, middleName: user.middleName, lastName: user.lastName, @@ -191,103 +217,92 @@ console.log("component will UNmount"); render(){ console.log("render"); +console.log("props", this.props); +console.log("State", this.state); + const { classes } = this.props; return(
-
+

This is your basic information we got from the social identity provider you used to sign up. This information can not be changed.

-
-
- - - -
-
-
-
- + + - - -
-
-
-
+ + -
-
+

Complete your profile with the following optional information. Providing your real name might help other users trust you more.

-
-
- this.setState({ firstName:e.target.value})}> - - -
-
-
-
- this.setState({firstName:e.target.value})} + > + + + this.setState({ middleName:e.target.value})}> - - -
-
-
-
- this.setState({middleName:e.target.value})} + > + + + this.setState({ lastName:e.target.value})}> - - -
-
+ value = {this.state.lastName} + label = "First Name" + className={classes.textField} + onChange={(e)=>this.setState({lastName:e.target.value})} + > + + + +

Check the following options to enable specialized tools designed for each role. You can allways come back and change these settings later.

-
-
+ -
-
-
-
+ -
-
-
-
+ -
-
+

Select the role you would like to play now.

-
+ -
-
+ + -
+
@@ -298,5 +313,6 @@ console.log("render"); export default compose( graphql(getRolesQuery, {name: "getRolesQuery"}), - graphql(updateUserMutation, {name: "updateUserMutation"}) + graphql(updateUserMutation, {name: "updateUserMutation"}), + withStyles(styles) ) (UserUpdate); // This technique binds more than one query to a single component.