ch4n3.yoon

[New] Sign Up 기능 추가

...@@ -4,12 +4,14 @@ ...@@ -4,12 +4,14 @@
4 "private": true, 4 "private": true,
5 "dependencies": { 5 "dependencies": {
6 "@chakra-ui/core": "^0.8.0", 6 "@chakra-ui/core": "^0.8.0",
7 + "@chakra-ui/icons": "^1.0.13",
7 "@chakra-ui/react": "^1.6.3", 8 "@chakra-ui/react": "^1.6.3",
8 "@emotion/react": "11", 9 "@emotion/react": "11",
9 "@emotion/styled": "11", 10 "@emotion/styled": "11",
10 "@testing-library/jest-dom": "^5.11.4", 11 "@testing-library/jest-dom": "^5.11.4",
11 "@testing-library/react": "^11.1.0", 12 "@testing-library/react": "^11.1.0",
12 "@testing-library/user-event": "^12.1.10", 13 "@testing-library/user-event": "^12.1.10",
14 + "axios": "^0.21.1",
13 "framer-motion": "4", 15 "framer-motion": "4",
14 "react": "^17.0.2", 16 "react": "^17.0.2",
15 "react-dom": "^17.0.2", 17 "react-dom": "^17.0.2",
......
...@@ -2,6 +2,7 @@ import React, { useEffect } from 'react' ...@@ -2,6 +2,7 @@ import React, { useEffect } from 'react'
2 import { BrowserRouter, Route, Redirect, Switch, Link } from 'react-router-dom' 2 import { BrowserRouter, Route, Redirect, Switch, Link } from 'react-router-dom'
3 import { ChakraProvider } from '@chakra-ui/react' 3 import { ChakraProvider } from '@chakra-ui/react'
4 import Index from './components/Index' 4 import Index from './components/Index'
5 +import SignIn from './components/SignIn'
5 import DockerContainerCreate from './components/DockerContainerCreate' 6 import DockerContainerCreate from './components/DockerContainerCreate'
6 7
7 const App = () => { 8 const App = () => {
...@@ -10,6 +11,7 @@ const App = () => { ...@@ -10,6 +11,7 @@ const App = () => {
10 <BrowserRouter> 11 <BrowserRouter>
11 <Switch> 12 <Switch>
12 <Route exact path="/" component={Index}/> 13 <Route exact path="/" component={Index}/>
14 + <Route exact path="/sign-in" component={SignIn}/>
13 <Route exact path="/docker/container/create" component={DockerContainerCreate}/> 15 <Route exact path="/docker/container/create" component={DockerContainerCreate}/>
14 <Redirect path="*" to="/"/> 16 <Redirect path="*" to="/"/>
15 </Switch> 17 </Switch>
......
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 SignUp = () => {
32 + const [username, setUsername] = useState('')
33 + const [password, setPassword] = useState('')
34 + const [email, setEmail] = useState('')
35 + const [phone, setPhone] = useState('')
36 +
37 + const handleUsernameOnChange = (event) => {
38 + setUsername(event.target.value)
39 + }
40 +
41 + const handlePasswordOnChange = (event) => {
42 + setPassword(event.target.value)
43 + }
44 +
45 + const handlePhoneOnChange = (event) => {
46 + setPhone(event.target.value)
47 + }
48 +
49 + const handleEmailOnChange = (event) => {
50 + setEmail(event.target.value)
51 + }
52 +
53 + useEffect(() => {
54 + }, [])
55 +
56 + return (
57 + <Container>
58 + <Heading>Sign-Up</Heading>
59 + <br />
60 +
61 + <Stack
62 + // divider={<StackDivider borderColor="gray.200"/>}
63 + spacing={4}
64 + align="stretch"
65 + >
66 + <Input
67 + type="text"
68 + placeholder="username"
69 + value={username}
70 + onChange={handleUsernameOnChange}
71 + />
72 +
73 + <InputGroup size="md">
74 + <Input
75 + pr="4.5rem"
76 + type="password"
77 + placeholder="Enter password"
78 + value={password}
79 + onChange={handlePasswordOnChange}
80 + />
81 + <InputRightElement width="4.5rem">
82 + </InputRightElement>
83 + </InputGroup>
84 +
85 + <Input
86 + type="email"
87 + placeholder="email"
88 + value={email}
89 + onChange={handleEmailOnChange}
90 + />
91 +
92 +
93 + <InputGroup>
94 + <InputLeftElement
95 + pointerEvents="none"
96 + children={<PhoneIcon color="gray.300" />}
97 + />
98 + <Input
99 + type="tel"
100 + placeholder="phone"
101 + value={phone}
102 + onChange={handlePhoneOnChange}
103 + />
104 + </InputGroup>
105 +
106 + <Button
107 + colorScheme="teal"
108 + >
109 + Sign Up
110 + </Button>
111 + </Stack>
112 + </Container>
113 + )
114 +}
115 +
116 +export default SignUp
...@@ -1317,6 +1317,14 @@ ...@@ -1317,6 +1317,14 @@
1317 dependencies: 1317 dependencies:
1318 "@chakra-ui/utils" "1.8.0" 1318 "@chakra-ui/utils" "1.8.0"
1319 1319
1320 +"@chakra-ui/icons@^1.0.13":
1321 + version "1.0.13"
1322 + resolved "https://registry.yarnpkg.com/@chakra-ui/icons/-/icons-1.0.13.tgz#d8eb04479b048d8023ae90d76205cd4a0bf7dd79"
1323 + integrity sha512-twDpFz2uPVboMTEI4QA2y3EJND3G4+/9AVs730fgnnfhTw4EOJt0Lhfm4Spq1qi1LgHF16x4/Lao1E2imB5lWw==
1324 + dependencies:
1325 + "@chakra-ui/icon" "1.1.9"
1326 + "@types/react" "^17.0.0"
1327 +
1320 "@chakra-ui/image@1.0.15": 1328 "@chakra-ui/image@1.0.15":
1321 version "1.0.15" 1329 version "1.0.15"
1322 resolved "https://registry.yarnpkg.com/@chakra-ui/image/-/image-1.0.15.tgz#57aaf7e22d2793b9278481aab56b27063a922e5b" 1330 resolved "https://registry.yarnpkg.com/@chakra-ui/image/-/image-1.0.15.tgz#57aaf7e22d2793b9278481aab56b27063a922e5b"
...@@ -2642,6 +2650,15 @@ ...@@ -2642,6 +2650,15 @@
2642 "@types/scheduler" "*" 2650 "@types/scheduler" "*"
2643 csstype "^3.0.2" 2651 csstype "^3.0.2"
2644 2652
2653 +"@types/react@^17.0.0":
2654 + version "17.0.11"
2655 + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.11.tgz#67fcd0ddbf5a0b083a0f94e926c7d63f3b836451"
2656 + integrity sha512-yFRQbD+whVonItSk7ZzP/L+gPTJVBkL/7shLEF+i9GC/1cV3JmUxEQz6+9ylhUpWSDuqo1N9qEvqS6vTj4USUA==
2657 + dependencies:
2658 + "@types/prop-types" "*"
2659 + "@types/scheduler" "*"
2660 + csstype "^3.0.2"
2661 +
2645 "@types/resolve@0.0.8": 2662 "@types/resolve@0.0.8":
2646 version "0.0.8" 2663 version "0.0.8"
2647 resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" 2664 resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194"
...@@ -3388,6 +3405,13 @@ axe-core@^4.0.2: ...@@ -3388,6 +3405,13 @@ axe-core@^4.0.2:
3388 resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.1.2.tgz#7cf783331320098bfbef620df3b3c770147bc224" 3405 resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.1.2.tgz#7cf783331320098bfbef620df3b3c770147bc224"
3389 integrity sha512-V+Nq70NxKhYt89ArVcaNL9FDryB3vQOd+BFXZIfO3RP6rwtj+2yqqqdHEkacutglPaZLkJeuXKCjCJDMGPtPqg== 3406 integrity sha512-V+Nq70NxKhYt89ArVcaNL9FDryB3vQOd+BFXZIfO3RP6rwtj+2yqqqdHEkacutglPaZLkJeuXKCjCJDMGPtPqg==
3390 3407
3408 +axios@^0.21.1:
3409 + version "0.21.1"
3410 + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8"
3411 + integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==
3412 + dependencies:
3413 + follow-redirects "^1.10.0"
3414 +
3391 axobject-query@^2.2.0: 3415 axobject-query@^2.2.0:
3392 version "2.2.0" 3416 version "2.2.0"
3393 resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" 3417 resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be"
...@@ -5982,6 +6006,11 @@ follow-redirects@^1.0.0: ...@@ -5982,6 +6006,11 @@ follow-redirects@^1.0.0:
5982 resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.2.tgz#dd73c8effc12728ba5cf4259d760ea5fb83e3147" 6006 resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.2.tgz#dd73c8effc12728ba5cf4259d760ea5fb83e3147"
5983 integrity sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA== 6007 integrity sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA==
5984 6008
6009 +follow-redirects@^1.10.0:
6010 + version "1.14.1"
6011 + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43"
6012 + integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==
6013 +
5985 for-in@^1.0.2: 6014 for-in@^1.0.2:
5986 version "1.0.2" 6015 version "1.0.2"
5987 resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" 6016 resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
......