Compare commits

..

No commits in common. "main" and "471165d949d4359daca5b2e71f880790574950d4" have entirely different histories.

12 changed files with 366 additions and 668 deletions

View File

@ -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
View 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>

View File

@ -1,8 +1,7 @@
import React, {FC} from "react";
import {AppBar, Box, Button, Container, Link as MuiLink, Toolbar, Typography,} from "@mui/material";
import { FC } from "react";
import { AppBar, Box, Container, Toolbar, Typography } from "@mui/material";
import { Styling } from "../general/styling";
import {BreadCrumbs} from "./breadCrumbs";
import Link from "next/link";
import { DefaultNavbar } from "./defaultNavbar";
export const DefaultLayout: FC = ({ children }) => (
<Styling>
@ -21,25 +20,13 @@ export const DefaultLayout: FC = ({children}) => (
<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/>
<Container maxWidth="sm">
<DefaultNavbar />
<Box sx={{p: 2, mt: 2}}>{children}</Box>
<Box sx={{ p: 2 }}>{children}</Box>
</Container>
</Box>
</Box>

View File

@ -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("/");
export const DefaultNavbar: FC = () => {
const router = useRouter();
const breadcrumbs = useMemo(() => {
const linkPath = router.asPath.split("/");
linkPath.shift();
return linkPath.map((path, i) => ({
breadcrumb: path,
href: "/" + linkPath.slice(0, i + 1).join("/"),
}));
};
export const BreadCrumbs: FC = () => {
const router = useRouter();
const breadcrumbs = useMemo(
() => getPathAsContinuousLinks(router.asPath),
[router.asPath]
);
}, [router.asPath]);
if (!breadcrumbs) {
return null;
}
console.log(breadcrumbs);
return (
<Breadcrumbs aria-label="breadcrumb">
<Link href="/" passHref>

View File

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

View File

@ -1 +0,0 @@
export const SignUpFrame = () => <div>Sign up frame</div>;

View File

@ -7,19 +7,19 @@
"type-check": "tsc"
},
"dependencies": {
"@emotion/react": "11.13.3",
"@emotion/styled": "11.13.0",
"@mui/lab": "5.0.0-alpha.173",
"@mui/material": "6.1.5",
"@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": "18.3.1",
"react-dom": "18.3.1"
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@types/node": "20.16.15",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.1",
"prettier": "3.3.3",
"typescript": "5.6.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"
}
}

View File

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

View File

@ -1,7 +0,0 @@
import { LoginFrame } from "../../features/auth/loginFrame";
const LoginPage = () => {
return <LoginFrame />;
};
export default LoginPage;

View File

@ -1,7 +0,0 @@
import { SignUpFrame } from "../../features/auth/signUpFrame";
const SignUpPage = () => {
return <SignUpFrame />;
};
export default SignUpPage;

View File

@ -1,3 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}

812
yarn.lock

File diff suppressed because it is too large Load Diff