sdy

add link in social login

1 import React from "react"; 1 import React from "react";
2 import styled from "styled-components"; 2 import styled from "styled-components";
3 +import { Link } from "react-router-dom";
3 import { Helmet } from "react-helmet"; 4 import { Helmet } from "react-helmet";
5 +import Header from "../../Components/Header";
4 import Input from "../../Components/Input"; 6 import Input from "../../Components/Input";
5 import Button from "../../Components/Button"; 7 import Button from "../../Components/Button";
6 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; 8 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
...@@ -13,6 +15,7 @@ import { ...@@ -13,6 +15,7 @@ import {
13 15
14 const Wrapper = styled.div` 16 const Wrapper = styled.div`
15 width: 100%; 17 width: 100%;
18 + height: 100vh;
16 display: flex; 19 display: flex;
17 flex-direction: column; 20 flex-direction: column;
18 justify-content: center; 21 justify-content: center;
...@@ -36,7 +39,7 @@ const StateChanger = styled(Box)` ...@@ -36,7 +39,7 @@ const StateChanger = styled(Box)`
36 margin-bottom: 15px; 39 margin-bottom: 15px;
37 `; 40 `;
38 41
39 -const Link = styled.span` 42 +const ToggleSpan = styled.span`
40 cursor: pointer; 43 cursor: pointer;
41 color: #0652dd; 44 color: #0652dd;
42 `; 45 `;
...@@ -63,7 +66,7 @@ const Form = styled(Box)` ...@@ -63,7 +66,7 @@ const Form = styled(Box)`
63 66
64 const SocialLogin = styled(Box)` 67 const SocialLogin = styled(Box)`
65 display: flex; 68 display: flex;
66 - svg { 69 + a {
67 &:not(:last-child) { 70 &:not(:last-child) {
68 margin-right: 20px; 71 margin-right: 20px;
69 } 72 }
...@@ -82,60 +85,74 @@ export default ({ ...@@ -82,60 +85,74 @@ export default ({
82 phoneNum, 85 phoneNum,
83 onSubmit, 86 onSubmit,
84 }) => ( 87 }) => (
85 - <Wrapper> 88 + <>
86 - <TitleContainer> 89 + <Header />
87 - <Title>KhuChat</Title> 90 + <Wrapper>
88 - </TitleContainer> 91 + <TitleContainer>
89 - <Form> 92 + <Title>Linker</Title>
90 - {action === "logIn" ? ( 93 + </TitleContainer>
91 - <> 94 + <Form>
92 - <Helmet> 95 + {action === "logIn" ? (
93 - <title>Log In</title> 96 + <>
94 - </Helmet> 97 + <Helmet>
95 - <form onSubmit={onSubmit}> 98 + <title>Log In</title>
96 - <Input placeholder={"Email"} type="email" {...email} /> 99 + </Helmet>
97 - <Input placeholder={"Password"} type="password" {...password} /> 100 + <form onSubmit={onSubmit}>
98 - <Button text={"Log In"} /> 101 + <Input placeholder={"Email"} type="email" {...email} />
99 - </form> 102 + <Input placeholder={"Password"} type="password" {...password} />
100 - </> 103 + <Button text={"Log In"} />
101 - ) : ( 104 + </form>
102 - <> 105 + </>
103 - <Helmet> 106 + ) : (
104 - <title>Sign Up</title> 107 + <>
105 - </Helmet> 108 + <Helmet>
106 - <form onSubmit={onSubmit}> 109 + <title>Sign Up</title>
107 - <Input placeholder={"Email"} type="email" {...email} /> 110 + </Helmet>
108 - <Input placeholder={"UserName"} {...username} /> 111 + <form onSubmit={onSubmit}>
109 - <Input placeholder={"PhoneNumber"} {...phoneNum} /> 112 + <Input placeholder={"Email"} type="email" {...email} />
110 - <Input placeholder={"Password"} type="password" {...password} /> 113 + <Input placeholder={"UserName"} {...username} />
111 - <Input 114 + <Input placeholder={"PhoneNumber"} {...phoneNum} />
112 - placeholder={"Password for validation"} 115 + <Input placeholder={"Password"} type="password" {...password} />
113 - type="password" 116 + <Input
114 - {...password2} 117 + placeholder={"Password for validation"}
115 - /> 118 + type="password"
116 - <Button text={"Sign Up"} /> 119 + {...password2}
117 - </form> 120 + />
118 - </> 121 + <Button text={"Sign Up"} />
119 - )} 122 + </form>
120 - </Form> 123 + </>
121 - <StateChanger> 124 + )}
122 - {action === "logIn" ? ( 125 + </Form>
123 - <> 126 + <StateChanger>
124 - Don't you have an account ? 127 + {action === "logIn" ? (
125 - <Link onClick={() => setAction("signUp")}> Sign Up </Link> 128 + <>
126 - </> 129 + Don't you have an account ?
127 - ) : ( 130 + <ToggleSpan onClick={() => setAction("signUp")}>
128 - <> 131 + {" "}
129 - Did you have an account ? 132 + Sign Up{" "}
130 - <Link onClick={() => setAction("logIn")}> Log in </Link> 133 + </ToggleSpan>
131 - </> 134 + </>
132 - )} 135 + ) : (
133 - </StateChanger> 136 + <>
134 - <SocialLogin> 137 + Did you have an account ?
135 - <FontAwesomeIcon icon={faFacebook} /> 138 + <ToggleSpan onClick={() => setAction("logIn")}> Log in </ToggleSpan>
136 - <FontAwesomeIcon icon={faGoogle} /> 139 + </>
137 - <FontAwesomeIcon icon={faTwitter} /> 140 + )}
138 - <FontAwesomeIcon icon={faGithub} /> 141 + </StateChanger>
139 - </SocialLogin> 142 + <SocialLogin>
140 - </Wrapper> 143 + <Link to="/facebook">
144 + <FontAwesomeIcon icon={faFacebook} />
145 + </Link>
146 + <Link to="/google">
147 + <FontAwesomeIcon icon={faGoogle} />
148 + </Link>
149 + <Link to="/twitter">
150 + <FontAwesomeIcon icon={faTwitter} />
151 + </Link>
152 + <Link to="/github">
153 + <FontAwesomeIcon icon={faGithub} />
154 + </Link>
155 + </SocialLogin>
156 + </Wrapper>
157 + </>
141 ); 158 );
......