Add accommodations home route
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Pierre HUBERT 2024-06-15 09:58:27 +02:00
parent b72374481e
commit f965ddc99e
3 changed files with 36 additions and 0 deletions

View File

@ -18,6 +18,7 @@ import { PasswordForgottenRoute } from "./routes/auth/PasswordForgottenRoute";
import { ResetPasswordRoute } from "./routes/auth/ResetPasswordRoute";
import { FamilySettingsRoute } from "./routes/family/FamilySettingsRoute";
import { FamilyUsersListRoute } from "./routes/family/FamilyUsersListRoute";
import { AccommodationsHomeRoute } from "./routes/family/accommodations/AccommodationsHomeRoute";
import { AccommodationsSettingsRoute } from "./routes/family/accommodations/AccommodationsSettingsRoute";
import {
FamilyCoupleRoute,
@ -116,6 +117,7 @@ export function App(): React.ReactElement {
path="accommodations/*"
element={<BaseAccommodationsRoute />}
>
<Route path="" element={<AccommodationsHomeRoute />} />
<Route
path="settings"
element={<AccommodationsSettingsRoute />}

View File

@ -0,0 +1,21 @@
import { FamilyPageTitle } from "../../../widgets/FamilyPageTitle";
import { useAccommodations } from "../../../widgets/accommodations/BaseAccommodationsRoute";
export function AccommodationsHomeRoute(): React.ReactElement {
const accommodations = useAccommodations();
return (
<>
<FamilyPageTitle title="Réservation de logements" />
<div style={{ margin: "20px" }}>
<p>
Depuis cette section de l'application, vous pouvez effectuer des
réservations de logements.
</p>
<p>&nbsp;</p>
<p>
Nombre de logements définis : {accommodations.accommodations.size}
</p>
</div>
</>
);
}

View File

@ -185,6 +185,19 @@ export function BaseFamilyRoute(): React.ReactElement {
</>
)}
{family?.enable_accommodations && (
<>
<Divider sx={{ my: 1 }} />
<ListSubheader component="div">Logements</ListSubheader>
<FamilyLink
icon={<HomeIcon />}
label="Accueil"
uri="accommodations"
/>
</>
)}
<Divider sx={{ my: 1 }} />
<ListSubheader component="div">Administration</ListSubheader>