Ignore:
Timestamp:
01/10/21 19:51:23 (3 years ago)
Author:
i-ina <76742075+i-ina@…>
Branches:
master
Children:
6f9b7b0
Parents:
a3d2b0d
Message:

react components for details and bugfix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • client_app/src/components/login/login.js

    ra3d2b0d r17abe5e  
    44
    55const Login = (props) => {
    6 
    76    const history = useHistory();
    87    const [formData, updateFormData] = React.useState({
    9         username: "",
     8        email: "",
    109        password: "",
    11         type: ""
     10        type: "0"
    1211    })
    1312
     
    2120    const onFormSubmit = (e) =>{
    2221        e.preventDefault();
    23         const username = formData.username;
     22        const email = formData.email;
    2423        const password = formData.password;
    2524        const type = formData.type;
    2625
    27         props.onCompleteForm(username,password,type);
     26        props.onCompleteForm(email,password,type);
    2827        history.push("/");
    2928    }
     
    3231        <Container>
    3332            <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} />
    3534                <Form.Input id="password" name="password" type='password' required fluid label='Password' placeholder='Enter password.' onChange={handleCheck} />
    3635                <Form.Field
     
    3938                    label='User'
    4039                    id="0"
    41                     name='type'
    42                     value='0'
     40                    name="type"
     41                    value="0"
    4342                    checked={formData.type === "0"}
    4443                    onChange={handleCheck}
     
    4948                    label='Team'
    5049                    id="1"
    51                     name='type'
    52                     value='1'
     50                    name="type"
     51                    value="1"
    5352                    checked={formData.type === "1"}
    5453                    onChange={handleCheck}
     
    5958                    label='Company'
    6059                    id="2"
    61                     name='type'
    62                     value='2'
     60                    name="type"
     61                    value="2"
    6362                    checked={formData.type === "2"}
    6463                    onChange={handleCheck}
Note: See TracChangeset for help on using the changeset viewer.