aboutsummaryrefslogtreecommitdiffstats
path: root/src/App.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/App.js')
-rw-r--r--src/App.js21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/App.js b/src/App.js
index ffc907d..437278a 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,19 +1,18 @@
-import React, { useState } from 'react';
+import React from 'react';
+import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Login from './components/Login';
+import Dashboard from './components/Dashboard';
+import PrivateRoute from './components/PrivateRoute';
const App = () => {
- const [isAuth, setIsAuth] = useState(false);
-
return (
- <div className="App">
- {isAuth ? <AdminPanel /> : <Login setAuth={setIsAuth} />}
- </div>
+ <Router>
+ <Switch>
+ <Route path="/login" component={Login} />
+ <PrivateRoute path="/dashboard" component={Dashboard} />
+ </Switch>
+ </Router>
);
};
-const AdminPanel = () => {
- // Admin panel logic
- return <div>Admin Panel</div>;
-};
-
export default App;