mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-18 20:09:25 +00:00
feat: init sign up page
This commit is contained in:
parent
920339b5fd
commit
67ce2e7371
5 changed files with 84 additions and 17 deletions
|
|
@ -7,12 +7,20 @@ export const HeaderProfileBox = () => {
|
||||||
<ProfileArea>
|
<ProfileArea>
|
||||||
{" "}
|
{" "}
|
||||||
<span>HeaderProfileBox</span>{" "}
|
<span>HeaderProfileBox</span>{" "}
|
||||||
<Link href="/login">
|
<UnidentifiedArea>
|
||||||
<a>Login</a>
|
<ul>
|
||||||
</Link>{" "}
|
<li>
|
||||||
<Link href="/signup">
|
<Link href="/login">
|
||||||
<a>Sign up</a>
|
<a>Login</a>
|
||||||
</Link>
|
</Link>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<Link href="/signup">
|
||||||
|
<a>Sign up</a>
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</UnidentifiedArea>
|
||||||
</ProfileArea>
|
</ProfileArea>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
@ -27,11 +35,32 @@ const ProfileArea = styled.div`
|
||||||
display: block;
|
display: block;
|
||||||
top: 32px;
|
top: 32px;
|
||||||
right: -20px;
|
right: -20px;
|
||||||
padding-right: 20px;
|
padding: 6px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin: 3px;
|
margin: 3px;
|
||||||
background-color: gray;
|
background-color: #19191939;
|
||||||
|
border-radius: 5px;
|
||||||
color: white;
|
color: white;
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const UnidentifiedArea = styled.div`
|
||||||
|
display: flex;
|
||||||
|
place-items: stretch;
|
||||||
|
flex-grow: 1;
|
||||||
|
|
||||||
|
ul {
|
||||||
|
display: flex;
|
||||||
|
place-items: center;
|
||||||
|
list-style: none;
|
||||||
|
padding-left: 20px;
|
||||||
|
|
||||||
|
li {
|
||||||
|
padding-right: 20px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #171717;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,11 @@ export const Menu = () => {
|
||||||
<GlobalHeader>
|
<GlobalHeader>
|
||||||
<LogoArea>
|
<LogoArea>
|
||||||
<Logo>
|
<Logo>
|
||||||
<img src="./learnhouse_logo.png" alt="" />
|
<Link href={"/"}>
|
||||||
|
<a>
|
||||||
|
<img src="./learnhouse_logo.png" alt="" />
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
</Logo>
|
</Logo>
|
||||||
<div id="accounts"></div>
|
<div id="accounts"></div>
|
||||||
</LogoArea>
|
</LogoArea>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import Layout from "../components/ui/layout";
|
||||||
const Home: NextPage = () => {
|
const Home: NextPage = () => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Layout>
|
<Layout title="Index">
|
||||||
<Title>Home</Title>
|
<Title>Home</Title>
|
||||||
</Layout>
|
</Layout>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@ const Login = () => {
|
||||||
|
|
||||||
const handleSubmit = (e: any) => {
|
const handleSubmit = (e: any) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
console.log(email, password);
|
console.log({ email, password });
|
||||||
|
alert(JSON.stringify({ email, password }));
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleEmailChange = (e: any) => {
|
const handleEmailChange = (e: any) => {
|
||||||
|
|
@ -21,7 +22,7 @@ const Login = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Layout>
|
<Layout title="Login">
|
||||||
<Title>Login</Title>
|
<Title>Login</Title>
|
||||||
|
|
||||||
<form>
|
<form>
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,43 @@ import Layout from "../components/ui/layout";
|
||||||
import { Title } from "../components/ui/styles/title";
|
import { Title } from "../components/ui/styles/title";
|
||||||
|
|
||||||
const SignUp = () => {
|
const SignUp = () => {
|
||||||
return <div>
|
const [email, setEmail] = React.useState("");
|
||||||
<Layout>
|
const [password, setPassword] = React.useState("");
|
||||||
<Title>Sign up </Title>
|
const [username, setUsername] = React.useState("");
|
||||||
</Layout>
|
|
||||||
</div>;
|
const handleSubmit = (e: any) => {
|
||||||
|
e.preventDefault();
|
||||||
|
console.log({ email, password, username });
|
||||||
|
alert(JSON.stringify({ email, password, username }));
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleEmailChange = (e: any) => {
|
||||||
|
setEmail(e.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePasswordChange = (e: any) => {
|
||||||
|
setPassword(e.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleUsernameChange = (e: any) => {
|
||||||
|
setUsername(e.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Layout title="Sign up">
|
||||||
|
<Title>Sign up </Title>
|
||||||
|
|
||||||
|
<form>
|
||||||
|
<input onChange={handleUsernameChange} type="text" placeholder="username" />
|
||||||
|
<input onChange={handleEmailChange} type="text" placeholder="email" />
|
||||||
|
<input onChange={handlePasswordChange} type="password" placeholder="password" />
|
||||||
|
<button onClick={handleSubmit} type="submit">
|
||||||
|
Sign up
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</Layout>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
export default SignUp;
|
export default SignUp;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue