2021-02-04 19:15:23 +01:00
|
|
|
import { connect } from 'react-redux';
|
2020-11-03 00:41:28 +01:00
|
|
|
import {
|
|
|
|
displayWarning,
|
|
|
|
requestRevealSeedWords,
|
|
|
|
fetchInfoToSync,
|
|
|
|
exportAccounts,
|
2021-08-13 21:59:06 +02:00
|
|
|
hideWarning,
|
2021-02-04 19:15:23 +01:00
|
|
|
} from '../../store/actions';
|
|
|
|
import { getMostRecentOverviewPage } from '../../ducks/history/history';
|
|
|
|
import { getMetaMaskKeyrings } from '../../selectors';
|
|
|
|
import MobileSyncPage from './mobile-sync.component';
|
2019-11-24 18:16:25 +01:00
|
|
|
|
|
|
|
const mapDispatchToProps = (dispatch) => {
|
|
|
|
return {
|
2020-11-03 00:41:28 +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-11-03 00:41:28 +01:00
|
|
|
exportAccounts: (password, addresses) =>
|
|
|
|
dispatch(exportAccounts(password, addresses)),
|
2021-08-13 21:59:06 +02:00
|
|
|
hideWarning: () => dispatch(hideWarning()),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
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 {
|
2020-11-03 00:41:28 +01:00
|
|
|
metamask: { selectedAddress },
|
2021-02-04 19:15:23 +01:00
|
|
|
} = state;
|
2019-11-24 18:16:25 +01:00
|
|
|
|
|
|
|
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),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2019-11-24 18:16:25 +01:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(MobileSyncPage);
|