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,10 +1,9 @@
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>
<Box <Box
sx={{ sx={{
@ -18,28 +17,16 @@ 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}}>
<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>

View File

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

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" "type-check": "tsc"
}, },
"dependencies": { "dependencies": {
"@emotion/react": "11.13.3", "@emotion/react": "^11.4.1",
"@emotion/styled": "11.13.0", "@emotion/styled": "^11.3.0",
"@mui/lab": "5.0.0-alpha.173", "@mui/lab": "^5.0.0-alpha.50",
"@mui/material": "6.1.5", "@mui/material": "^5.0.3",
"next": "latest", "next": "latest",
"react": "18.3.1", "react": "^17.0.2",
"react-dom": "18.3.1" "react-dom": "^17.0.2"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "20.16.15", "@types/node": "^12.12.21",
"@types/react": "18.3.11", "@types/react": "^17.0.2",
"@types/react-dom": "18.3.1", "@types/react-dom": "^17.0.1",
"prettier": "3.3.3", "prettier": "^2.4.1",
"typescript": "5.6.3" "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