app/src/Router.js (view raw)
1import React from 'react';
2import {BrowserRouter, Route, Switch} from 'react-router-dom';
3import useGTM from './hooks/useGTM';
4
5// Pages
6import Home from './pages/Home';
7import Event from './pages/Event';
8import NotFound from './pages/NotFound';
9import Dashboard from './pages/Dashboard';
10import Profile from './pages/Profile';
11import SignUp from './pages/SignUp';
12import SignIn from './pages/SignIn';
13import LostPassword from './pages/LostPassword.js';
14import ResetPassword from './pages/ResetPassword.js';
15
16const Router = () => {
17 useGTM();
18 return (
19 <BrowserRouter>
20 <Switch>
21 <Route path="/e/:eventId" component={Event} />
22 <Route path="/" exact component={Home} />
23 <Route path="/new" exact component={Home} />
24 <Route path="/register" exact component={SignUp} />
25 <Route path="/lost-password" exact component={LostPassword} />
26 <Route path="/reset-password" exact component={ResetPassword} />
27 <Route path="/login" exact component={SignIn} />
28 <Route path="/dashboard" exact component={Dashboard} />
29 <Route path="/profile" exact component={Profile} />
30 <Route component={NotFound} />
31 </Switch>
32 </BrowserRouter>
33 );
34};
35
36export default Router;