@@ -16,14 +16,15 @@ import TermsOfService from './pages/TermsOfService';
1616import PrivacyPolicy from './pages/PrivacyPolicy' ;
1717import NotFound from "./pages/NotFound" ;
1818
19- function AppShell ( ) {
19+ function AppContent ( ) {
2020 const location = useLocation ( ) ;
21+ // Only show LocationBanner if not on the Home page
2122 const showLocationBanner = location . pathname !== '/' ;
2223
2324 return (
2425 < div className = "flex flex-col min-h-screen" >
2526 < Navbar />
26- { showLocationBanner ? < LocationBanner /> : null }
27+ { showLocationBanner && < LocationBanner /> }
2728 < main className = "flex-grow bg-gray-50" >
2829 < Routes >
2930 < Route path = "/" element = { < Home /> } />
@@ -34,7 +35,11 @@ function AppShell() {
3435 < Route path = "/worker/:id" element = { < WorkerProfile /> } />
3536 < Route path = "/profile" element = { < Profile /> } />
3637 < Route path = "/bookings" element = { < Bookings /> } />
37- { /* TODO: Add more routes here */ }
38+ < Route path = "/worker-register" element = { < WorkerRegister /> } />
39+ < Route path = "/help" element = { < HelpCenter /> } />
40+ < Route path = "/terms" element = { < TermsOfService /> } />
41+ < Route path = "/privacy" element = { < PrivacyPolicy /> } />
42+ < Route path = "*" element = { < NotFound /> } />
3843 </ Routes >
3944 </ main >
4045 < Footer />
@@ -45,27 +50,7 @@ function AppShell() {
4550function App ( ) {
4651 return (
4752 < Router >
48- < div className = "flex flex-col min-h-screen" >
49- < Navbar />
50- < LocationBanner />
51- < main className = "flex-grow bg-gray-50" >
52- < Routes >
53- < Route path = "/" element = { < Home /> } />
54- < Route path = "/login" element = { < Login /> } />
55- < Route path = "/register" element = { < Register /> } />
56- < Route path = "/dashboard" element = { < Dashboard /> } />
57- < Route path = "/services" element = { < Services /> } />
58- < Route path = "/worker/:id" element = { < WorkerProfile /> } />
59- < Route path = "/profile" element = { < Profile /> } />
60- < Route path = "/bookings" element = { < Bookings /> } />
61- < Route path = "/worker-register" element = { < WorkerRegister /> } />
62- < Route path = "*" element = { < NotFound /> } />
63- { /* TODO: Add more routes here */ }
64- </ Routes >
65- </ main >
66- < Footer />
67- </ div >
68- < AppShell />
53+ < AppContent />
6954 </ Router >
7055 ) ;
7156}
0 commit comments