File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,18 @@ import React from 'react';
33import Login from 'pages/Login' ;
44import PatientDirectory from 'pages/PatientDirectory' ;
55import 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' ;
89import PublicRoute from './PublicRoute' ;
910import urls from './urls' ;
1011
1112const 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
You can’t perform that action at this time.
0 commit comments