From f27a75d9d6f3b0733971aadce370ea719ff60742 Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Mon, 1 Dec 2025 11:32:12 +0100 Subject: [PATCH] feat: Implement initial application structure with routing, authentication flow, and responsive layout. --- frontend/src/App.jsx | 7 +- frontend/src/components/layout/Layout.jsx | 219 ++++++++++++---------- frontend/src/index.css | 85 ++++----- 3 files changed, 157 insertions(+), 154 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 134d986..cf7bed8 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -55,12 +55,9 @@ function PublicRoute({ children }) { } function AppRoutes() { - const { theme, toggleTheme } = useTheme(); - const { isAuthenticated } = useAuth(); - return ( <> - + - + } /> } /> diff --git a/frontend/src/components/layout/Layout.jsx b/frontend/src/components/layout/Layout.jsx index 690a190..ed21308 100644 --- a/frontend/src/components/layout/Layout.jsx +++ b/frontend/src/components/layout/Layout.jsx @@ -1,13 +1,13 @@ import React, { useState } from 'react'; import { Link, useLocation, useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import { LayoutDashboard, Search, TrendingUp, BookOpen, Moon, Sun, Menu, LogOut, Shield, ShoppingBag } from 'lucide-react'; +import { LayoutDashboard, Search, TrendingUp, BookOpen, Menu, LogOut, Shield, ShoppingBag } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet'; import { cn } from '@/lib/utils'; import { useAuth } from '@/hooks/use-auth'; -const Layout = ({ children, theme, toggleTheme }) => { +const Layout = ({ children }) => { const { t } = useTranslation(); const location = useLocation(); const navigate = useNavigate(); @@ -19,6 +19,7 @@ const Layout = ({ children, theme, toggleTheme }) => { navigate('/login'); }; + // Main navigation items (without admin) const navItems = [ { icon: LayoutDashboard, label: t('nav.dashboard'), path: '/' }, { icon: Search, label: t('nav.search') || 'Recherche', path: '/search' }, @@ -27,25 +28,23 @@ const Layout = ({ children, theme, toggleTheme }) => { { icon: BookOpen, label: 'Catalogues', path: '/catalogues' }, ]; - // Add admin link for admin users - if (isAdmin) { - navItems.push({ icon: Shield, label: 'Administration', path: '/admin' }); - } - return ( -
- {/* Sidebar */} -