2019-11-24 18:16:25 +01:00
|
|
|
import { connect } from 'react-redux'
|
2020-06-26 03:04:17 +02:00
|
|
|
import { displayWarning, requestRevealSeedWords, fetchInfoToSync, exportAccounts } from '../../store/actions'
|
2020-06-01 19:54:32 +02:00
|
|
|
import { getMostRecentOverviewPage } from '../../ducks/history/history'
|
2020-06-26 03:04:17 +02:00
|
|
|
import { getMetaMaskKeyrings } from '../../selectors'
|
2020-08-18 21:18:25 +02:00
|
|
|
import MobileSyncPage from './mobile-sync.component'
|
2019-11-24 18:16:25 +01:00
|
|
|
|
|
|
|
const mapDispatchToProps = (dispatch) => {
|
|
|
|
return {
|
2020-02-15 21:34:12 +01:00
|
|
|
requestRevealSeedWords: (password) => dispatch(requestRevealSeedWords(password)),
|
2019-11-24 18:16:25 +01:00
|
|
|
fetchInfoToSync: () => dispatch(fetchInfoToSync()),
|
|
|
|
displayWarning: (message) => dispatch(displayWarning(message || null)),
|
2020-06-26 03:04:17 +02:00
|
|
|
exportAccounts: (password, addresses) => dispatch(exportAccounts(password, addresses)),
|
2019-11-24 18:16:25 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const mapStateToProps = (state) => {
|
2019-11-24 18:16:25 +01:00
|
|
|
const {
|
|
|
|
metamask: {
|
|
|
|
selectedAddress,
|
|
|
|
},
|
|
|
|
} = state
|
|
|
|
|
|
|
|
return {
|
2020-06-25 00:34:39 +02:00
|
|
|
mostRecentOverviewPage: getMostRecentOverviewPage(state),
|
2019-11-24 18:16:25 +01:00
|
|
|
selectedAddress,
|
2020-06-26 03:04:17 +02:00
|
|
|
keyrings: getMetaMaskKeyrings(state),
|
2019-11-24 18:16:25 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-09 04:34:58 +01:00
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(MobileSyncPage)
|