login pages are done
This commit is contained in:
14
src/components/home/Header.jsx
Normal file
14
src/components/home/Header.jsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
import { URLs } from "../../__data__/urls";
|
||||
import { FaHome } from 'react-icons/fa';
|
||||
|
||||
const Header = () => {
|
||||
return (
|
||||
<a href={URLs.account.url} className="accountLink">
|
||||
<FaHome className="houseIcon"/>
|
||||
<p>My profile</p>
|
||||
</a>
|
||||
);
|
||||
};
|
||||
|
||||
export default Header;
|
||||
38
src/components/home/css/accountLink.css
Normal file
38
src/components/home/css/accountLink.css
Normal file
@@ -0,0 +1,38 @@
|
||||
.houseIcon {
|
||||
transition: color 0.3s ease-in;
|
||||
}
|
||||
|
||||
.accountLink {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.accountLink p {
|
||||
font-size: 1.5vw;
|
||||
transition: color 0.3s ease-out;
|
||||
}
|
||||
|
||||
.accountLink svg {
|
||||
font-size: 3vw;
|
||||
transition: fill 0.3s ease-in;
|
||||
}
|
||||
|
||||
.accountLink:hover p {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.accountLink:hover svg {
|
||||
fill: orange;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 800px) {
|
||||
.accountLink p {
|
||||
font-size: 1.8vh;
|
||||
}
|
||||
|
||||
.accountLink svg {
|
||||
font-size: 4vh;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +1,3 @@
|
||||
@import url("./css/card.css");
|
||||
@import url("./css/homeTitle.css");
|
||||
@import url("./css/homeTitle.css");
|
||||
@import url("./css/accountLink.css");
|
||||
@@ -2,10 +2,14 @@ import React from 'react';
|
||||
|
||||
const InputField = (props) => {
|
||||
return (
|
||||
<input
|
||||
onChange={(e) => props.setValue(e.target.value)}
|
||||
value={props.value}
|
||||
/>
|
||||
<div>
|
||||
<p>{props.title}</p>
|
||||
<input
|
||||
onChange={(e) => props.setValue(e.target.value)}
|
||||
value={props.value}
|
||||
className="Input"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
28
src/components/reg/LoginButtons.jsx
Normal file
28
src/components/reg/LoginButtons.jsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import React from 'react';
|
||||
import { URLs } from "../../__data__/urls";
|
||||
|
||||
const LoginButtons = (props) => {
|
||||
const ref = props.isAuth ? URLs.reg.url : URLs.auth.url
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="LoginButtons">
|
||||
<a className="MyButton loginButton" onClick={() => (
|
||||
props.submitHandler()
|
||||
)}>
|
||||
{props.isAuth
|
||||
? <p className="mclaren-regular">Login</p>
|
||||
: <p className="mclaren-regular">Register</p>}
|
||||
</a>
|
||||
|
||||
<a className="MyButton loginButton" href={ref}>
|
||||
{props.isAuth
|
||||
? <p className="mclaren-regular">Registration</p>
|
||||
: <p className="mclaren-regular">I have an account</p>}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default LoginButtons;
|
||||
58
src/components/reg/css/login.css
Normal file
58
src/components/reg/css/login.css
Normal file
@@ -0,0 +1,58 @@
|
||||
.LoginButtons {
|
||||
margin-top: 5rex;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.LoginButtons a {
|
||||
margin-bottom: 15px;
|
||||
width: 12rem;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.Input {
|
||||
border: 0;
|
||||
background-color: black;
|
||||
color: orange;
|
||||
border-radius: 5px;
|
||||
|
||||
padding: 10px;
|
||||
|
||||
width: 18rem;
|
||||
}
|
||||
|
||||
.MyButton.loginButton {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.MyButton.loginButton p {
|
||||
color: orange;
|
||||
transition: color 0.3s ease-in;
|
||||
|
||||
font-size: 1.3vw;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.loginTitle {
|
||||
font-size: 4vw;
|
||||
|
||||
transition: color 0.3s ease-in;
|
||||
}
|
||||
|
||||
.loginTitle:hover {
|
||||
color: orange;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 800px) {
|
||||
.MyButton.loginButton p {
|
||||
font-size: 1.5vh;
|
||||
}
|
||||
}
|
||||
|
||||
.loginButton:hover p {
|
||||
color: black;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
@import url("./css/input.css");
|
||||
@import url("./css/login.css");
|
||||
12
src/components/reg/loginTitle.jsx
Normal file
12
src/components/reg/loginTitle.jsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import React from 'react';
|
||||
import { URLs } from "../../__data__/urls";
|
||||
|
||||
const LoginTitle = () => {
|
||||
return (
|
||||
<a href={URLs.baseUrl}>
|
||||
<h1 className="loginTitle mclaren-regular">Enterfront</h1>
|
||||
</a>
|
||||
);
|
||||
};
|
||||
|
||||
export default LoginTitle;
|
||||
@@ -4,7 +4,6 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=MonteCarlo&display=swap');
|
||||
|
||||
@import url("pages/index.css");
|
||||
@import url("outer/index.css");
|
||||
@import url("components/index.css");
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import React from 'react';
|
||||
|
||||
const Header = () => {
|
||||
return (
|
||||
<div>Header</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Header;
|
||||
@@ -1 +0,0 @@
|
||||
@import url("./css/header.css");
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from "react";
|
||||
import HomeTitle from "../components/home/HomeTitle.jsx";
|
||||
import ChatsList from "../components/home/ChatsList.jsx";
|
||||
import Header from "../components/home/Header.jsx";
|
||||
|
||||
const Home = () => {
|
||||
|
||||
@@ -61,9 +62,13 @@ const Home = () => {
|
||||
|
||||
return (
|
||||
<div className="homeWrapper">
|
||||
<HomeTitle/>
|
||||
<p>Your chats</p>
|
||||
<ChatsList chats={chats} />
|
||||
<div className="headerPos">
|
||||
<Header/>
|
||||
</div>
|
||||
|
||||
<HomeTitle/>
|
||||
<p>Your chats</p>
|
||||
<ChatsList chats={chats} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,11 +1,26 @@
|
||||
import React from 'react';
|
||||
import React, {useState} from 'react';
|
||||
import InputField from "../components/reg/InputField.jsx";
|
||||
import LoginButtons from "../components/reg/LoginButtons.jsx";
|
||||
import LoginTitle from "../components/reg/loginTitle.jsx";
|
||||
|
||||
const SignIn = () => {
|
||||
const [name, setName] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
|
||||
const submit = (e) => {
|
||||
console.log('Sign In!')
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1>SignIn</h1>
|
||||
<InputField/>
|
||||
<div className="LoginList">
|
||||
<LoginTitle/>
|
||||
<InputField title="Name" setValue={setName} value={name}/>
|
||||
<InputField title="Password" setValue={setPassword} value={password}/>
|
||||
|
||||
<LoginButtons
|
||||
submitHandler={submit}
|
||||
isAuth={true}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,13 +1,30 @@
|
||||
import React from 'react';
|
||||
import React, {useState} from 'react';
|
||||
import InputField from "../components/reg/InputField.jsx";
|
||||
import LoginButtons from "../components/reg/LoginButtons.jsx";
|
||||
import LoginTitle from "../components/reg/loginTitle.jsx";
|
||||
|
||||
const SignUp = () => {
|
||||
return (
|
||||
<div>
|
||||
<h1>SignUp</h1>
|
||||
<InputField/>
|
||||
</div>
|
||||
);
|
||||
const [name, setName] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
const [repeatPassword, setRepeatPassword] = useState("");
|
||||
|
||||
const submit = (e) => {
|
||||
console.log('Sign Up!')
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="LoginList">
|
||||
<LoginTitle/>
|
||||
<InputField title="Name" setValue={setName} value={name}/>
|
||||
<InputField title="Password" setValue={setPassword} value={password}/>
|
||||
<InputField title="Repeat Password" setValue={setRepeatPassword} value={repeatPassword}/>
|
||||
|
||||
<LoginButtons
|
||||
submitHandler={submit}
|
||||
isAuth={false}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SignUp;
|
||||
|
||||
@@ -23,3 +23,9 @@
|
||||
|
||||
margin: 3rem;
|
||||
}
|
||||
|
||||
.headerPos {
|
||||
position: absolute;
|
||||
top: 3vw;
|
||||
right: 3vw;
|
||||
}
|
||||
|
||||
8
src/pages/css/input.css
Normal file
8
src/pages/css/input.css
Normal file
@@ -0,0 +1,8 @@
|
||||
.LoginList {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
|
||||
margin-top: 2rem;
|
||||
}
|
||||
@@ -1,2 +1,3 @@
|
||||
@import url("css/init.css");
|
||||
@import url("css/home.css");
|
||||
@import url("css/home.css");
|
||||
@import url("css/input.css");
|
||||
Reference in New Issue
Block a user