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,8 +1,7 @@
|
|||||||
import React, {FC} from "react";
|
import { FC } from "react";
|
||||||
import {AppBar, Box, Button, Container, Link as MuiLink, Toolbar, Typography,} from "@mui/material";
|
import { AppBar, Box, Container, Toolbar, Typography } from "@mui/material";
|
||||||
import { Styling } from "../general/styling";
|
import { Styling } from "../general/styling";
|
||||||
import {BreadCrumbs} from "./breadCrumbs";
|
import { DefaultNavbar } from "./defaultNavbar";
|
||||||
import Link from "next/link";
|
|
||||||
|
|
||||||
export const DefaultLayout: FC = ({ children }) => (
|
export const DefaultLayout: FC = ({ children }) => (
|
||||||
<Styling>
|
<Styling>
|
||||||
@ -21,25 +20,13 @@ export const DefaultLayout: FC = ({children}) => (
|
|||||||
<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}}>
|
|
||||||
<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>
|
</Toolbar>
|
||||||
</AppBar>
|
</AppBar>
|
||||||
<Box sx={{ flexGrow: 1, pt: 2 }}>
|
<Box sx={{ flexGrow: 1, pt: 2 }}>
|
||||||
<Container maxWidth="md">
|
<Container maxWidth="sm">
|
||||||
<BreadCrumbs/>
|
<DefaultNavbar />
|
||||||
|
|
||||||
<Box sx={{p: 2, mt: 2}}>{children}</Box>
|
<Box sx={{ p: 2 }}>{children}</Box>
|
||||||
</Container>
|
</Container>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
@ -1,29 +1,26 @@
|
|||||||
import React, { FC, useMemo } from "react";
|
import { FC, useMemo } from "react";
|
||||||
import { useRouter } from "next/router";
|
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";
|
import Link from "next/link";
|
||||||
|
|
||||||
const getPathAsContinuousLinks = (path: string) => {
|
export const DefaultNavbar: FC = () => {
|
||||||
const linkPath = path.split("/");
|
const router = useRouter();
|
||||||
|
|
||||||
|
const breadcrumbs = useMemo(() => {
|
||||||
|
const linkPath = router.asPath.split("/");
|
||||||
linkPath.shift();
|
linkPath.shift();
|
||||||
return linkPath.map((path, i) => ({
|
return linkPath.map((path, i) => ({
|
||||||
breadcrumb: path,
|
breadcrumb: path,
|
||||||
href: "/" + linkPath.slice(0, i + 1).join("/"),
|
href: "/" + linkPath.slice(0, i + 1).join("/"),
|
||||||
}));
|
}));
|
||||||
};
|
}, [router.asPath]);
|
||||||
|
|
||||||
export const BreadCrumbs: FC = () => {
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const breadcrumbs = useMemo(
|
|
||||||
() => getPathAsContinuousLinks(router.asPath),
|
|
||||||
[router.asPath]
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!breadcrumbs) {
|
if (!breadcrumbs) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(breadcrumbs);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Breadcrumbs aria-label="breadcrumb">
|
<Breadcrumbs aria-label="breadcrumb">
|
||||||
<Link href="/" passHref>
|
<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"
|
"type-check": "tsc"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "11.14.0",
|
"@emotion/react": "^11.4.1",
|
||||||
"@emotion/styled": "11.14.0",
|
"@emotion/styled": "^11.3.0",
|
||||||
"@mui/lab": "5.0.0-alpha.175",
|
"@mui/lab": "^5.0.0-alpha.50",
|
||||||
"@mui/material": "6.4.3",
|
"@mui/material": "^5.0.3",
|
||||||
"next": "latest",
|
"next": "latest",
|
||||||
"react": "19.0.0",
|
"react": "^17.0.2",
|
||||||
"react-dom": "19.0.0"
|
"react-dom": "^17.0.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "22.13.1",
|
"@types/node": "^12.12.21",
|
||||||
"@types/react": "19.0.8",
|
"@types/react": "^17.0.2",
|
||||||
"@types/react-dom": "19.0.3",
|
"@types/react-dom": "^17.0.1",
|
||||||
"prettier": "3.4.2",
|
"prettier": "^2.4.1",
|
||||||
"typescript": "5.7.3"
|
"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