Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
Today KU
Commits
0c3b8467
Commit
0c3b8467
authored
Oct 11, 2021
by
Choi Ga Young
Browse files
로그인, 회원가입 페이지
parent
c5f9ed3c
Changes
6
Hide whitespace changes
Inline
Side-by-side
client/src/App.js
View file @
0c3b8467
...
@@ -11,9 +11,10 @@ import Err from "./pages/ErrorPage";
...
@@ -11,9 +11,10 @@ import Err from "./pages/ErrorPage";
function
App
()
{
function
App
()
{
return
(
return
(
<
Router
basename
=
{
process
.
env
.
PUBLIC_URL
}
>
<
Router
basename
=
{
process
.
env
.
PUBLIC_URL
}
>
<
div
className
=
"
mx-auto
"
style
=
{{
width
:
"
400px
"
}}
>
<
div
id
=
"
box
"
className
=
"
container mx-sm-auto
"
>
<
Switch
>
<
Switch
>
<
Route
exact
path
=
"
/
"
component
=
{
Err
}
/
>
<
Route
exact
path
=
"
/
"
component
=
{
Err
}
/
>
<
Route
path
=
"
/login
"
component
=
{
LoginPage
}
/
>
<
Route
path
=
"
/signup
"
component
=
{
SignupPage
}
/
>
<
Route
path
=
"
/signup
"
component
=
{
SignupPage
}
/
>
<
Route
path
=
"
/home
"
component
=
{
HomePage
}
/
>
<
Route
path
=
"
/home
"
component
=
{
HomePage
}
/
>
<
Route
path
=
"
/schedule/edit
"
component
=
{
ScheduleEditPage
}
/
>
<
Route
path
=
"
/schedule/edit
"
component
=
{
ScheduleEditPage
}
/
>
...
...
client/src/components/LoginForm.js
0 → 100644
View file @
0c3b8467
import
React
from
'
react
'
;
import
{
Formik
}
from
'
formik
'
;
import
*
as
Yup
from
'
yup
'
;
import
{
Link
}
from
"
react-router-dom
"
;
const
LoginForm
=
()
=>
{
return
(
<
div
>
<
Formik
initialValues
=
{{
userId
:
''
,
password
:
''
,
}}
validationSchema
=
{
Yup
.
object
({
userId
:
Yup
.
string
()
.
required
(
'
아이디를 입력해주세요.
'
),
password
:
Yup
.
string
()
.
required
(
'
비밀번호를 입력해주세요.
'
),
})}
onSubmit
=
{(
values
,
{
setSubmitting
})
=>
{
setTimeout
(()
=>
{
alert
(
JSON
.
stringify
(
values
,
null
,
2
));
setSubmitting
(
false
);
},
400
);
}}
>
{
formik
=>
(
<
form
onSubmit
=
{
formik
.
handleSubmit
}
className
=
"
m-5
"
>
<
div
className
=
"
mb-3
"
>
<
input
type
=
"
text
"
name
=
"
userId
"
className
=
"
form-control border-top-0 border-end-0 border-start-0
"
style
=
{{
boxShadow
:
"
none
"
,
borderRadius
:
"
0
"
}}
placeholder
=
"
아이디
"
{...
formik
.
getFieldProps
(
'
userId
'
)}
/
>
{
formik
.
touched
.
userId
&&
formik
.
errors
.
userId
?
(
<
div
className
=
"
text-danger
"
style
=
{{
fontSize
:
"
10px
"
}}
>
{
formik
.
errors
.
userId
}
<
/div
>
)
:
null
}
<
/div
>
<
div
className
=
"
mb-3
"
>
<
input
type
=
"
password
"
name
=
"
password
"
className
=
"
form-control border-top-0 border-end-0 border-start-0
"
style
=
{{
boxShadow
:
"
none
"
,
borderRadius
:
"
0
"
}}
placeholder
=
"
비밀번호
"
{...
formik
.
getFieldProps
(
'
password
'
)}
/
>
{
formik
.
touched
.
password
&&
formik
.
errors
.
password
?
(
<
div
className
=
"
text-danger
"
style
=
{{
fontSize
:
"
10px
"
}}
>
{
formik
.
errors
.
password
}
<
/div
>
)
:
null
}
<
/div
>
<
div
className
=
"
d-grid gap-2 mt-5
"
>
<
button
type
=
"
submit
"
className
=
"
btn btn-crimson
"
>
로그인
<
/button
>
<
Link
className
=
"
btn btn-crimson
"
to
=
"
/signup
"
>
회원가입
<
/Link
>
<
/div
>
<
/form
>
)}
<
/Formik
>
<
/div
>
);
}
export
default
LoginForm
;
client/src/components/SignupForm.js
View file @
0c3b8467
...
@@ -6,11 +6,15 @@ const SignupForm = () => {
...
@@ -6,11 +6,15 @@ const SignupForm = () => {
return
(
return
(
<
div
>
<
div
>
<
div
>
<
div
>
<
h1
className
=
"
text-center
"
>
회원가입
<
/h1
>
<
button
className
=
"
btn btn-crimson mt-2
"
><
i
className
=
"
bi bi-arrow-left
"
><
/i></
button
>
<
/div
>
<
div
className
=
"
d-inline-block
"
style
=
{{
width
:
"
-webkit-fill-available
"
}}
>
<
h1
className
=
"
text-center my-4
"
>
회원가입
<
/h1
>
<
/div
>
<
/div
>
<
Formik
<
Formik
initialValues
=
{{
initialValues
=
{{
userI
D
:
''
,
userI
d
:
''
,
password
:
''
,
password
:
''
,
repassword
:
''
,
repassword
:
''
,
userName
:
''
,
userName
:
''
,
...
@@ -43,53 +47,70 @@ const SignupForm = () => {
...
@@ -43,53 +47,70 @@ const SignupForm = () => {
}}
}}
>
>
{
formik
=>
(
{
formik
=>
(
<
form
onSubmit
=
{
formik
.
handleSubmit
}
>
<
form
onSubmit
=
{
formik
.
handleSubmit
}
className
=
"
mt-5
"
>
<
div
>
<
div
className
=
"
mb-3 d-flex flex-row
"
>
<
label
className
=
"
form-label
"
>
아이디
<
/label
>
<
label
className
=
"
form-label
"
style
=
{{
width
:
"
100px
"
}}
>
아이디
<
/label
>
<
input
type
=
"
text
"
name
=
"
userID
"
<
div
className
=
"
flex-col
"
>
className
=
"
form-control border-top-0 border-end-0 border-start-0
"
<
input
type
=
"
text
"
name
=
"
userId
"
{...
formik
.
getFieldProps
(
'
userID
'
)}
/
>
className
=
"
form-control border-top-0 border-end-0 border-start-0
"
{
formik
.
touched
.
userID
&&
formik
.
errors
.
userID
?
(
style
=
{{
boxShadow
:
"
none
"
,
borderRadius
:
"
0
"
}}
<
div
className
=
"
text-secondary
"
>
{
formik
.
errors
.
userID
}
<
/div
>
{...
formik
.
getFieldProps
(
'
userId
'
)}
/
>
)
:
null
}
{
formik
.
touched
.
userId
&&
formik
.
errors
.
userId
?
(
<
div
className
=
"
text-danger
"
style
=
{{
fontSize
:
"
10px
"
}}
>
{
formik
.
errors
.
userId
}
<
/div
>
)
:
null
}
<
/div
>
<
/div
>
<
div
className
=
"
mb-3 d-flex flex-row
"
>
<
label
className
=
"
form-label
"
style
=
{{
width
:
"
100px
"
}}
>
비밀번호
<
/label
>
<
div
className
=
"
flex-col
"
>
<
input
type
=
"
password
"
name
=
"
password
"
className
=
"
form-control border-top-0 border-end-0 border-start-0
"
style
=
{{
boxShadow
:
"
none
"
,
borderRadius
:
"
0
"
}}
{...
formik
.
getFieldProps
(
'
password
'
)}
/
>
{
formik
.
touched
.
password
&&
formik
.
errors
.
password
?
(
<
div
className
=
"
text-danger
"
style
=
{{
fontSize
:
"
10px
"
}}
>
{
formik
.
errors
.
password
}
<
/div
>
)
:
null
}
<
/div
>
<
/div
>
<
/div
>
<
div
>
<
div
className
=
"
mb-3 d-flex flex-row
"
>
<
label
className
=
"
form-label
"
>
비밀번호
<
/label
>
<
label
className
=
"
form-label
"
style
=
{{
width
:
"
100px
"
,
wordBreak
:
"
keep-all
"
}}
>
비밀번호
확인
<
/label
>
<
input
type
=
"
password
"
name
=
"
password
"
<
div
className
=
"
flex-col
"
>
className
=
"
form-control border-top-0 border-end-0 border-start-0
"
<
input
type
=
"
password
"
name
=
"
repassword
"
{...
formik
.
getFieldProps
(
'
password
'
)}
/
>
className
=
"
form-control border-top-0 border-end-0 border-start-0
"
{
formik
.
touched
.
password
&&
formik
.
errors
.
password
?
(
style
=
{{
boxShadow
:
"
none
"
,
borderRadius
:
"
0
"
}}
<
div
className
=
"
text-secondary
"
>
{
formik
.
errors
.
password
}
<
/div
>
{...
formik
.
getFieldProps
(
'
repassword
'
)}
/
>
)
:
null
}
{
formik
.
touched
.
repassword
&&
formik
.
errors
.
repassword
?
(
<
div
className
=
"
text-danger
"
style
=
{{
fontSize
:
"
10px
"
}}
>
{
formik
.
errors
.
repassword
}
<
/div
>
)
:
null
}
<
/div
>
<
/div
>
<
/div
>
<
div
>
<
div
className
=
"
mb-3 d-flex flex-row
"
>
<
label
className
=
"
form-label
"
>
비밀번호
확인
<
/label
>
<
label
className
=
"
form-label
"
style
=
{{
width
:
"
100px
"
}}
>
이름
<
/label
>
<
input
type
=
"
password
"
name
=
"
repassword
"
<
div
className
=
"
flex-col
"
>
className
=
"
form-control border-top-0 border-end-0 border-start-0
"
<
input
type
=
"
text
"
name
=
"
userName
"
{...
formik
.
getFieldProps
(
'
repassword
'
)}
/
>
className
=
"
form-control border-top-0 border-end-0 border-start-0
"
{
formik
.
touched
.
repassword
&&
formik
.
errors
.
repassword
?
(
style
=
{{
boxShadow
:
"
none
"
,
borderRadius
:
"
0
"
}}
<
div
className
=
"
text-secondary
"
>
{
formik
.
errors
.
repassword
}
<
/div
>
{...
formik
.
getFieldProps
(
'
userName
'
)}
/
>
)
:
null
}
{
formik
.
touched
.
userName
&&
formik
.
errors
.
userName
?
(
<
div
className
=
"
text-danger
"
style
=
{{
fontSize
:
"
10px
"
}}
>
{
formik
.
errors
.
userName
}
<
/div
>
)
:
null
}
<
/div
>
<
/div
>
<
/div
>
<
div
>
<
div
className
=
"
mb-3 d-flex flex-row
"
>
<
label
className
=
"
form-label
"
>
이름
<
/label
>
<
label
className
=
"
form-label
"
style
=
{{
width
:
"
100px
"
}}
>
학번
<
/label
>
<
input
type
=
"
text
"
name
=
"
userName
"
<
div
className
=
"
flex-col
"
>
className
=
"
form-control border-top-0 border-end-0 border-start-0
"
<
input
type
=
"
text
"
name
=
"
userStudNum
"
{...
formik
.
getFieldProps
(
'
userName
'
)}
/
>
className
=
"
form-control border-top-0 border-end-0 border-start-0
"
{
formik
.
touched
.
userName
&&
formik
.
errors
.
userName
?
(
style
=
{{
boxShadow
:
"
none
"
,
borderRadius
:
"
0
"
}}
<
div
className
=
"
text-secondary
"
>
{
formik
.
errors
.
userName
}
<
/div
>
{...
formik
.
getFieldProps
(
'
userStudNum
'
)}
/
>
)
:
null
}
{
formik
.
touched
.
userStudNum
&&
formik
.
errors
.
userStudNum
?
(
<
div
className
=
"
text-danger
"
style
=
{{
fontSize
:
"
10px
"
}}
>
{
formik
.
errors
.
userStudNum
}
<
/div
>
)
:
null
}
<
/div
>
<
/div
>
<
/div
>
<
div
>
<
div
className
=
"
d-grid gap-2
"
>
<
label
className
=
"
form-label
"
>
학번
<
/label
>
<
button
type
=
"
submit
"
className
=
"
btn btn-crimson my-5
"
>
확인
<
/button
>
<
input
type
=
"
text
"
name
=
"
userStudNum
"
className
=
"
form-control border-top-0 border-end-0 border-start-0
"
{...
formik
.
getFieldProps
(
'
userStudNum
'
)}
/
>
{
formik
.
touched
.
userStudNum
&&
formik
.
errors
.
userStudNum
?
(
<
div
className
=
"
text-secondary
"
>
{
formik
.
errors
.
userStudNum
}
<
/div
>
)
:
null
}
<
/div
>
<
/div
>
<
button
type
=
"
submit
"
>
확인
<
/button
>
<
/form
>
<
/form
>
)}
)}
<
/Formik
>
<
/Formik
>
...
...
client/src/index.js
View file @
0c3b8467
...
@@ -2,7 +2,6 @@ import React from 'react';
...
@@ -2,7 +2,6 @@ import React from 'react';
import
ReactDOM
from
'
react-dom
'
;
import
ReactDOM
from
'
react-dom
'
;
import
'
./scss/custom.scss
'
;
import
'
./scss/custom.scss
'
;
import
'
bootstrap
'
;
import
'
bootstrap
'
;
import
'
bootstrap/dist/css/bootstrap.css
'
;
import
App
from
'
./App
'
;
import
App
from
'
./App
'
;
import
reportWebVitals
from
'
./reportWebVitals
'
;
import
reportWebVitals
from
'
./reportWebVitals
'
;
...
...
client/src/pages/LoginPage.js
View file @
0c3b8467
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
Formik
}
from
'
formik
'
;
import
LoginForm
from
'
../components/LoginForm
'
;
import
*
as
yup
from
'
yup
'
;
import
SignupForm
from
'
../components/SignupForm
'
;
function
LoginPage
()
{
function
LoginPage
()
{
return
(
return
(
<>
<>
<
div
>
<
div
className
=
"
d-inline-block
"
style
=
{{
width
:
"
-webkit-fill-available
"
}}
>
<
h1
>
오늘의
KU
<
/h1
>
<
h1
className
=
"
mt-4
"
>
오늘의
KU
<
/h1
>
<
p
>-
일정관리앱
<
/p
>
<
p
className
=
"
ms-4
"
>-
일정관리앱
<
/p
>
<
/div
>
<
/div
>
<
LoginForm
/>
<
/
>
<
/
>
);
);
}
}
...
...
client/src/scss/custom.scss
View file @
0c3b8467
$crimson
:
#DC143C
;
@import
"../../node_modules/bootstrap/scss/functions"
;
@import
"../../node_modules/bootstrap/scss/functions"
;
@import
"~bootstrap/scss/variables"
;
@import
"~bootstrap/scss/variables"
;
@import
"~bootstrap/scss/mixins"
;
$custom-colors
:
(
"crimson"
:
$crimson
);
$theme-colors
:
map-merge
(
$theme-colors
,
$custom-colors
);
//
@import '~bootstrap/scss/bootstrap.scss';
@import
'~bootstrap/scss/bootstrap.scss'
;
//
@import '~bootstrap-icons/font/bootstrap-icons';
@import
'~bootstrap-icons/font/bootstrap-icons'
;
@font-face
{
@font-face
{
font-family
:
"Plex-Bold"
;
font-family
:
"Plex-Bold"
;
...
@@ -39,6 +48,12 @@
...
@@ -39,6 +48,12 @@
src
:
url("../fonts/IBMPlexSansKR-Text.ttf")
;
src
:
url("../fonts/IBMPlexSansKR-Text.ttf")
;
}
}
h1
,
h2
,
h3
,
h4
,
h5
,
h6
{
h1
,
h2
,
h3
,
h4
,
h5
,
h6
,
label
{
font-family
:
"Plex-Bold"
;
font-family
:
"Plex-Bold"
;
}
}
\ No newline at end of file
@include
media-breakpoint-up
(
sm
)
{
#box
{
width
:
400px
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment