From 824a01c499dca9643ed3899ad2c0dce394817b09 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 11 Sep 2018 18:01:17 +0200 Subject: [PATCH] Material UI fields half implemented --- client/public/favicon.ico | Bin 3870 -> 758 bytes client/src/components/UserUpdate.js | 174 +++++++++++++++------------- 2 files changed, 95 insertions(+), 79 deletions(-) diff --git a/client/public/favicon.ico b/client/public/favicon.ico index a11777cc471a4344702741ab1c8a588998b1311a..08c2369b05c014d615766ea699a4a355d454ed25 100644 GIT binary patch literal 758 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaNh0(?STpSW9MBA?7cOhHmb9xo5e1==E8666=m`18dn79M*BrayZh-qaTI zmCkr?yu4|4beYn`w#~+>nYKWut@Cto46!(!8{D~VwE_=IWK-Af(%gUl&F{0ksr?$_ zr+wPT$%wP7&Q0OE$+VDrE7=c)Wysog^s~4=U$OJaqVqlR{CUgoZFtuEhS~9{f=x__ zzg$z!RIZd6$$i0hKboDLCid*mUjdy`^;UrmH|B9nTb6VvT+>^79Y;AZK-eEt`*#*_ z8%4Bi|HPQ_V54Hq&#(4p70!K|soiq_#Uyd3d2jyP9N1xb_Qb~4v)n?GD?$s31&_Rn z?b^m$AimK^^ZZLCmRk(dWhOSvNshGMx%hWXVZq8u8J)<2#QymSN7YX_=B$dll*51U zV?DFAedaZb8O<}^8$L9$Ni5g2G?Mn7lyP*|5do*W!e_IK7HT~U{WA5;CxJ^oSDtH3 zy&gHqVQy#IOvR2Tcb;AH7Mr^+=&5Lz%H-(RS9l)2I_dEC!Tu~Z=jYe|t)KL&Xz7Z2 z+2;Ji;jdSAPq7WYy|?GtquMe*ld0cw3)key-sW56Iz@Y_y%|?LOY5=&S45STif5)3 zE2{|A_$zCj`&tvSa%G)d-%_7mBs%pCTA7B)RSA|5B1SOU$6cpvBW#*(RlvEa^Dr6RvBr`Bn%z6BYhodk| zL*tbH=`)^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pMCWYo=by@ 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.