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
travel
Commits
6efcfcbf
Commit
6efcfcbf
authored
Jul 04, 2022
by
Kim, MinGyu
Browse files
signup 수정
parent
d3214563
Changes
1
Show whitespace changes
Inline
Side-by-side
frontend/src/Pages/signup.tsx
View file @
6efcfcbf
import
React
,
{
useState
}
from
"
react
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
Link
}
from
"
react-router-dom
"
;
import
{
Link
}
from
"
react-router-dom
"
;
function
PasswordUpdate
()
{
function
PasswordUpdate
()
{
const
[
password
,
setPassword
]
=
useState
(
""
);
const
[
password
,
setPassword
]
=
useState
(
""
);
const
[
confirm
,
setConfirm
]
=
useState
(
""
);
const
[
confirm
,
setConfirm
]
=
useState
(
""
);
const
[
result
,
setResult
]
=
useState
(
""
);
const
[
email
,
setEmail
]
=
useState
(
""
);
const
[
alert
,
setAlert
]
=
useState
(
""
);
function
isEmail
()
{
var
regExp
=
/^
[
0-9a-zA-Z
]([
-_
\.]?[
0-9a-zA-Z
])
*@
[
0-9a-zA-Z
]([
-_
\.]?[
0-9a-zA-Z
])
*
\.[
a-zA-Z
]{2,3}
$/i
;
if
(
regExp
.
test
(
email
)){
setAlert
(
"
이메일 형식이 맞습니다.
"
)
}
else
{
setAlert
(
"
이메일 형식이 틀립니다.
"
)
}
return
}
const
handleSubmit
=
()
=>
{
const
reform
=
()
=>
{
if
(
password
&&
confirm
){
if
(
password
&&
confirm
){
if
(
password
==
confirm
)
{
if
(
password
==
confirm
)
{
aler
t
(
"
비밀번호가 일치합니다.
"
);
setResul
t
(
"
비밀번호가 일치합니다.
"
);
}
else
{
}
else
{
aler
t
(
"
비밀번호가 다릅니다.
"
);
setResul
t
(
"
비밀번호가 다릅니다.
"
);
}
}
}
else
{
}
else
{
aler
t
(
"
비밀번호가 입력되지 않았습니다.
"
)
setResul
t
(
"
비밀번호가 입력되지 않았습니다.
"
)
}
}
};
};
return
(
return
(
<
form
onSubmit
=
{
handleSubmit
}
>
<
div
>
<
div
className
=
"place-self-center py-3 border-b border-white "
>
<
input
<
input
className
=
"border border-black"
className
=
"
placeholder
:
text
-
slate
-
300
type
=
"password"
bg
-
white
border
border
-
slate
-
500
rounded
-
2xl
py
-
2
pl
-
9
pr
-
3
focus
:
border
-
black
"placeholder="
비밀번호
" type="
text
"
name
=
"password"
name
=
"password"
value
=
{
password
}
value
=
{
password
}
onChange
=
{
(
e
)
=>
setPassword
(
e
.
target
.
value
)
}
onChange
=
{
(
e
)
=>
setPassword
(
e
.
target
.
value
)
}
/>
/>
</
div
>
<
div
className
=
"place-self-center py-3 border-b border-white "
>
<
input
<
input
className
=
"border border-black"
className
=
"
placeholder
:
text
-
slate
-
300
type
=
"confirm"
bg
-
white
border
border
-
slate
-
500
rounded
-
2xl
py
-
2
pl
-
9
pr
-
3
focus
:
border
-
black
"placeholder="
비밀번호
확인
" type="
text
"
name
=
"confirm"
name
=
"confirm"
value
=
{
confirm
}
value
=
{
confirm
}
onChange
=
{
(
e
)
=>
setConfirm
(
e
.
target
.
value
)
}
onKeyUp
=
{
reform
}
onChange
=
{
(
e
)
=>
setConfirm
(
e
.
target
.
value
)
}
>
</
input
>
</
div
>
<
p
>
{
result
}
</
p
>
<
input
className
=
"
placeholder
:
text
-
slate
-
300
bg
-
white
border
border
-
slate
-
500
rounded
-
2xl
py
-
2
pl
-
9
pr
-
3
focus
:
border
-
black
" placeholder="
email
" type="
text
" name="
Id
"
onChange
=
{
(
e
)
=>
setEmail
(
e
.
target
.
value
)
}
onKeyUp
=
{
isEmail
}
/>
/>
<
button
type
=
"submit"
>
비밀번호 확인
</
button
>
<
p
>
{
alert
}
</
p
>
</
form
>
</
div
>
);
);
}
}
...
@@ -46,12 +82,12 @@ function PasswordUpdate() {
...
@@ -46,12 +82,12 @@ function PasswordUpdate() {
export
default
function
Signup
()
{
export
default
function
Signup
()
{
return
(
return
(
<
div
className
=
"gap-5"
>
<
div
className
=
"gap-5 flex flex-col "
>
<
div
className
=
"flex flex-col gap-2"
>
<
div
className
=
"p-12 w-1/2 h-1/2 md:w-40 md:h-1/6 bg-red-400 place-self-center rounded-2xl"
>
<
div
className
=
"p-12 w-1/2 h-1/2 md:w-40 md:h-1/6 bg-red-400 place-self-center rounded-2xl"
>
<
Link
to
=
"/"
>
Travel Report
</
Link
>
<
Link
to
=
"/"
>
Travel Report
</
Link
>
</
div
>
</
div
>
<
div
className
=
"flex flex-col w-auto h-80 md:w-1/2 bg-white border-2 border-black grid place-items-center rounded-xl place-self-center"
>
<
div
className
=
"place-self-center py-3 border-b border-white "
>
<
div
className
=
"place-self-center py-3 border-b border-white "
>
<
input
className
=
"
placeholder
:
text
-
slate
-
300
<
input
className
=
"
placeholder
:
text
-
slate
-
300
...
@@ -60,30 +96,10 @@ export default function Signup () {
...
@@ -60,30 +96,10 @@ export default function Signup () {
focus
:
border
-
black
" placeholder="
ID
" type="
text
"
/>
focus
:
border
-
black
" placeholder="
ID
" type="
text
"
/>
</
div
>
</
div
>
<
div
className
=
"place-self-center py-3 border-b border-white "
>
<
input
className
=
"
placeholder
:
text
-
slate
-
300
bg
-
white
border
border
-
slate
-
500
rounded
-
2xl
py
-
2
pl
-
9
pr
-
3
focus
:
border
-
black
" name="
firstPassword
"placeholder="
비밀번호
" type="
text
"
/>
</
div
>
<
div
className
=
"place-self-center py-3 border-b border-white "
>
<
input
className
=
"
placeholder
:
text
-
slate
-
300
bg
-
white
border
border
-
slate
-
500
rounded
-
2xl
py
-
2
pl
-
9
pr
-
3
focus
:
border
-
black
"placeholder="
비밀번호
확인
" type="
text
"
/>
</
div
>
<
div
className
=
"showText place-self-center"
>
<
div
className
=
"showText place-self-center"
>
<
PasswordUpdate
/>
<
PasswordUpdate
/>
</
div
>
</
div
>
<
div
className
=
"
place
-
self
-
center
py
-
3
border
-
b
border
-
white
"
>
<
input
className
=
"
placeholder
:
text
-
slate
-
300
bg
-
white
border
border
-
slate
-
500
rounded
-
2xl
py
-
2
pl
-
9
pr
-
3
focus
:
border
-
black
" placeholder="
Id
" type="
text
" name="
Id
"
/>
</
div
>
<
button
className
=
"
place
-
self
-
center
py
-
3
border
-
b
border
-
white
<
button
className
=
"
place
-
self
-
center
py
-
3
border
-
b
border
-
white
"
>
"
>
회원가입 버튼
회원가입 버튼
...
...
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