-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7802770
commit 3609cf3
Showing
4 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { FC, PropsWithChildren } from "react"; | ||
import Head from "next/head"; | ||
import { AppBar, Box, Container, Toolbar, Typography } from "@mui/material"; | ||
import Link from "../Link"; | ||
|
||
interface Props extends PropsWithChildren { | ||
title: string; | ||
} | ||
|
||
export const AuthLayout: FC<Props> = ({ children, title }) => { | ||
return ( | ||
<> | ||
<Head> | ||
<title>{title}</title> | ||
</Head> | ||
|
||
<AppBar> | ||
<Toolbar component="nav"> | ||
<Link href="/" display="flex" alignItems="center"> | ||
<Typography variant="h6">Teslo | </Typography> | ||
<Typography sx={{ ml: 0.5 }}>Shop</Typography> | ||
</Link> | ||
</Toolbar> | ||
</AppBar> | ||
|
||
<Container component="main"> | ||
<Box | ||
display="flex" | ||
justifyContent="center" | ||
alignItems="center" | ||
height="calc(100vh - 160px)" | ||
> | ||
{children} | ||
</Box> | ||
</Container> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from "./AuthLayout"; | ||
export * from "./ShopLayout"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { NextPage } from "next"; | ||
import { Box, Button, TextField, Typography } from "@mui/material"; | ||
import Link from "@/components/Link"; | ||
import { AuthLayout } from "@/components/layouts"; | ||
|
||
const LoginPage: NextPage = () => { | ||
return ( | ||
<AuthLayout title="Login"> | ||
<Box sx={{ width: 350, px: 2, py: 1 }}> | ||
<Box display="flex" flexDirection="column" gap={2}> | ||
<Typography variant="h1">Login</Typography> | ||
|
||
<TextField label="Email" type="email" fullWidth /> | ||
|
||
<TextField label="Password" type="password" fullWidth /> | ||
|
||
<Button | ||
color="secondary" | ||
className="circular-btn" | ||
size="large" | ||
fullWidth | ||
> | ||
Login | ||
</Button> | ||
|
||
<Box display="flex" justifyContent="end"> | ||
<Link href="/auth/register" underline="always"> | ||
Create account | ||
</Link> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</AuthLayout> | ||
); | ||
}; | ||
|
||
export default LoginPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { NextPage } from "next"; | ||
import { Box, Button, TextField, Typography } from "@mui/material"; | ||
import Link from "@/components/Link"; | ||
import { AuthLayout } from "@/components/layouts"; | ||
|
||
const RegisterPage: NextPage = () => { | ||
return ( | ||
<AuthLayout title="Login"> | ||
<Box sx={{ width: 350, px: 2, py: 1 }}> | ||
<Box display="flex" flexDirection="column" gap={2}> | ||
<Typography variant="h1">Create account</Typography> | ||
|
||
<TextField label="Name" fullWidth /> | ||
|
||
<TextField label="Email" type="email" fullWidth /> | ||
|
||
<TextField label="Password" type="password" fullWidth /> | ||
|
||
<Button | ||
color="secondary" | ||
className="circular-btn" | ||
size="large" | ||
fullWidth | ||
> | ||
Create account | ||
</Button> | ||
|
||
<Box display="flex" justifyContent="end"> | ||
<Link href="/auth/login" underline="always"> | ||
Login | ||
</Link> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</AuthLayout> | ||
); | ||
}; | ||
|
||
export default RegisterPage; |