2021-02-04 19:15:23 +01:00
|
|
|
import { compose } from 'redux';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { withRouter } from 'react-router-dom';
|
|
|
|
import { lockMetamask } from '../../store/actions';
|
|
|
|
import Lock from './lock.component';
|
2020-11-09 14:50:24 +01:00
|
|
|
|
|
|
|
const mapStateToProps = (state) => {
|
|
|
|
const {
|
|
|
|
metamask: { isUnlocked },
|
2021-02-04 19:15:23 +01:00
|
|
|
} = state;
|
2020-11-09 14:50:24 +01:00
|
|
|
|
|
|
|
return {
|
|
|
|
isUnlocked,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2020-11-09 14:50:24 +01:00
|
|
|
|
|
|
|
const mapDispatchToProps = (dispatch) => {
|
|
|
|
return {
|
|
|
|
lockMetamask: () => dispatch(lockMetamask()),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2020-11-09 14:50:24 +01:00
|
|
|
|
|
|
|
export default compose(
|
|
|
|
withRouter,
|
|
|
|
connect(mapStateToProps, mapDispatchToProps),
|
2021-02-04 19:15:23 +01:00
|
|
|
)(Lock);
|