Initial commit
This commit is contained in:
35
website/src/App.js
Normal file
35
website/src/App.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import React from 'react'
|
||||
import './App.scss'
|
||||
import { NavBar } from './Navigation'
|
||||
import { Home } from './Home'
|
||||
import { Login, Logout, ResetPassword, ForgotPassword, ConfirmEmail, ProtectedRoute } from './Auth'
|
||||
import { Dashboard } from './Dashboard'
|
||||
import { Profile } from './Profile'
|
||||
import { Users } from './Users'
|
||||
import { Footer } from './Footer'
|
||||
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'
|
||||
|
||||
export class App extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<Router basename='/'>
|
||||
<div className='App'>
|
||||
<NavBar />
|
||||
<Switch>
|
||||
<Route exact path='/' component={Home} />
|
||||
<Route path='/login' component={Login} />
|
||||
<Route path='/confirm-email' component={ConfirmEmail} />
|
||||
<Route path='/reset-password' component={ResetPassword} />
|
||||
<Route path='/forgot-password' component={ForgotPassword} />
|
||||
<ProtectedRoute path='/logout' component={Logout} />
|
||||
<ProtectedRoute path='/profile' component={Profile} />
|
||||
<ProtectedRoute roles={['administrator', 'normal']} path='/dashboard' component={Dashboard} />
|
||||
<ProtectedRoute roles={['administrator']} path='/users' component={Users} />
|
||||
<Route component={Home} />{/* No Match Route */}
|
||||
</Switch>
|
||||
<Footer />
|
||||
</div>
|
||||
</Router>
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user