Adding some more controls & other clean-up

This commit is contained in:
John Lyon-Smith
2018-02-25 11:49:47 -08:00
parent 96fc7cb2c9
commit c60bfcedf8
44 changed files with 307 additions and 550 deletions

View File

@@ -1,35 +1,38 @@
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 { Home } from './Home'
import { Profile } from './Profile'
import { Users } from './Users'
import { Footer } from './Footer'
import { HolyGrail } from './ui'
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'
import logoImage from 'images/logo.png'
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>
<HolyGrail>
<HolyGrail.Header>
<img src={logoImage} style={{ width: '50px', height: '50px', margin: '5px' }} />
</HolyGrail.Header>
<HolyGrail.Body>
<Router basename='/'>
<Switch>
<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='/' component={Home} />
<ProtectedRoute roles={['administrator']} path='/users' component={Users} />
<Route component={Home} />{/* No Match Route */}
</Switch>
</Router>
</HolyGrail.Body>
<HolyGrail.Footer>
<div style={{ margin: '10px' }}>v1.0.0. Copyright &copy; 2018, Deighton.</div>
</HolyGrail.Footer>
</HolyGrail>
)
}
}