Changeset 580ba1a for client_app/src/components/register
- Timestamp:
- 01/14/21 02:31:15 (4 years ago)
- Branches:
- master
- Children:
- be373a8
- Parents:
- df3a395
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client_app/src/components/register/register_company_form.js
rdf3a395 r580ba1a 13 13 password: "", 14 14 name:"", 15 members: "",15 country: "", 16 16 city: "", 17 17 street: "", … … 34 34 this.state.password, 35 35 this.state.name, 36 this.state.country 37 ,this.state.city,36 this.state.country, 37 this.state.city, 38 38 this.state.street 39 39 ).then(res =>{ … … 52 52 }).catch(err => { 53 53 this.setState({ 54 error: " Companyalready exists!",54 error: "User already exists!", 55 55 success: null 56 56 }) … … 58 58 } 59 59 60 componentDidMount(){61 this.props.message(null);62 }63 64 60 render() { 65 if (this.state.success!=null){66 return (61 if (this.state.success != null) { 62 return ( 67 63 <Redirect to={"/login"}/> 68 64 ); 69 65 } 70 66 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 67 return ( 68 <Container> 69 <h1 style={{color: "red"}}>{this.state.error}</h1> 70 <Form onSubmit={this.attemptCompanyRegister}> 71 <Form.Input id="email" name="email" type='email' required fluid label='E-mail' 72 placeholder='Enter e-mail.' onChange={this.handleCheck}/> 73 <Form.Input id="password" name="password" type='password' required fluid label='Password' 74 placeholder='Enter password.' onChange={this.handleCheck}/> 75 <Form.Input id="name" name="name" type='text' required fluid label='Name' 76 placeholder='Enter company name.' onChange={this.handleCheck}/> 77 <Form.Input id="country" name="country" type='text' required fluid label='Country' 78 placeholder='Enter your country.' onChange={this.handleCheck}/> 79 <Form.Input id="city" name="city" type='text' required fluid label='City' 80 placeholder='Enter your city.' onChange={this.handleCheck}/> 81 <Form.Input id="street" name="street" type='text' required fluid label='Street' 82 placeholder='Enter address street.' onChange={this.handleCheck}/> 83 <Form.Field control={Button}>Register</Form.Field> 84 </Form> 85 </Container> 86 ); 91 87 } 92 88 }
Note:
See TracChangeset
for help on using the changeset viewer.