Changeset 19ad843 for client_app/src/components/register
- Timestamp:
- 01/13/21 01:08:25 (4 years ago)
- Branches:
- master
- Children:
- 7944fab
- Parents:
- 351c43f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client_app/src/components/register/register_user_form.js
r351c43f r19ad843 1 1 import React from 'react'; 2 import { Button, Checkbox, Container, Form } from "semantic-ui-react"; 2 import 'semantic-ui-react'; 3 import {Button, Container, Form} from "semantic-ui-react"; 3 4 import { Redirect } from 'react-router-dom'; 4 5 import SkillFetch from "../../repository/skill_repo"; 5 6 import UserRegister from "../../repository/register_repo"; 7 import {Component} from "react/cjs/react.production.min"; 6 8 7 9 class RegisterUser extends Component { … … 21 23 } 22 24 25 handleCheck = (e, {value}) => { 26 this.setState({ 27 ...this.state, 28 [e.target.name]: value 29 }) 30 } 31 23 32 render() { 24 33 return ( … … 27 36 <Form onSubmit={this.attemptRegister}> 28 37 <Form.Input id="email" name="email" type='email' required fluid label='E-mail' 29 placeholder='Enter e-mail.' onChange={ handleCheck}/>38 placeholder='Enter e-mail.' onChange={this.handleCheck}/> 30 39 <Form.Input id="password" name="password" type='password' required fluid label='Password' 31 placeholder='Enter password.' onChange={handleCheck}/> 32 40 placeholder='Enter password.' onChange={this.handleCheck}/> 41 <Form.Input id="name" name="name" type='text' required fluid label='Name' 42 placeholder='Enter name.' onChange={this.handleCheck}/> 43 <Form.Input id="surname" name="surname" type='text' required fluid label='Surname' 44 placeholder='Enter surname.' onChange={this.handleCheck}/> 45 <label>Skills you know:</label> 46 <select multiple="" class="ui dropdown"> 47 {this.state.allSkills.map(item => { 48 return <option value={item.id}>{item.name}</option> 49 })} 50 </select> 33 51 <Button type="submit">Register</Button> 34 52 </Form> … … 40 58 SkillFetch.fetchAll().then((data) =>{ 41 59 this.setState({ 42 allSkills: data 60 allSkills: data.data 43 61 }) 44 62 })
Note:
See TracChangeset
for help on using the changeset viewer.