-
-
Save Mozartted/71aefe5636f6e84cea7c618dfae24366 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import scenes here and make routes of them | |
import React from 'react'; | |
import {Route} from 'react-router-dom'; | |
// import scenes here | |
import {Dashboard, Settings, Login} from './Scenes' | |
// auth checkers for checking if the routes are authorized | |
import AppCheck from './Modules/AppCheck.jsx'; | |
import EnsureLoggedInContainer from './Modules/EnsureLoggedInContainer.jsx'; | |
import EnsureVisitorOnlyContainer from './Modules/EnsureVisitorOnlyContainer.jsx'; | |
const routes = ( | |
<React.Fragment> | |
<AppCheck> | |
<EnsureVisitorOnlyContainer> | |
<Route path="/login" component={Login} /> | |
</EnsureVisitorOnlyContainer> | |
<EnsureLoggedInContainer> | |
<Route exact path="/home" component={Dashboard} /> | |
<Route path="/settings" component={Settings} /> | |
</EnsureLoggedInContainer> | |
</AppCheck> | |
</React.Fragment> | |
); | |
export default routes; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment