Add an accommodations reservations module #188

Merged
pierre merged 81 commits from accomodation_module into master 2024-06-22 21:30:26 +00:00
3 changed files with 36 additions and 0 deletions
Showing only changes of commit f965ddc99e - Show all commits

View File

@ -18,6 +18,7 @@ import { PasswordForgottenRoute } from "./routes/auth/PasswordForgottenRoute";
import { ResetPasswordRoute } from "./routes/auth/ResetPasswordRoute"; import { ResetPasswordRoute } from "./routes/auth/ResetPasswordRoute";
import { FamilySettingsRoute } from "./routes/family/FamilySettingsRoute"; import { FamilySettingsRoute } from "./routes/family/FamilySettingsRoute";
import { FamilyUsersListRoute } from "./routes/family/FamilyUsersListRoute"; import { FamilyUsersListRoute } from "./routes/family/FamilyUsersListRoute";
import { AccommodationsHomeRoute } from "./routes/family/accommodations/AccommodationsHomeRoute";
import { AccommodationsSettingsRoute } from "./routes/family/accommodations/AccommodationsSettingsRoute"; import { AccommodationsSettingsRoute } from "./routes/family/accommodations/AccommodationsSettingsRoute";
import { import {
FamilyCoupleRoute, FamilyCoupleRoute,
@ -116,6 +117,7 @@ export function App(): React.ReactElement {
path="accommodations/*" path="accommodations/*"
element={<BaseAccommodationsRoute />} element={<BaseAccommodationsRoute />}
> >
<Route path="" element={<AccommodationsHomeRoute />} />
<Route <Route
path="settings" path="settings"
element={<AccommodationsSettingsRoute />} 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 }} /> <Divider sx={{ my: 1 }} />
<ListSubheader component="div">Administration</ListSubheader> <ListSubheader component="div">Administration</ListSubheader>