Start to divide application
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Pierre HUBERT 2024-05-15 19:43:54 +02:00
parent b59db99d02
commit 1daca27ba0
4 changed files with 28 additions and 7 deletions

View File

@ -36,6 +36,7 @@ import {
import { FamilyCouplesListRoute } from "./routes/family/FamilyCouplesListRoute"; import { FamilyCouplesListRoute } from "./routes/family/FamilyCouplesListRoute";
import { FamilyTreeRoute } from "./routes/family/FamilyTreeRoute"; import { FamilyTreeRoute } from "./routes/family/FamilyTreeRoute";
import { FamilyMemberTreeRoute } from "./routes/family/FamilyMemberTreeRoute"; import { FamilyMemberTreeRoute } from "./routes/family/FamilyMemberTreeRoute";
import { GenealogyHomeRoute } from "./routes/family/genealogy/GenealogyHomeRoute";
interface AuthContext { interface AuthContext {
signedIn: boolean; signedIn: boolean;
@ -68,6 +69,8 @@ export function App(): React.ReactElement {
<Route path="" element={<FamilyHomeRoute />} /> <Route path="" element={<FamilyHomeRoute />} />
<Route path="genealogy/*"> <Route path="genealogy/*">
<Route path="" element={<GenealogyHomeRoute />} />
<Route path="members" element={<FamilyMembersListRoute />} /> <Route path="members" element={<FamilyMembersListRoute />} />
<Route <Route
path="member/create" path="member/create"

View File

@ -2,7 +2,6 @@ import { useFamily } from "../../widgets/BaseFamilyRoute";
import { FamilyPageTitle } from "../../widgets/FamilyPageTitle"; import { FamilyPageTitle } from "../../widgets/FamilyPageTitle";
export function FamilyHomeRoute(): React.ReactElement { export function FamilyHomeRoute(): React.ReactElement {
const family = useFamily();
return ( return (
<> <>
<FamilyPageTitle title="Votre famille" /> <FamilyPageTitle title="Votre famille" />
@ -12,12 +11,6 @@ export function FamilyHomeRoute(): React.ReactElement {
Veuillez utiliser le menu situé à gauche pour accéder aux différentes Veuillez utiliser le menu situé à gauche pour accéder aux différentes
sections de l'application. sections de l'application.
</p> </p>
<p>Nombre de fiches de membres: {family.members.size}</p>
<p>Nombre de fiches de couples: {family.couples.size}</p>
<p>
Vous pouvez inviter d'autres personnes à rejoindre cette famille en
leur donnant une copie du code d'invitation
</p>
</div> </div>
</> </>
); );

View File

@ -0,0 +1,20 @@
import { useFamily } from "../../../widgets/BaseFamilyRoute";
import { FamilyPageTitle } from "../../../widgets/FamilyPageTitle";
export function GenealogyHomeRoute(): React.ReactElement {
const family = useFamily();
return (
<>
<FamilyPageTitle title="Généalogie de votre famille" />
<div style={{ margin: "20px" }}>
<p>
Depuis cette section de l'application, vous pouvez afficher et
compléter l'abre généalogique de votre famille.
</p>
<p>&nbsp;</p>
<p>Nombre de fiches de membres: {family.members.size}</p>
<p>Nombre de fiches de couples: {family.couples.size}</p>
</div>
</>
);
}

View File

@ -150,6 +150,11 @@ export function BaseFamilyRoute(): React.ReactElement {
<Divider sx={{ my: 1 }} /> <Divider sx={{ my: 1 }} />
<ListSubheader component="div">Généalogie</ListSubheader> <ListSubheader component="div">Généalogie</ListSubheader>
<FamilyLink
icon={<HomeIcon />}
label="Accueil"
uri="genealogy"
/>
<FamilyLink <FamilyLink
icon={<Icon path={mdiCrowd} size={1} />} icon={<Icon path={mdiCrowd} size={1} />}
label="Membres" label="Membres"