52 lines
2.0 KiB
JavaScript
52 lines
2.0 KiB
JavaScript
import React from 'react'
|
|
import { Login, Logout, ResetPassword, ForgotPassword, ConfirmEmail, ProtectedRoute } from './Auth'
|
|
import { Home } from './Home'
|
|
import { Profile } from './Profile'
|
|
import { Users } from './Users'
|
|
import { Column, Row, Image, Text, Icon, Box } from './ui'
|
|
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'
|
|
import logoImage from 'images/logo.png'
|
|
import { versionInfo } from './version'
|
|
|
|
export class App extends React.Component {
|
|
render() {
|
|
return (
|
|
<Column minHeight='100vh'>
|
|
<Column.Item>
|
|
<Box color='#FAFAFA' borderBottom='1px solid #B2B2B2'>
|
|
<Row minWidth='100vw'>
|
|
<Row.Item>
|
|
<Image source={logoImage} width={50} height={50} margin={5} />
|
|
</Row.Item>
|
|
<Row.Item grow> </Row.Item>
|
|
<Row.Item>
|
|
<Icon name='logout' />
|
|
</Row.Item>
|
|
</Row>
|
|
</Box>
|
|
</Column.Item>
|
|
<Column.Item grow>
|
|
<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>
|
|
</Column.Item>
|
|
<Column.Item>
|
|
<Box color='#FAFAFA' borderTop='1px solid #B2B2B2'>
|
|
<Text tone='dimmed' margin={10}>{versionInfo.fullVersion} © 2018, Kingston Software Solutions.</Text>
|
|
</Box>
|
|
</Column.Item>
|
|
</Column>
|
|
)
|
|
}
|
|
}
|