This commit is contained in:
Darren Clarke 2024-03-16 19:39:20 +01:00
parent 43bfdaa1e3
commit fe6c9419dd
87 changed files with 16739 additions and 2526 deletions

View file

@ -0,0 +1,31 @@
"use client";
import { FC } from "react";
import { Grid, Box } from "@mui/material";
import { useRouter } from "next/navigation";
import { typography } from "@/app/_styles/theme";
interface DeleteDialogProps {
title: string;
entity: string;
children: any;
}
export const DeleteDialog: FC<DeleteDialogProps> = ({ title, entity, children }) => {
const router = useRouter();
const { h3 } = typography;
return (
<Box sx={{ height: "100vh", backgroundColor: "#ddd", p: 3 }}>
<Grid container direction="column">
<Grid item>
<Box sx={h3}>{title}</Box>
</Grid>
<Grid item>
{children}
</Grid>
</Grid>
</Box>
);
};

View file

@ -0,0 +1,30 @@
"use client";
import { FC } from "react";
import { Grid, Box } from "@mui/material";
import { useRouter } from "next/navigation";
import { typography } from "@/app/_styles/theme";
interface DetailProps {
title: string;
entity: string;
children: any;
}
export const Detail: FC<DetailProps> = ({ title, entity, children }) => {
const router = useRouter();
const { h3 } = typography;
return (
<Box sx={{ height: "100vh", backgroundColor: "#ddd", p: 3 }}>
<Grid container direction="column">
<Grid item>
<Box sx={h3}>{title}</Box>
</Grid>
<Grid item>
{children}
</Grid>
</Grid>
</Box>
);
};

View file

@ -0,0 +1,30 @@
"use client";
import { FC } from "react";
import { Grid, Box } from "@mui/material";
import { useRouter } from "next/navigation";
import { typography } from "@/app/_styles/theme";
interface EditProps {
title: string;
entity: string;
children: any;
}
export const Edit: FC<EditProps> = ({ title, entity, children }) => {
const router = useRouter();
const { h3 } = typography;
return (
<Box sx={{ height: "100vh", backgroundColor: "#ddd", p: 3 }}>
<Grid container direction="column">
<Grid item>
<Box sx={h3}>{title}</Box>
</Grid>
<Grid item>
{children}
</Grid>
</Grid>
</Box>
);
};

View file

@ -3,19 +3,36 @@
import { FC, PropsWithChildren, useState } from "react";
import { Grid } from "@mui/material";
import { Sidebar } from "./Sidebar";
import { CssBaseline } from "@mui/material";
import { css, Global } from "@emotion/react";
import { fonts } from "@/app/_styles/theme";
type LayoutProps = PropsWithChildren<{
docs?: any;
}>;
export const InternalLayout: FC<PropsWithChildren> = ({ children }) => {
const [open, setOpen] = useState(true);
const { roboto } = fonts;
const globalCSS = css`
* {
font-family: ${roboto.style.fontFamily};
}
`;
return (
<Grid container direction="row">
<Sidebar open={open} setOpen={setOpen} />
<Grid
item
sx={{ ml: open ? "270px" : "100px", width: "100%", height: "100vh" }}
>
{children as any}
<>
<Global styles={globalCSS} />
<CssBaseline />
<Grid container direction="row">
<Sidebar open={open} setOpen={setOpen} />
<Grid
item
sx={{ ml: open ? "270px" : "100px", width: "100%", height: "100vh" }}
>
{children as any}
</Grid>
</Grid>
</Grid>
</>
);
};

View file

@ -4,6 +4,7 @@ import { FC } from "react";
import { Grid, Box } from "@mui/material";
import { DataGridPro, GridColDef } from "@mui/x-data-grid-pro";
import { useRouter } from "next/navigation";
import { typography } from "@/app/_styles/theme";
interface ListProps {
title: string;
@ -14,6 +15,7 @@ interface ListProps {
export const List: FC<ListProps> = ({ title, entity, rows, columns }) => {
const router = useRouter();
const { h3 } = typography;
const onRowClick = (id: string) => {
router.push(`/${entity}/${id}`);
@ -23,7 +25,7 @@ export const List: FC<ListProps> = ({ title, entity, rows, columns }) => {
<Box sx={{ height: "100vh", backgroundColor: "#ddd", p: 3 }}>
<Grid container direction="column">
<Grid item>
<h1>{title}</h1>
<Box sx={h3}>{title}</Box>
</Grid>
<Grid item>
<Box

View file

@ -23,7 +23,8 @@ import {
import { usePathname } from "next/navigation";
import Link from "next/link";
import Image from "next/image";
// import LinkLogo from "public/link-logo-small.png";
import { fonts } from "@/app/_styles/theme";
import LinkLogo from "@/public/link-logo-small.png";
// import { useSession, signOut } from "next-auth/react";
const openWidth = 270;
@ -113,7 +114,6 @@ const MenuItem = ({
variant="body1"
sx={{
fontSize: 16,
fontFamily: "Roboto",
fontWeight: "bold",
border: 0,
textAlign: "left",
@ -155,6 +155,7 @@ interface SidebarProps {
export const Sidebar: FC<SidebarProps> = ({ open, setOpen }) => {
const pathname = usePathname();
const { poppins } = fonts;
// const { data: session } = useSession();
// const username = session?.user?.name || "User";
@ -215,7 +216,7 @@ export const Sidebar: FC<SidebarProps> = ({ open, setOpen }) => {
}}
>
<Image
src={"" /* LinkLogo */}
src={LinkLogo}
alt="Link logo"
width={40}
height={40}
@ -237,7 +238,7 @@ export const Sidebar: FC<SidebarProps> = ({ open, setOpen }) => {
fontWeight: 700,
mt: 1,
ml: 0.5,
fontFamily: "Poppins",
fontFamily: poppins.style.fontFamily,
}}
>
Metamigo