Fix bug in protected routing

This commit is contained in:
John Lyon-Smith
2018-03-02 14:52:18 -08:00
parent d347adcf33
commit 7756963eb2
3 changed files with 43 additions and 33 deletions

View File

@@ -1,7 +1,12 @@
import React from 'react'
import PropTypes from 'prop-types'
import { Row, Column, PanelButton } from 'ui'
export class Home extends React.Component {
static propTypes = {
history: PropTypes.object
}
render() {
return (
<Column>
@@ -10,7 +15,7 @@ export class Home extends React.Component {
<Row>
<Row.Item grow />
<Row.Item>
<PanelButton icon='users' text='Users' />
<PanelButton icon='users' text='Users' onClick={() => (this.props.history.replace('/users'))} />
</Row.Item>
<Row.Item width={30} />
<Row.Item>