diff --git a/geneit_app/src/widgets/BaseFamilyRoute.tsx b/geneit_app/src/widgets/BaseFamilyRoute.tsx index 5e14c7f..fd3bcbf 100644 --- a/geneit_app/src/widgets/BaseFamilyRoute.tsx +++ b/geneit_app/src/widgets/BaseFamilyRoute.tsx @@ -1,7 +1,26 @@ -import { Outlet, useParams } from "react-router-dom"; -import { Family, FamilyApi } from "../api/FamilyApi"; +import { + mdiAccountMultiple, + mdiCog, + mdiCrowd, + mdiFamilyTree, + mdiHumanMaleFemale, +} from "@mdi/js"; +import Icon from "@mdi/react"; +import HomeIcon from "@mui/icons-material/Home"; +import { + Box, + Divider, + List, + ListItemButton, + ListItemIcon, + ListItemText, + ListSubheader, +} from "@mui/material"; import React from "react"; +import { Outlet, useLocation, useParams } from "react-router-dom"; +import { Family, FamilyApi } from "../api/FamilyApi"; import { AsyncWidget } from "./AsyncWidget"; +import { RouterLink } from "./RouterLink"; interface FamilyContext { family: Family; @@ -39,10 +58,61 @@ export function BaseFamilyRoute(): React.ReactElement { reloadFamilyInfo: onReload, }} > -
-

base family route

- -
+ + + } label="Accueil" uri="" /> + + } + label="Membres" + uri="members" + /> + + } + label="Couples" + uri="couples" + /> + + } + label="Arbre" + uri="tree" + /> + + + + Administration + + + } + label="Utilisateurs" + uri="users" + /> + + } + label="Paramètres" + uri="settings" + /> + + + + theme.palette.mode === "light" + ? theme.palette.grey[100] + : theme.palette.grey[900], + flexGrow: 1, + overflow: "auto", + padding: "20px", + }} + > + + + )} /> @@ -52,3 +122,22 @@ export function BaseFamilyRoute(): React.ReactElement { export function useFamily(): FamilyContext { return React.useContext(FamilyContextK)!; } + +function FamilyLink(p: { + icon: React.ReactElement; + uri: string; + label: string; +}): React.ReactElement { + const family = useFamily(); + const location = useLocation(); + const link = family.family.URL(p.uri); + + return ( + + + {p.icon} + + + + ); +}