2020-02-24 23:58:26 +01:00
|
|
|
import { compose } from 'redux'
|
2019-01-23 16:25:34 +01:00
|
|
|
import { connect } from 'react-redux'
|
|
|
|
import { withRouter } from 'react-router-dom'
|
2019-03-22 00:03:30 +01:00
|
|
|
import { lockMetamask } from '../../store/actions'
|
2020-08-18 21:18:25 +02:00
|
|
|
import Lock from './lock.component'
|
2019-01-23 16:25:34 +01:00
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const mapStateToProps = (state) => {
|
2020-11-03 00:41:28 +01:00
|
|
|
const {
|
|
|
|
metamask: { isUnlocked },
|
|
|
|
} = state
|
2019-01-23 16:25:34 +01:00
|
|
|
|
|
|
|
return {
|
|
|
|
isUnlocked,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const mapDispatchToProps = (dispatch) => {
|
2019-01-23 16:25:34 +01:00
|
|
|
return {
|
|
|
|
lockMetamask: () => dispatch(lockMetamask()),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default compose(
|
|
|
|
withRouter,
|
2020-07-14 17:20:41 +02:00
|
|
|
connect(mapStateToProps, mapDispatchToProps),
|
2019-01-23 16:25:34 +01:00
|
|
|
)(Lock)
|