Skip to content

Commit 1d0437a

Browse files
author
whosyourtaco
committed
feat: add correct routes
1 parent 84452d2 commit 1d0437a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/routing/Routes.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@ import React from 'react';
33
import Login from 'pages/Login';
44
import PatientDirectory from 'pages/PatientDirectory';
55
import RegisterPatient from 'pages/RegisterPatient';
6-
import { Switch } from 'react-router-dom';
6+
import { Redirect, Switch } from 'react-router-dom';
77

8+
import PrivateRoute from './PrivateRoute';
89
import PublicRoute from './PublicRoute';
910
import urls from './urls';
1011

1112
const Routes: React.FC = () => (
1213
<Switch>
1314
<PublicRoute exact path={urls.login()} component={Login} />
14-
<PublicRoute exact path={urls.register()} component={RegisterPatient} />
15-
<PublicRoute exact path={[urls.patients(), '/']} component={PatientDirectory} />
15+
<PrivateRoute exact path={urls.register()} component={RegisterPatient} />
16+
<PrivateRoute exact path={[urls.patients()]} component={PatientDirectory} />
17+
<Redirect to={urls.patients()} />
1618
</Switch>
1719
);
1820

0 commit comments

Comments
 (0)