diff options
Diffstat (limited to 'ui/app/components/pages/lock')
-rw-r--r-- | ui/app/components/pages/lock/index.js | 1 | ||||
-rw-r--r-- | ui/app/components/pages/lock/lock.component.js | 26 | ||||
-rw-r--r-- | ui/app/components/pages/lock/lock.container.js | 24 |
3 files changed, 0 insertions, 51 deletions
diff --git a/ui/app/components/pages/lock/index.js b/ui/app/components/pages/lock/index.js deleted file mode 100644 index 7bfe2a61f..000000000 --- a/ui/app/components/pages/lock/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './lock.container' diff --git a/ui/app/components/pages/lock/lock.component.js b/ui/app/components/pages/lock/lock.component.js deleted file mode 100644 index 51f8742ed..000000000 --- a/ui/app/components/pages/lock/lock.component.js +++ /dev/null @@ -1,26 +0,0 @@ -import React, { PureComponent } from 'react' -import PropTypes from 'prop-types' -import Loading from '../../loading-screen' -import { DEFAULT_ROUTE } from '../../../routes' - -export default class Lock extends PureComponent { - static propTypes = { - history: PropTypes.object, - isUnlocked: PropTypes.bool, - lockMetamask: PropTypes.func, - } - - componentDidMount () { - const { lockMetamask, isUnlocked, history } = this.props - - if (isUnlocked) { - lockMetamask().then(() => history.push(DEFAULT_ROUTE)) - } else { - history.replace(DEFAULT_ROUTE) - } - } - - render () { - return <Loading /> - } -} diff --git a/ui/app/components/pages/lock/lock.container.js b/ui/app/components/pages/lock/lock.container.js deleted file mode 100644 index 81d89ba21..000000000 --- a/ui/app/components/pages/lock/lock.container.js +++ /dev/null @@ -1,24 +0,0 @@ -import Lock from './lock.component' -import { compose } from 'recompose' -import { connect } from 'react-redux' -import { withRouter } from 'react-router-dom' -import { lockMetamask } from '../../../actions' - -const mapStateToProps = state => { - const { metamask: { isUnlocked } } = state - - return { - isUnlocked, - } -} - -const mapDispatchToProps = dispatch => { - return { - lockMetamask: () => dispatch(lockMetamask()), - } -} - -export default compose( - withRouter, - connect(mapStateToProps, mapDispatchToProps) -)(Lock) |