Added Header, Icon and MessageModal. Refactor screens into directories.
This commit is contained in:
21
mobile/src/Auth/Logout.js
Normal file
21
mobile/src/Auth/Logout.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import React, { Component } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { api } from '../API'
|
||||
|
||||
export class Logout extends Component {
|
||||
static propTypes = {
|
||||
history: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
|
||||
}
|
||||
|
||||
componentDidMount(event) {
|
||||
const cb = () => {
|
||||
this.props.history.replace('/login')
|
||||
}
|
||||
|
||||
api.logout().then(cb, cb)
|
||||
}
|
||||
|
||||
render() {
|
||||
return null
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user