SHARE
TWEET

Untitled

a guest Jun 16th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Routes = () => {
  2.   return (
  3.     <BrowserRouter>
  4.       <div>
  5.         <Route path="/" component={Navbar} />
  6.         <Switch>
  7.           <Route exact path="/" component={Main} />
  8.           <Route path="/signin" component={SignIn} />
  9.           <Route path="/signup" component={SignUp} />
  10.           <PrivateRoute path="/dashboard" component={DashboardRoutes} />
  11.           <Route path="*" component={() => <h1>Page not found</h1>} />
  12.         </Switch>
  13.       </div>
  14.       <div>
  15.         <Route path="/" component={Footer} />
  16.       </div>
  17.     </BrowserRouter>
  18.   );
  19. };
  20.      
  21. const Routes = () => {
  22.   return (
  23.     <BrowserRouter>
  24.       <div>
  25.         {!isAuthenticated() && <Route path="/" component={Navbar} />}
  26.         <Switch>
  27.           <Route exact path="/" component={Main} />
  28.           <Route path="/signin" component={SignIn} />
  29.           <Route path="/signup" component={SignUp} />
  30.           <PrivateRoute path="/dashboard" component={DashboardRoutes} />
  31.           <Route path="*" component={() => <h1>Page not found</h1>} />
  32.         </Switch>
  33.       </div>
  34.       <div>
  35.         <Route path="/" component={Footer} />
  36.       </div>
  37.     </BrowserRouter>
  38.   );
  39. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top