Added Header, Icon and MessageModal. Refactor screens into directories.

This commit is contained in:
John Lyon-Smith
2018-04-02 13:22:33 -07:00
parent aa622012cd
commit 410d2fde4f
56 changed files with 556 additions and 461 deletions

View File

@@ -20,14 +20,14 @@ export class DefaultRoute extends Component {
render() {
const user = api.loggedInUser
let redirect = null
let path = null
if (user) {
if (!user.pending) {
redirect = <Redirect to={user.administrator ? '/home' : '/profile'} />
path = user.administrator ? '/home' : '/profile'
}
} else {
redirect = <Redirect to='/login' />
path = '/login'
}
return (
@@ -37,7 +37,7 @@ export class DefaultRoute extends Component {
return (
<Fragment>
<Column.Item grow />
{redirect}
{path ? <Redirect to={path} /> : null}
</Fragment>
)
}}

View File

@@ -1,5 +1,5 @@
import React from 'react'
import { Route, Redirect } from 'react-router-dom'
import { Route, Redirect } from 'react-router'
import { PropTypes } from 'prop-types'
import { api } from 'src/API'
import autobind from 'autobind-decorator'