aboutsummaryrefslogtreecommitdiffstats
path: root/panel/src/components
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-07-31 12:37:38 +0530
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-07-31 12:37:38 +0530
commit1bc31e4d8c8d23230bdac1b2bd73e76c8d455222 (patch)
tree34b9da83aa8757e70f6b5a66747fc1ba4e6a9b78 /panel/src/components
parent7dfbe0f363a434cfda5f9be996d194f03c36879c (diff)
downloadadmin-panel-1bc31e4d8c8d23230bdac1b2bd73e76c8d455222.tar.gz
admin-panel-1bc31e4d8c8d23230bdac1b2bd73e76c8d455222.tar.bz2
admin-panel-1bc31e4d8c8d23230bdac1b2bd73e76c8d455222.zip
update
Diffstat (limited to 'panel/src/components')
-rw-r--r--panel/src/components/PrivateRoute.jsx23
1 files changed, 15 insertions, 8 deletions
diff --git a/panel/src/components/PrivateRoute.jsx b/panel/src/components/PrivateRoute.jsx
index 04e00f7..2160f74 100644
--- a/panel/src/components/PrivateRoute.jsx
+++ b/panel/src/components/PrivateRoute.jsx
@@ -1,10 +1,17 @@
-import React from 'react';
-import { Navigate, Outlet } from 'react-router-dom';
-import { useAuth } from '../contexts/AuthContext';
+import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
+import LoginPage from '../pages/LoginPage';
+import Dashboard from '../pages/Dashboard'; // Assuming you have a Dashboard component
-const PrivateRoute = () => {
- const { currentUser } = useAuth();
- return currentUser ? <Outlet /> : <Navigate to="/login" />;
-};
+function App() {
+ return (
+ <Router>
+ <Routes>
+ <Route path="/login" element={<LoginPage />} />
+ <Route path="/dashboard" element={<Dashboard />} />
+ {/* Other routes */}
+ </Routes>
+ </Router>
+ );
+}
-export default PrivateRoute;
+export default App;