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 SignUpSuccess from './pages/SignUpSuccess';
13import NotConfirmed from './pages/SignUpSuccess';
14import SignIn from './pages/SignIn';
15import LostPassword from './pages/LostPassword.js';
16import ResetPassword from './pages/ResetPassword.js';
17
18const Router = () => {
19 useGTM();
20 return (
21 <BrowserRouter>
22 <Switch>
23 <Route path="/e/:eventId" component={Event} />
24 <Route path="/" exact component={Home} />
25 <Route path="/new" exact component={Home} />
26 <Route path="/register/success" exact component={SignUpSuccess} />
27 <Route path="/register" exact component={SignUp} />
28 <Route path="/lost-password" exact component={LostPassword} />
29 <Route path="/reset-password" exact component={ResetPassword} />
30 <Route path="/login" exact component={SignIn} />
31 <Route path="/dashboard" exact component={Dashboard} />
32 <Route path="/confirm" exact component={NotConfirmed} />
33 <Route path="/profile" exact component={Profile} />
34 <Route component={NotFound} />
35 </Switch>
36 </BrowserRouter>
37 );
38};
39
40export default Router;