Changeset 17abe5e for client_app/src/components/login
- Timestamp:
- 01/10/21 19:51:23 (4 years ago)
- Branches:
- master
- Children:
- 6f9b7b0
- Parents:
- a3d2b0d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client_app/src/components/login/login.js
ra3d2b0d r17abe5e 4 4 5 5 const Login = (props) => { 6 7 6 const history = useHistory(); 8 7 const [formData, updateFormData] = React.useState({ 9 username: "",8 email: "", 10 9 password: "", 11 type: " "10 type: "0" 12 11 }) 13 12 … … 21 20 const onFormSubmit = (e) =>{ 22 21 e.preventDefault(); 23 const username = formData.username;22 const email = formData.email; 24 23 const password = formData.password; 25 24 const type = formData.type; 26 25 27 props.onCompleteForm( username,password,type);26 props.onCompleteForm(email,password,type); 28 27 history.push("/"); 29 28 } … … 32 31 <Container> 33 32 <Form onSubmit={onFormSubmit}> 34 <Form.Input id=" username" name="username" type='text' required fluid label='E-mail' placeholder='Enter e-mail.' onChange={handleCheck} />33 <Form.Input id="email" name="email" type='text' required fluid label='E-mail' placeholder='Enter e-mail.' onChange={handleCheck} /> 35 34 <Form.Input id="password" name="password" type='password' required fluid label='Password' placeholder='Enter password.' onChange={handleCheck} /> 36 35 <Form.Field … … 39 38 label='User' 40 39 id="0" 41 name= 'type'42 value= '0'40 name="type" 41 value="0" 43 42 checked={formData.type === "0"} 44 43 onChange={handleCheck} … … 49 48 label='Team' 50 49 id="1" 51 name= 'type'52 value= '1'50 name="type" 51 value="1" 53 52 checked={formData.type === "1"} 54 53 onChange={handleCheck} … … 59 58 label='Company' 60 59 id="2" 61 name= 'type'62 value= '2'60 name="type" 61 value="2" 63 62 checked={formData.type === "2"} 64 63 onChange={handleCheck}
Note:
See TracChangeset
for help on using the changeset viewer.