feat: added categories
This commit is contained in:
		
							
								
								
									
										15
									
								
								src/App.jsx
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								src/App.jsx
									
									
									
									
									
								
							| @@ -7,6 +7,7 @@ import Footer from './components/Footer'; | ||||
| import Dashboard from './private/dashboard/Dashboard'; | ||||
| import UserManagement from './private/users/UserManagement'; | ||||
| import FurnitureVariantManagement from './private/fornitures/FurnitureVariantManagement'; | ||||
| import Categories from './private/categories/Categories'; | ||||
| import LoginPage from './private/LoginPage'; | ||||
| import { Routes, Route, Navigate } from 'react-router-dom'; | ||||
| import { useAuth } from './context/AuthContext'; | ||||
| @@ -24,10 +25,8 @@ export default function App() { | ||||
|  | ||||
|   const mainLeft = isMobile ? 0 : (drawerExpanded ? DRAWER_EXPANDED : DRAWER_COLLAPSED); | ||||
|  | ||||
|   // Evita flicker mientras se restaura sesión | ||||
|   if (initializing) return null; | ||||
|  | ||||
|   // === RUTAS PÚBLICAS (sin shell) === | ||||
|   if (!user) { | ||||
|     return ( | ||||
|       <Routes> | ||||
| @@ -37,14 +36,9 @@ export default function App() { | ||||
|     ); | ||||
|   } | ||||
|  | ||||
|   // === RUTAS PRIVADAS (con shell) === | ||||
|   return ( | ||||
|     <> | ||||
|       <AppHeader | ||||
|         zone="private" | ||||
|         currentPage={currentView} | ||||
|         leftOffset={mainLeft} | ||||
|       /> | ||||
|       <AppHeader zone="private" currentPage={currentView} leftOffset={mainLeft} /> | ||||
|  | ||||
|       <MenuDrawerPrivate | ||||
|         onSelect={(value) => setCurrentView(value)} | ||||
| @@ -64,9 +58,7 @@ export default function App() { | ||||
|         }} | ||||
|       > | ||||
|         <Routes> | ||||
|           {/* Si ya está autenticado, /login redirige al dashboard */} | ||||
|           <Route path="/login" element={<Navigate to="/" replace />} /> | ||||
|  | ||||
|           <Route | ||||
|             path="/" | ||||
|             element={ | ||||
| @@ -76,6 +68,9 @@ export default function App() { | ||||
|                 {currentView === '/ProductsManagement/CatalogManagement/ProductCollections' && ( | ||||
|                   <FurnitureVariantManagement /> | ||||
|                 )} | ||||
|                 {currentView === '/ProductsManagement/CatalogManagement/Categories' && ( | ||||
|                   <Categories /> | ||||
|                 )} | ||||
|               </> | ||||
|             } | ||||
|           /> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user