add page for not found

This commit is contained in:
Michael Fatemi 2021-08-11 21:02:35 -04:00
parent f0c4dd3c40
commit 938be95243
2 changed files with 27 additions and 17 deletions
src/components

View File

@ -9,6 +9,7 @@ import {
popLoginContinueURL, popLoginContinueURL,
setLoginContinueURL, setLoginContinueURL,
} from './loginContinueUrl'; } from './loginContinueUrl';
import NotFound from './NotFound';
import WheelShare from './WheelShare'; import WheelShare from './WheelShare';
import WheelShareLoggedOut from './WheelShareLoggedOut'; import WheelShareLoggedOut from './WheelShareLoggedOut';
@ -54,11 +55,11 @@ export default function App() {
> >
<div style={style}> <div style={style}>
<Suspense fallback={null}> <Suspense fallback={null}>
<BrowserRouter>
<Switch>
{user ? ( {user ? (
<NotificationsProvider> <NotificationsProvider>
<Header /> <Header />
<BrowserRouter>
<Switch>
<Route path="/" exact component={WheelShare} /> <Route path="/" exact component={WheelShare} />
<Route <Route
path="/join/:code" path="/join/:code"
@ -67,18 +68,19 @@ export default function App() {
<Route path="/carpools/:id" component={CarpoolPage} /> <Route path="/carpools/:id" component={CarpoolPage} />
<Route path="/events/:id" component={EventPage} /> <Route path="/events/:id" component={EventPage} />
<Route path="/groups/:id" component={GroupPage} /> <Route path="/groups/:id" component={GroupPage} />
<Route path="/:url" component={NotFound} />
</Switch>
</BrowserRouter>
</NotificationsProvider> </NotificationsProvider>
) : ( ) : (
<> <BrowserRouter>
<WheelShareLoggedOut /> <WheelShareLoggedOut />
<Route <Route
component={Authenticator} component={Authenticator}
path="/auth/:provider/callback" path="/auth/:provider/callback"
/> />
</>
)}
</Switch>
</BrowserRouter> </BrowserRouter>
)}
</Suspense> </Suspense>
</div> </div>
<Footer /> <Footer />

View File

@ -0,0 +1,8 @@
export default function NotFound() {
return (
<div>
<h1>Not Found</h1>
<p>The page you're looking for does not exist.</p>
</div>
);
}