diff options
Diffstat (limited to 'src/App.js')
-rw-r--r-- | src/App.js | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -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; |