diff options
Diffstat (limited to 'src/App.js')
-rw-r--r-- | src/App.js | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/App.js b/src/App.js new file mode 100644 index 0000000..9703cfc --- /dev/null +++ b/src/App.js @@ -0,0 +1,50 @@ +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() { + 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 Root; |