diff options
Diffstat (limited to 'src/App.js')
-rw-r--r-- | src/App.js | 67 |
1 files changed, 46 insertions, 21 deletions
@@ -1,25 +1,50 @@ -import logo from './logo.svg'; -import './App.css'; +import React from 'react'; +import { BrowserRouter as Router, Routes, Route, useLocation } from 'react-router-dom'; +import Navbar from './components/Navbar'; +import Footer from './components/Footer'; +import PopupWidget from './components/PopupWidget'; +import Home from './components/Home'; +import About from './pages/About'; +import Contact from './pages/Contact'; +import Login from "./pages/Login"; +import ForgotPassword from "./pages/ForgotPassword"; +import SignUp from "./pages/SignUp"; +import Careers from "./pages/Careers"; +import HelpCenter from "./pages/HelpCenter"; +import TermsOfService from "./pages/TermsOfService"; +import PrivacyPolicy from "./pages/PrivacyPolicy"; function App() { - return ( - <div className="App"> - <header className="App-header"> - <img src={logo} className="App-logo" alt="logo" /> - <p> - Edit <code>src/App.js</code> and save to reload. - </p> - <a - className="App-link" - href="https://reactjs.org" - target="_blank" - rel="noopener noreferrer" - > - Learn React - </a> - </header> - </div> - ); + const location = useLocation(); + const excludedRoutes = ['/login', '/sign-up', '/forgot-password']; + + return ( + <div className="App"> + {!excludedRoutes.includes(location.pathname) && <Navbar />} + <Routes> + <Route path="/" element={<Home />} /> + <Route path="/about" element={<About />} /> + <Route path="/contact-us" element={<Contact />} /> + <Route path="/careers" element={<Careers />} /> + <Route path="/help-center" element={<HelpCenter />} /> + <Route path="/terms-of-service" element={<TermsOfService />} /> + <Route path="/privacy-policy" element={<PrivacyPolicy />} /> + <Route path="/login" element={<Login />} /> + <Route path="/forgot-password" element={<ForgotPassword />} /> + <Route path="/sign-up" element={<SignUp />} /> + </Routes> + {!excludedRoutes.includes(location.pathname) && <Footer />} + {!excludedRoutes.includes(location.pathname) && <PopupWidget />} + </div> + ); +} + +function Root() { + return ( + <Router> + <App /> + </Router> + ); } -export default App; +export default Root; |