mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-18 20:09:25 +00:00
feat: init login page
This commit is contained in:
parent
fcd281d1d6
commit
920339b5fd
11 changed files with 107 additions and 25 deletions
37
front/components/auth/HeaderProfileBox.tsx
Normal file
37
front/components/auth/HeaderProfileBox.tsx
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
import React from "react";
|
||||||
|
import styled from "styled-components";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
|
export const HeaderProfileBox = () => {
|
||||||
|
return (
|
||||||
|
<ProfileArea>
|
||||||
|
{" "}
|
||||||
|
<span>HeaderProfileBox</span>{" "}
|
||||||
|
<Link href="/login">
|
||||||
|
<a>Login</a>
|
||||||
|
</Link>{" "}
|
||||||
|
<Link href="/signup">
|
||||||
|
<a>Sign up</a>
|
||||||
|
</Link>
|
||||||
|
</ProfileArea>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const ProfileArea = styled.div`
|
||||||
|
display: flex;
|
||||||
|
place-items: stretch;
|
||||||
|
place-items: center;
|
||||||
|
|
||||||
|
span {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
top: 32px;
|
||||||
|
right: -20px;
|
||||||
|
padding-right: 20px;
|
||||||
|
font-size: 12px;
|
||||||
|
margin: 3px;
|
||||||
|
background-color: gray;
|
||||||
|
color: white;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
import { HeaderProfileBox } from "../auth/HeaderProfileBox";
|
import { HeaderProfileBox } from "../../auth/HeaderProfileBox";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
export const Menu = () => {
|
export const Menu = () => {
|
||||||
return (
|
return (
|
||||||
12
front/components/ui/header.tsx
Normal file
12
front/components/ui/header.tsx
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import React from "react";
|
||||||
|
import { Menu } from "./elements/menu";
|
||||||
|
import Link from 'next/link'
|
||||||
|
|
||||||
|
|
||||||
|
export const Header = () => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Menu></Menu>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
@ -16,7 +16,7 @@ const Layout = (props: any) => {
|
||||||
|
|
||||||
<Footer>
|
<Footer>
|
||||||
<a href="" target="_blank" rel="noopener noreferrer">
|
<a href="" target="_blank" rel="noopener noreferrer">
|
||||||
Powered by <img src="/learnhouse_logo.png" alt="Learnhouse Logo" />
|
<img src="/learnhouse_icon.png" alt="Learnhouse Logo" />
|
||||||
</a>
|
</a>
|
||||||
</Footer>
|
</Footer>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -34,7 +34,8 @@ const Footer = styled.footer`
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|
||||||
img{
|
img{
|
||||||
width: 100px;
|
width: 40px;
|
||||||
|
opacity: 0.40;
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
import React from "react";
|
|
||||||
import styled from "styled-components";
|
|
||||||
|
|
||||||
export const HeaderProfileBox = () => {
|
|
||||||
return <ProfileArea>HeaderProfileBox</ProfileArea>;
|
|
||||||
};
|
|
||||||
|
|
||||||
const ProfileArea = styled.div`
|
|
||||||
display: flex;
|
|
||||||
place-items: stretch;
|
|
||||||
place-items: center;
|
|
||||||
`;
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
import React from 'react'
|
|
||||||
import { Menu } from './menu'
|
|
||||||
|
|
||||||
export const Header = () => {
|
|
||||||
return (
|
|
||||||
<div><Menu></Menu></div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { NextPage } from "next";
|
import type { NextPage } from "next";
|
||||||
import { Title } from "./components/ui/styles/title";
|
import { Title } from "../components/ui/styles/title";
|
||||||
import Layout from "./components/ui/layout";
|
import Layout from "../components/ui/layout";
|
||||||
|
|
||||||
const Home: NextPage = () => {
|
const Home: NextPage = () => {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
39
front/pages/login.tsx
Normal file
39
front/pages/login.tsx
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
import React from "react";
|
||||||
|
import Layout from "../components/ui/layout";
|
||||||
|
import { Title } from "../components/ui/styles/title";
|
||||||
|
|
||||||
|
const Login = () => {
|
||||||
|
const [email, setEmail] = React.useState("");
|
||||||
|
const [password, setPassword] = React.useState("");
|
||||||
|
|
||||||
|
const handleSubmit = (e: any) => {
|
||||||
|
e.preventDefault();
|
||||||
|
console.log(email, password);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleEmailChange = (e: any) => {
|
||||||
|
setEmail(e.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePasswordChange = (e: any) => {
|
||||||
|
setPassword(e.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Layout>
|
||||||
|
<Title>Login</Title>
|
||||||
|
|
||||||
|
<form>
|
||||||
|
<input onChange={handleEmailChange} type="text" placeholder="email" />
|
||||||
|
<input onChange={handlePasswordChange} type="password" placeholder="password" />
|
||||||
|
<button onClick={handleSubmit} type="submit">
|
||||||
|
Login
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</Layout>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Login;
|
||||||
12
front/pages/signup.tsx
Normal file
12
front/pages/signup.tsx
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import React from "react";
|
||||||
|
import Layout from "../components/ui/layout";
|
||||||
|
import { Title } from "../components/ui/styles/title";
|
||||||
|
|
||||||
|
const SignUp = () => {
|
||||||
|
return <div>
|
||||||
|
<Layout>
|
||||||
|
<Title>Sign up </Title>
|
||||||
|
</Layout>
|
||||||
|
</div>;
|
||||||
|
};
|
||||||
|
export default SignUp;
|
||||||
BIN
front/public/learnhouse_icon.png
Normal file
BIN
front/public/learnhouse_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 152 KiB |
Loading…
Add table
Add a link
Reference in a new issue