Add login page
This commit is contained in:
parent
a67f3c402b
commit
1ef8f64ed0
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="PrettierConfiguration">
|
|
||||||
<option name="myRunOnSave" value="true" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,18 +1,10 @@
|
|||||||
import React, { FC } from "react";
|
import React, {FC} from "react";
|
||||||
import {
|
import {AppBar, Box, Button, Container, Link as MuiLink, Toolbar, Typography,} from "@mui/material";
|
||||||
AppBar,
|
import {Styling} from "../general/styling";
|
||||||
Box,
|
import {BreadCrumbs} from "./breadCrumbs";
|
||||||
Button,
|
|
||||||
Container,
|
|
||||||
Link as MuiLink,
|
|
||||||
Toolbar,
|
|
||||||
Typography,
|
|
||||||
} from "@mui/material";
|
|
||||||
import { Styling } from "../general/styling";
|
|
||||||
import { BreadCrumbs } from "./breadCrumbs";
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
export const DefaultLayout: FC = ({ children }) => (
|
export const DefaultLayout: FC = ({children}) => (
|
||||||
<Styling>
|
<Styling>
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@ -26,10 +18,10 @@ export const DefaultLayout: FC = ({ children }) => (
|
|||||||
>
|
>
|
||||||
<AppBar position="sticky">
|
<AppBar position="sticky">
|
||||||
<Toolbar>
|
<Toolbar>
|
||||||
<Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
|
<Typography variant="h6" component="div" sx={{flexGrow: 1}}>
|
||||||
OpenFood
|
OpenFood
|
||||||
</Typography>
|
</Typography>
|
||||||
<Box sx={{ display: "flex", gap: 2 }}>
|
<Box sx={{display: "flex", gap: 2}}>
|
||||||
<Link href="/auth/login" passHref>
|
<Link href="/auth/login" passHref>
|
||||||
<MuiLink>
|
<MuiLink>
|
||||||
<Button>Login</Button>
|
<Button>Login</Button>
|
||||||
@ -43,11 +35,11 @@ export const DefaultLayout: FC = ({ children }) => (
|
|||||||
</Box>
|
</Box>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
</AppBar>
|
</AppBar>
|
||||||
<Box sx={{ flexGrow: 1, pt: 2 }}>
|
<Box sx={{flexGrow: 1, pt: 2}}>
|
||||||
<Container maxWidth="sm">
|
<Container maxWidth="md">
|
||||||
<BreadCrumbs />
|
<BreadCrumbs/>
|
||||||
|
|
||||||
<Box sx={{ p: 2 }}>{children}</Box>
|
<Box sx={{p: 2, mt: 2}}>{children}</Box>
|
||||||
</Container>
|
</Container>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
44
features/auth/loginFrame.tsx
Normal file
44
features/auth/loginFrame.tsx
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import {Box, Button, Container, Grid, TextField, Typography} from "@mui/material";
|
||||||
|
|
||||||
|
const AuthScreen = ({children}) => (
|
||||||
|
<Container maxWidth="sm">
|
||||||
|
<Box sx={{bgcolor: "action.hover", borderRadius: 2, p: 3}}>
|
||||||
|
<Typography textAlign="center" variant="h6" component="h4" sx={{mb: 1}}>
|
||||||
|
Sign in to your account
|
||||||
|
</Typography>
|
||||||
|
<Box sx={{py: 2}}>{children}</Box>
|
||||||
|
</Box>
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
|
||||||
|
export const LoginFrame = () => (
|
||||||
|
|
||||||
|
|
||||||
|
<AuthScreen>
|
||||||
|
<form>
|
||||||
|
<Grid container spacing={2}>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<TextField
|
||||||
|
type="email"
|
||||||
|
required
|
||||||
|
placeholder="Email"
|
||||||
|
fullWidth
|
||||||
|
label="Email"
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<TextField
|
||||||
|
required
|
||||||
|
placeholder="Password"
|
||||||
|
type="password"
|
||||||
|
fullWidth
|
||||||
|
label="Password"
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<Button variant="contained" fullWidth sx={{mt: 2}}>Sign in</Button>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</form>
|
||||||
|
</AuthScreen>
|
||||||
|
);
|
1
features/auth/signUpFrame.tsx
Normal file
1
features/auth/signUpFrame.tsx
Normal file
@ -0,0 +1 @@
|
|||||||
|
export const SignUpFrame = () => <div>Sign up frame</div>;
|
19
pages/auth/index.tsx
Normal file
19
pages/auth/index.tsx
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { Grid } from "@mui/material";
|
||||||
|
import { LoginFrame } from "../../features/auth/loginFrame";
|
||||||
|
import { SignUpFrame } from "../../features/auth/signUpFrame";
|
||||||
|
|
||||||
|
const AuthPage = () => {
|
||||||
|
return (
|
||||||
|
<Grid container>
|
||||||
|
<Grid item xs={12} sm={6}>
|
||||||
|
<LoginFrame />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid item xs={12} sm={6}>
|
||||||
|
<SignUpFrame />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AuthPage;
|
@ -1,5 +1,7 @@
|
|||||||
|
import { LoginFrame } from "../../features/auth/loginFrame";
|
||||||
|
|
||||||
const LoginPage = () => {
|
const LoginPage = () => {
|
||||||
return <div>Login page</div>;
|
return <LoginFrame />;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default LoginPage;
|
export default LoginPage;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
import { SignUpFrame } from "../../features/auth/signUpFrame";
|
||||||
|
|
||||||
const SignUpPage = () => {
|
const SignUpPage = () => {
|
||||||
return <div>Sign up page</div>;
|
return <SignUpFrame />;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default SignUpPage;
|
export default SignUpPage;
|
||||||
|
Loading…
Reference in New Issue
Block a user