Last change
on this file was bc20307, checked in by Tasevski2 <39170279+Tasevski2@…>, 3 years ago |
Push before video
|
-
Property mode
set to
100644
|
File size:
2.5 KB
|
Rev | Line | |
---|
[bc20307] | 1 | import { Link } from 'react-router-dom';
|
---|
| 2 | import useForm from '../../../hooks/useForm';
|
---|
| 3 | import useRegisterUser from '../../../hooks/useRegisterUser';
|
---|
| 4 | import {
|
---|
| 5 | CredentialsWrapper,
|
---|
| 6 | Input,
|
---|
| 7 | LockIcon,
|
---|
| 8 | PersonIcon,
|
---|
| 9 | PhoneIcon,
|
---|
| 10 | RegisterButton,
|
---|
| 11 | FullNameWrapper,
|
---|
| 12 | LoginText,
|
---|
| 13 | } from './styles';
|
---|
| 14 |
|
---|
| 15 | const Register = () => {
|
---|
| 16 | const { registerUser } = useRegisterUser();
|
---|
| 17 | const { data, onFormChange } = useForm({
|
---|
| 18 | firstName: '',
|
---|
| 19 | lastName: '',
|
---|
| 20 | email: '',
|
---|
| 21 | mobile: '',
|
---|
| 22 | password: '',
|
---|
| 23 | });
|
---|
| 24 | return (
|
---|
| 25 | <>
|
---|
| 26 | <CredentialsWrapper>
|
---|
| 27 | <FullNameWrapper>
|
---|
| 28 | <Input
|
---|
| 29 | name='firstName'
|
---|
| 30 | placeholder='Име'
|
---|
| 31 | style={{
|
---|
| 32 | width: '49%',
|
---|
| 33 | }}
|
---|
| 34 | value={data.firstName}
|
---|
| 35 | onChange={onFormChange}
|
---|
| 36 | />
|
---|
| 37 | <Input
|
---|
| 38 | name='lastName'
|
---|
| 39 | placeholder='Презиме'
|
---|
| 40 | style={{
|
---|
| 41 | width: '49%',
|
---|
| 42 | }}
|
---|
| 43 | value={data.lastName}
|
---|
| 44 | onChange={onFormChange}
|
---|
| 45 | />
|
---|
| 46 | </FullNameWrapper>
|
---|
| 47 | <Input
|
---|
| 48 | name='mobile'
|
---|
| 49 | placeholder='Телефонски број'
|
---|
| 50 | value={data.mobile}
|
---|
| 51 | onChange={onFormChange}
|
---|
| 52 | InputProps={{
|
---|
| 53 | startAdornment: <PhoneIcon />,
|
---|
| 54 | }}
|
---|
| 55 | />
|
---|
| 56 | <Input
|
---|
| 57 | name='email'
|
---|
| 58 | placeholder='Емаил адреса'
|
---|
| 59 | value={data.email}
|
---|
| 60 | onChange={onFormChange}
|
---|
| 61 | InputProps={{
|
---|
| 62 | startAdornment: <PersonIcon />,
|
---|
| 63 | }}
|
---|
| 64 | />
|
---|
| 65 | <Input
|
---|
| 66 | name='password'
|
---|
| 67 | placeholder='Лозинка'
|
---|
| 68 | value={data.password}
|
---|
| 69 | onChange={onFormChange}
|
---|
| 70 | InputProps={{
|
---|
| 71 | startAdornment: <LockIcon />,
|
---|
| 72 | }}
|
---|
| 73 | type='password'
|
---|
| 74 | />
|
---|
| 75 | </CredentialsWrapper>
|
---|
| 76 | <RegisterButton onClick={() => registerUser(data)}>
|
---|
| 77 | Регистрирај се
|
---|
| 78 | </RegisterButton>
|
---|
| 79 | <LoginText>
|
---|
| 80 | Имате Профил? <Link to='/login'>Најавете се!</Link>
|
---|
| 81 | </LoginText>
|
---|
| 82 | </>
|
---|
| 83 | );
|
---|
| 84 | };
|
---|
| 85 |
|
---|
| 86 | export default Register;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.