Untitled
unknown
javascript
2 years ago
951 B
17
Indexable
import './App.css'; import { BrowserRouter as Router, Routes, Route} from "react-router-dom"; import Home from "./pages/Home"; import Tvota from "./pages/Tvota"; import Navbar from './components/Navbar'; import TvotaNavbar from './components/TvotaNavbar'; function App() { const isLoggedIn = window.location.href; if(isLoggedIn==="http://localhost:3000/") return ( <div className="App"> <Router> <Navbar></Navbar> <Routes> <Route path="/" element ={<Home />} /> <Route path="/tvota" element ={<Tvota />} /> </Routes> </Router> </div> ); if(isLoggedIn==="http://localhost:3000/tvota") return ( <div className="TvotaApp"> <Router> <TvotaNavbar></TvotaNavbar> <Routes> <Route path="/tvota" element ={<Tvota />} /> </Routes> </Router> </div> ); } export default App;