aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pages/unlock-page/unlock-page.container.js
blob: 9788a18ea5a11a33ed7e28ae037e3862e68cf8ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
import { compose } from 'recompose'

const {
  tryUnlockMetamask,
  forgotPassword,
  markPasswordForgotten,
  setNetworkEndpoints,
} = require('../../../actions')

import UnlockPage from './unlock-page.component'

const mapStateToProps = state => {
  const { metamask: { isUnlocked } } = state
  return {
    isUnlocked,
  }
}

const mapDispatchToProps = dispatch => {
  return {
    forgotPassword: () => dispatch(forgotPassword()),
    tryUnlockMetamask: password => dispatch(tryUnlockMetamask(password)),
    markPasswordForgotten: () => dispatch(markPasswordForgotten()),
    setNetworkEndpoints: type => dispatch(setNetworkEndpoints(type)),
  }
}

export default compose(
  withRouter,
  connect(mapStateToProps, mapDispatchToProps)
)(UnlockPage)