AuthPresenter.js
4.08 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
import React from "react";
import styled from "styled-components";
import { Link } from "react-router-dom";
import { Helmet } from "react-helmet";
import Input from "../../Components/Input";
import Button from "../../Components/Button";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import {
faFacebook,
faTwitter,
faGithub,
faGoogle,
} from "@fortawesome/free-brands-svg-icons";
import loginBackground from "../../Imgs/login-background4.jpg";
const Wrapper = styled.div`
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-image: url(${loginBackground});
background-size: cover;
`;
const SubWrapper = styled.div`
background-color: rgba(57, 65, 74, 0.5);
border-radius: 7px;
padding: 5%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: white;
`;
const Box = styled.div`
display: flex;
`;
const TitleContainer = styled(Box)`
margin-bottom: 20px;
`;
const Title = styled.span`
font-size: 30px;
font-family: "Raleway", sans-serif;
`;
const StateChanger = styled(Box)`
margin-bottom: 15px;
`;
const ToggleSpan = styled.span`
margin-left: 5px;
cursor: pointer;
color: #079992;
`;
const Form = styled(Box)`
form {
display: flex;
flex-direction: column;
padding: 5px 5px;
margin-bottom: 15px;
input {
font-size: 15px;
margin-bottom: 10px;
}
button {
background-color: #1b9cfc;
color: white;
border-radius: 10px;
padding: 10px 5px;
font-size: 15px;
}
}
`;
const SocialLogin = styled(Box)`
display: flex;
a {
&:not(:last-child) {
margin-right: 20px;
}
}
font-size: 30px;
opacity: 0.8;
`;
const StyledLink = styled(Link)`
color: white;
`;
export default ({
action,
setAction,
email,
password,
password2,
username,
phoneNum,
onSubmit,
}) => (
<>
<Wrapper>
<SubWrapper>
<TitleContainer>
<StyledLink to="/">
<Title>Linker</Title>
</StyledLink>
</TitleContainer>
<Form>
{action === "logIn" ? (
<>
<Helmet>
<title>Log In</title>
</Helmet>
<form onSubmit={onSubmit}>
<Input placeholder={"Email"} type="email" {...email} />
<Input placeholder={"Password"} type="password" {...password} />
<Button text={"Log In"} />
</form>
</>
) : (
<>
<Helmet>
<title>Sign Up</title>
</Helmet>
<form onSubmit={onSubmit}>
<Input placeholder={"Email"} type="email" {...email} />
<Input placeholder={"UserName"} {...username} />
<Input placeholder={"Password"} type="password" {...password} />
<Input placeholder={"PhoneNumber"} {...phoneNum} />
<Button text={"Sign Up"} />
</form>
</>
)}
</Form>
<StateChanger>
{action === "logIn" ? (
<>
Don't you have an account ?
<ToggleSpan onClick={() => setAction("signUp")}>
{" "}
Sign Up{" "}
</ToggleSpan>
</>
) : (
<>
Did you have an account ?
<ToggleSpan onClick={() => setAction("logIn")}>
{" "}
Log in{" "}
</ToggleSpan>
</>
)}
</StateChanger>
<SocialLogin>
<StyledLink to="/facebook">
<FontAwesomeIcon icon={faFacebook} />
</StyledLink>
<StyledLink to="/google">
<FontAwesomeIcon icon={faGoogle} />
</StyledLink>
<StyledLink to="/twitter">
<FontAwesomeIcon icon={faTwitter} />
</StyledLink>
<StyledLink to="/github">
<FontAwesomeIcon icon={faGithub} />
</StyledLink>
</SocialLogin>
</SubWrapper>
</Wrapper>
</>
);