Showing
1 changed file
with
86 additions
and
0 deletions
frontend/src/components/SignIn.js
0 → 100644
1 | +import React, { useState, useEffect } from 'react' | ||
2 | +import { useHistory, Redirect } from 'react-router-dom' | ||
3 | +import { | ||
4 | + Container, | ||
5 | + Heading, | ||
6 | + Button, | ||
7 | + Segment, | ||
8 | + Message, | ||
9 | + Divider, | ||
10 | + Form, | ||
11 | + Input, | ||
12 | + Transition, | ||
13 | + Select, | ||
14 | + Checkbox, | ||
15 | + FormControl, | ||
16 | + FormLabel, | ||
17 | + FormErrorMessage, | ||
18 | + FormHelperText, | ||
19 | + VStack, | ||
20 | + Stack, | ||
21 | + StackDivider, | ||
22 | + Box, | ||
23 | + Text, | ||
24 | + InputGroup, | ||
25 | + InputLeftElement, | ||
26 | + InputRightElement, | ||
27 | +} from '@chakra-ui/react' | ||
28 | +import { PhoneIcon } from '@chakra-ui/icons' | ||
29 | +import http from '../utils/http' | ||
30 | + | ||
31 | +const SignIn = () => { | ||
32 | + const [username, setUsername] = useState('') | ||
33 | + const [password, setPassword] = useState('') | ||
34 | + | ||
35 | + const handleUsernameOnChange = (event) => { | ||
36 | + setUsername(event.target.value) | ||
37 | + } | ||
38 | + | ||
39 | + const handlePasswordOnChange = (event) => { | ||
40 | + setPassword(event.target.value) | ||
41 | + } | ||
42 | + | ||
43 | + | ||
44 | + useEffect(() => { | ||
45 | + }, []) | ||
46 | + | ||
47 | + return ( | ||
48 | + <Container> | ||
49 | + <Heading>Sign-In</Heading> | ||
50 | + <br /> | ||
51 | + | ||
52 | + <Stack | ||
53 | + // divider={<StackDivider borderColor="gray.200"/>} | ||
54 | + spacing={4} | ||
55 | + align="stretch" | ||
56 | + > | ||
57 | + <Input | ||
58 | + type="text" | ||
59 | + placeholder="username" | ||
60 | + value={username} | ||
61 | + onChange={handleUsernameOnChange} | ||
62 | + /> | ||
63 | + | ||
64 | + <InputGroup size="md"> | ||
65 | + <Input | ||
66 | + pr="4.5rem" | ||
67 | + type="password" | ||
68 | + placeholder="Enter password" | ||
69 | + value={password} | ||
70 | + onChange={handlePasswordOnChange} | ||
71 | + /> | ||
72 | + <InputRightElement width="4.5rem"> | ||
73 | + </InputRightElement> | ||
74 | + </InputGroup> | ||
75 | + | ||
76 | + <Button | ||
77 | + colorScheme="teal" | ||
78 | + > | ||
79 | + Sign In | ||
80 | + </Button> | ||
81 | + </Stack> | ||
82 | + </Container> | ||
83 | + ) | ||
84 | +} | ||
85 | + | ||
86 | +export default SignIn |
-
Please register or login to post a comment