Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-05-08 12:07:11 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4748f0bc1dc1d6b53eac8e9e767f0e1e5257642e
4748f0bc
1 parent
81b380bd
Create Auth.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
front/src/Routes/Auth.js
front/src/Routes/Auth.js
0 → 100644
View file @
4748f0b
import
React
,
{
useState
}
from
"react"
;
import
styled
from
"styled-components"
;
import
Input
from
"../Components/Input"
;
import
Button
from
"../Components/Button"
;
const
Wrapper
=
styled
.
div
``
;
const
Box
=
styled
.
div
``
;
const
StateChanger
=
styled
(
Box
)
``
;
const
Link
=
styled
.
span
``
;
const
Form
=
styled
(
Box
)
``
;
export
default
()
=>
{
const
[
action
,
setAction
]
=
useState
(
"logIn"
);
return
(
<
Wrapper
>
<
Form
>
{
action
===
"logIn"
?
(
<
form
>
<
Input
placeholder
=
{
"Email"
}
type
=
"email"
/>
<
Input
placeholder
=
{
"Password"
}
type
=
"password"
/>
<
Button
text
=
{
"Log In"
}
/
>
<
/form
>
)
:
(
<
form
>
<
Input
placeholder
=
{
"Email"
}
type
=
"email"
/>
<
Input
placeholder
=
{
"Password"
}
type
=
"password"
/>
<
Input
placeholder
=
{
"Password for validation"
}
type
=
"password"
/>
<
Input
placeholder
=
{
"UserName"
}
/
>
<
Button
text
=
{
"Sign Up"
}
/
>
<
/form
>
)}
<
/Form
>
<
StateChanger
>
{
action
===
"logIn"
?
(
<>
Don
'
t
you
have
an
account
?
<
Link
onClick
=
{()
=>
setAction
(
"signUp"
)}
>
<
/Link
>
<
/
>
)
:
(
<>
Did
you
have
an
account
?
<
Link
onClick
=
{()
=>
setAction
(
"logIn"
)}
>
<
/Link
>
<
/
>
)}
<
/StateChanger
>
<
/Wrapper
>
);
};
Please
register
or
login
to post a comment