Auth.js
1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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>
);
};