chore: remove unneed code
This commit is contained in:
		
							
								
								
									
										48
									
								
								src/App.jsx
									
									
									
									
									
								
							
							
						
						
									
										48
									
								
								src/App.jsx
									
									
									
									
									
								
							| @@ -35,39 +35,27 @@ function App() { | ||||
|  | ||||
|         <AppHeader zone={zone} onSelectMenuItem={(view) => setCurrentView(view)} /> | ||||
|  | ||||
|         {/* Main content area */} | ||||
|         {/* <Box component="main" sx={{ flex: 1, p: 2 }}> | ||||
|           {zone === 'private' && <Clients />} | ||||
|           {zone === 'restricted' && <Clients />} | ||||
|  | ||||
|           {zone === 'public' && currentView === 'Products' && <Products />} | ||||
|           {zone === 'public' && currentView === 'Clients' && <Clients />} | ||||
|           {zone === 'public' && currentView === 'Providers' && <Providers />} | ||||
|           {zone === 'public' && currentView === 'Categories' && <Categories />} | ||||
|           {zone === 'public' && currentView === 'Admin' && <Admin />} | ||||
|         </Box> */} | ||||
|  | ||||
|         <Box component="main" sx={{ flex: 1, p: 2 }}> | ||||
|         <Routes> | ||||
|           <Route path="/login" element={<LoginPage />} /> | ||||
|           <Routes> | ||||
|             <Route path="/login" element={<LoginPage />} /> | ||||
|  | ||||
|           <Route | ||||
|             path="/" | ||||
|             element={ | ||||
|               <PrivateRoute> | ||||
|                 {zone === 'private' && <Clients />} | ||||
|                 {zone === 'restricted' && <Clients />} | ||||
|             <Route | ||||
|               path="/" | ||||
|               element={ | ||||
|                 <PrivateRoute> | ||||
|                   {zone === 'private' && <Clients />} | ||||
|                   {zone === 'restricted' && <Clients />} | ||||
|  | ||||
|                 {zone === 'public' && currentView === 'Products' && <Products />} | ||||
|                 {zone === 'public' && currentView === 'Clients' && <Clients />} | ||||
|                 {zone === 'public' && currentView === 'Providers' && <Providers />} | ||||
|                 {zone === 'public' && currentView === 'Categories' && <Categories />} | ||||
|                 {zone === 'public' && currentView === 'Admin' && <Admin />} | ||||
|               </PrivateRoute> | ||||
|             } | ||||
|           /> | ||||
|         </Routes> | ||||
|       </Box> | ||||
|                   {zone === 'public' && currentView === 'Products' && <Products />} | ||||
|                   {zone === 'public' && currentView === 'Clients' && <Clients />} | ||||
|                   {zone === 'public' && currentView === 'Providers' && <Providers />} | ||||
|                   {zone === 'public' && currentView === 'Categories' && <Categories />} | ||||
|                   {zone === 'public' && currentView === 'Admin' && <Admin />} | ||||
|                 </PrivateRoute> | ||||
|               } | ||||
|             /> | ||||
|           </Routes> | ||||
|         </Box> | ||||
|  | ||||
|  | ||||
|         <Footer zone={zone} /> | ||||
|   | ||||
| @@ -15,9 +15,9 @@ createRoot(document.getElementById('root')).render( | ||||
|       <SnackbarProvider maxSnack={3} autoHideDuration={3000}> | ||||
|         <GoogleOAuthProvider clientId="128345072002-mtfdgpcur44o9tbd7q6e0bb9qnp2crfp.apps.googleusercontent.com"> | ||||
|           <AuthProvider> | ||||
|              <BrowserRouter> | ||||
|                <App /> | ||||
|              </BrowserRouter> | ||||
|             <BrowserRouter> | ||||
|               <App /> | ||||
|             </BrowserRouter> | ||||
|           </AuthProvider> | ||||
|         </GoogleOAuthProvider> | ||||
|       </SnackbarProvider> | ||||
|   | ||||
| @@ -5,25 +5,25 @@ import { useNavigate } from 'react-router-dom'; | ||||
| import { Box, Typography } from '@mui/material'; | ||||
|  | ||||
| export default function LoginPage() { | ||||
|   const { login } = useAuth(); | ||||
|   const navigate = useNavigate(); | ||||
|     const { login } = useAuth(); | ||||
|     const navigate = useNavigate(); | ||||
|  | ||||
|   return ( | ||||
|     <Box display="flex" flexDirection="column" alignItems="center" mt={10}> | ||||
|       <Typography variant="h4" gutterBottom> | ||||
|         Iniciar sesión | ||||
|       </Typography> | ||||
|     return ( | ||||
|         <Box display="flex" flexDirection="column" alignItems="center" mt={10}> | ||||
|             <Typography variant="h4" gutterBottom> | ||||
|                 Iniciar sesión | ||||
|             </Typography> | ||||
|  | ||||
|       <GoogleLogin | ||||
|         onSuccess={(credentialResponse) => { | ||||
|           const user = jwt_decode(credentialResponse.credential); | ||||
|           login(user); | ||||
|           navigate('/'); | ||||
|         }} | ||||
|         onError={() => { | ||||
|           console.log('Error al iniciar sesión'); | ||||
|         }} | ||||
|       /> | ||||
|     </Box> | ||||
|   ); | ||||
|             <GoogleLogin | ||||
|                 onSuccess={(credentialResponse) => { | ||||
|                     const user = jwt_decode(credentialResponse.credential); | ||||
|                     login(user); | ||||
|                     navigate('/'); | ||||
|                 }} | ||||
|                 onError={() => { | ||||
|                     console.log('Error al iniciar sesión'); | ||||
|                 }} | ||||
|             /> | ||||
|         </Box> | ||||
|     ); | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Rodolfo Ruiz
					Rodolfo Ruiz