From c07f8ad82ef7b993049b20ce3fd7a30ac4a469b4 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 16 Aug 2026 21:04:51 +0200 Subject: [PATCH] Web: wire AppLayout into routing + stub section pages (step 3/5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - App.tsx: every authenticated route now nests under one RequireAuth + AppLayout parent route (react-router nested routes/) instead of each page wrapping its own guard. - New routes/pages: /recettes, /liste-de-courses, /foyer, each a thin wrapper around a shared ComingSoonPage ("cette section arrive bientôt.") — no backend behind them yet, matches the "pages stub dédiées" choice discussed in chat. - locales/fr/translation.json: nav labels + stub copy. HomePage still shows its own greeting/logout card here (unchanged, now nested inside AppLayout's — briefly duplicating the sidebar's greeting/logout) — replaced by the actual planning view in the next commit. --- apps/web/src/App.tsx | 24 +++++++++++++++++------- apps/web/src/locales/fr/translation.json | 12 ++++++++++++ apps/web/src/pages/ComingSoonPage.scss | 12 ++++++++++++ apps/web/src/pages/ComingSoonPage.tsx | 23 +++++++++++++++++++++++ apps/web/src/pages/HouseholdPage.tsx | 8 ++++++++ apps/web/src/pages/RecipesPage.tsx | 8 ++++++++ apps/web/src/pages/ShoppingListPage.tsx | 10 ++++++++++ 7 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 apps/web/src/pages/ComingSoonPage.scss create mode 100644 apps/web/src/pages/ComingSoonPage.tsx create mode 100644 apps/web/src/pages/HouseholdPage.tsx create mode 100644 apps/web/src/pages/RecipesPage.tsx create mode 100644 apps/web/src/pages/ShoppingListPage.tsx diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index 2d62989..3709ca9 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -1,27 +1,37 @@ import { Navigate, Route, Routes } from "react-router-dom"; import { RedirectIfAuthenticated } from "./features/auth/RedirectIfAuthenticated"; import { RequireAuth } from "./features/auth/RequireAuth"; +import { AppLayout } from "./layouts/AppLayout"; import { HomePage } from "./pages/HomePage"; +import { HouseholdPage } from "./pages/HouseholdPage"; import { LoginPage } from "./pages/LoginPage"; +import { RecipesPage } from "./pages/RecipesPage"; +import { ShoppingListPage } from "./pages/ShoppingListPage"; import { SignupPage } from "./pages/SignupPage"; /** - * Top-level route table. `/` requires an authenticated session (see - * {@link RequireAuth}); `/login` and `/signup` redirect an already-logged-in - * visitor to `/` instead (see {@link RedirectIfAuthenticated}). Anything - * else falls back to `/`, which itself redirects to `/login` if needed. + * Top-level route table. Every authenticated section is nested under one + * `RequireAuth` + `AppLayout` parent route (sidebar chrome + `/auth` + * guard applied once, not per-page — see {@link AppLayout}); `/login` and + * `/signup` redirect an already-logged-in visitor to `/` instead (see + * {@link RedirectIfAuthenticated}). Anything else falls back to `/`, which + * itself redirects to `/login` if needed. */ export function App() { return ( - + } - /> + > + } /> + } /> + } /> + } /> + +

{title}

+

{description}

+ + ); +} diff --git a/apps/web/src/pages/HouseholdPage.tsx b/apps/web/src/pages/HouseholdPage.tsx new file mode 100644 index 0000000..8502f37 --- /dev/null +++ b/apps/web/src/pages/HouseholdPage.tsx @@ -0,0 +1,8 @@ +import { useTranslation } from "react-i18next"; +import { ComingSoonPage } from "./ComingSoonPage"; + +/** Household & profile section — routed at `/foyer`. No backend yet beyond auth, stub for now. */ +export function HouseholdPage() { + const { t } = useTranslation(); + return ; +} diff --git a/apps/web/src/pages/RecipesPage.tsx b/apps/web/src/pages/RecipesPage.tsx new file mode 100644 index 0000000..e7080fc --- /dev/null +++ b/apps/web/src/pages/RecipesPage.tsx @@ -0,0 +1,8 @@ +import { useTranslation } from "react-i18next"; +import { ComingSoonPage } from "./ComingSoonPage"; + +/** Recipes section — routed at `/recettes`. No backend yet (see README's "Planning" section), stub for now. */ +export function RecipesPage() { + const { t } = useTranslation(); + return ; +} diff --git a/apps/web/src/pages/ShoppingListPage.tsx b/apps/web/src/pages/ShoppingListPage.tsx new file mode 100644 index 0000000..090be39 --- /dev/null +++ b/apps/web/src/pages/ShoppingListPage.tsx @@ -0,0 +1,10 @@ +import { useTranslation } from "react-i18next"; +import { ComingSoonPage } from "./ComingSoonPage"; + +/** Shopping list section — routed at `/liste-de-courses`. No backend yet, stub for now. */ +export function ShoppingListPage() { + const { t } = useTranslation(); + return ( + + ); +}