Added Header, Icon and MessageModal. Refactor screens into directories.
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}}
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user