feat: init login page

This commit is contained in:
swve 2022-09-21 23:09:47 +02:00
parent fcd281d1d6
commit 920339b5fd
11 changed files with 107 additions and 25 deletions

View 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;
}
`;

View file

@ -1,6 +1,7 @@
import React from "react";
import styled from "styled-components";
import { HeaderProfileBox } from "../auth/HeaderProfileBox";
import { HeaderProfileBox } from "../../auth/HeaderProfileBox";
import Link from "next/link";
export const Menu = () => {
return (

View 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>
);
};

View file

@ -16,7 +16,7 @@ const Layout = (props: any) => {
<Footer>
<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>
</Footer>
</div>
@ -34,7 +34,8 @@ const Footer = styled.footer`
font-size: 16px;
img{
width: 100px;
width: 40px;
opacity: 0.40;
display: inline;
}
`;

View file

@ -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;
`;

View file

@ -1,8 +0,0 @@
import React from 'react'
import { Menu } from './menu'
export const Header = () => {
return (
<div><Menu></Menu></div>
)
}

View file

@ -1,6 +1,6 @@
import type { NextPage } from "next";
import { Title } from "./components/ui/styles/title";
import Layout from "./components/ui/layout";
import { Title } from "../components/ui/styles/title";
import Layout from "../components/ui/layout";
const Home: NextPage = () => {
return (

39
front/pages/login.tsx Normal file
View 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
View 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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB