Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/routes.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import React from 'react';
import { Switch, BrowserRouter } from 'react-router-dom';

import { getMode } from 'services/api';

import Route from 'components/Route';

import { useAuth } from 'contexts/auth';

import Recovery from 'pages/Recovery';
import UserUpdate from 'pages/UserUpdate';
import LandingPage from 'pages/LandingPage';
import ResetPassword from 'pages/ResetPassword';
import Register from 'pages/Register';
import Home from 'pages/Home';
Expand All @@ -20,14 +17,13 @@ import NotFound from 'pages/NotFound';
import Users from 'pages/Users';

export default function Routes() {
const isNotProduction = getMode();
const { user } = useAuth();
const userIsAdmin = user?.type === 'Admin';

return (
<BrowserRouter>
<Switch>
{isNotProduction && <Route path="/" exact component={LandingPage} />}
<Route path="/" exact component={Login} />
<Route path="/user/update" isPrivate component={UserUpdate} />
<Route path="/home" exact isPrivate component={Home} />
<Route path="/minute" isPrivate component={Minute} />
Expand Down