Compare commits
No commits in common. "main" and "471165d949d4359daca5b2e71f880790574950d4" have entirely different histories.
main
...
471165d949
@ -1,9 +0,0 @@
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: "test"
|
||||
steps:
|
||||
- name: test
|
||||
image: harbor.front.kjuulh.io/docker-proxy/library/bash:latest
|
||||
commands:
|
||||
- echo 'Run tests'
|
6
.idea/prettier.xml
Normal file
6
.idea/prettier.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PrettierConfiguration">
|
||||
<option name="myRunOnSave" value="true" />
|
||||
</component>
|
||||
</project>
|
@ -1,47 +1,34 @@
|
||||
import React, {FC} from "react";
|
||||
import {AppBar, Box, 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 { FC } from "react";
|
||||
import { AppBar, Box, Container, Toolbar, Typography } from "@mui/material";
|
||||
import { Styling } from "../general/styling";
|
||||
import { DefaultNavbar } from "./defaultNavbar";
|
||||
|
||||
export const DefaultLayout: FC = ({children}) => (
|
||||
<Styling>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
width: "100%",
|
||||
minHeight: "100vh",
|
||||
bgcolor: "background.default",
|
||||
color: "text.primary",
|
||||
flexDirection: "column",
|
||||
}}
|
||||
>
|
||||
<AppBar position="sticky">
|
||||
<Toolbar>
|
||||
<Typography variant="h6" component="div" sx={{flexGrow: 1}}>
|
||||
OpenFood
|
||||
</Typography>
|
||||
<Box sx={{display: "flex", gap: 2}}>
|
||||
<Link href="/auth/login" passHref>
|
||||
<MuiLink>
|
||||
<Button>Login</Button>
|
||||
</MuiLink>
|
||||
</Link>
|
||||
<Link href="/auth/sign-up" passHref>
|
||||
<MuiLink>
|
||||
<Button>Sign up</Button>
|
||||
</MuiLink>
|
||||
</Link>
|
||||
</Box>
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
<Box sx={{flexGrow: 1, pt: 2}}>
|
||||
<Container maxWidth="md">
|
||||
<BreadCrumbs/>
|
||||
export const DefaultLayout: FC = ({ children }) => (
|
||||
<Styling>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
width: "100%",
|
||||
minHeight: "100vh",
|
||||
bgcolor: "background.default",
|
||||
color: "text.primary",
|
||||
flexDirection: "column",
|
||||
}}
|
||||
>
|
||||
<AppBar position="sticky">
|
||||
<Toolbar>
|
||||
<Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
|
||||
OpenFood
|
||||
</Typography>
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
<Box sx={{ flexGrow: 1, pt: 2 }}>
|
||||
<Container maxWidth="sm">
|
||||
<DefaultNavbar />
|
||||
|
||||
<Box sx={{p: 2, mt: 2}}>{children}</Box>
|
||||
</Container>
|
||||
</Box>
|
||||
</Box>
|
||||
</Styling>
|
||||
<Box sx={{ p: 2 }}>{children}</Box>
|
||||
</Container>
|
||||
</Box>
|
||||
</Box>
|
||||
</Styling>
|
||||
);
|
||||
|
@ -1,29 +1,26 @@
|
||||
import React, { FC, useMemo } from "react";
|
||||
import { FC, useMemo } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
import { Breadcrumbs, Button, Link as MuiLink } from "@mui/material";
|
||||
import { Breadcrumbs, Link as MuiLink } from "@mui/material";
|
||||
import Link from "next/link";
|
||||
|
||||
const getPathAsContinuousLinks = (path: string) => {
|
||||
const linkPath = path.split("/");
|
||||
linkPath.shift();
|
||||
return linkPath.map((path, i) => ({
|
||||
breadcrumb: path,
|
||||
href: "/" + linkPath.slice(0, i + 1).join("/"),
|
||||
}));
|
||||
};
|
||||
|
||||
export const BreadCrumbs: FC = () => {
|
||||
export const DefaultNavbar: FC = () => {
|
||||
const router = useRouter();
|
||||
|
||||
const breadcrumbs = useMemo(
|
||||
() => getPathAsContinuousLinks(router.asPath),
|
||||
[router.asPath]
|
||||
);
|
||||
const breadcrumbs = useMemo(() => {
|
||||
const linkPath = router.asPath.split("/");
|
||||
linkPath.shift();
|
||||
return linkPath.map((path, i) => ({
|
||||
breadcrumb: path,
|
||||
href: "/" + linkPath.slice(0, i + 1).join("/"),
|
||||
}));
|
||||
}, [router.asPath]);
|
||||
|
||||
if (!breadcrumbs) {
|
||||
return null;
|
||||
}
|
||||
|
||||
console.log(breadcrumbs);
|
||||
|
||||
return (
|
||||
<Breadcrumbs aria-label="breadcrumb">
|
||||
<Link href="/" passHref>
|
@ -1,44 +0,0 @@
|
||||
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 +0,0 @@
|
||||
export const SignUpFrame = () => <div>Sign up frame</div>;
|
22
package.json
22
package.json
@ -7,19 +7,19 @@
|
||||
"type-check": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "11.14.0",
|
||||
"@emotion/styled": "11.14.0",
|
||||
"@mui/lab": "5.0.0-alpha.175",
|
||||
"@mui/material": "6.4.3",
|
||||
"@emotion/react": "^11.4.1",
|
||||
"@emotion/styled": "^11.3.0",
|
||||
"@mui/lab": "^5.0.0-alpha.50",
|
||||
"@mui/material": "^5.0.3",
|
||||
"next": "latest",
|
||||
"react": "19.0.0",
|
||||
"react-dom": "19.0.0"
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "22.13.1",
|
||||
"@types/react": "19.0.8",
|
||||
"@types/react-dom": "19.0.3",
|
||||
"prettier": "3.4.2",
|
||||
"typescript": "5.7.3"
|
||||
"@types/node": "^12.12.21",
|
||||
"@types/react": "^17.0.2",
|
||||
"@types/react-dom": "^17.0.1",
|
||||
"prettier": "^2.4.1",
|
||||
"typescript": "^4.4.4"
|
||||
}
|
||||
}
|
||||
|
@ -1,19 +0,0 @@
|
||||
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,7 +0,0 @@
|
||||
import { LoginFrame } from "../../features/auth/loginFrame";
|
||||
|
||||
const LoginPage = () => {
|
||||
return <LoginFrame />;
|
||||
};
|
||||
|
||||
export default LoginPage;
|
@ -1,7 +0,0 @@
|
||||
import { SignUpFrame } from "../../features/auth/signUpFrame";
|
||||
|
||||
const SignUpPage = () => {
|
||||
return <SignUpFrame />;
|
||||
};
|
||||
|
||||
export default SignUpPage;
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
|
||||
}
|
Loading…
Reference in New Issue
Block a user