2018-09-12 02:32:37 +02:00
|
|
|
import SettingsTab from './settings-tab.component'
|
|
|
|
import { compose } from 'recompose'
|
|
|
|
import { connect } from 'react-redux'
|
|
|
|
import { withRouter } from 'react-router-dom'
|
|
|
|
import {
|
|
|
|
setCurrentCurrency,
|
|
|
|
setRpcTarget,
|
|
|
|
displayWarning,
|
|
|
|
revealSeedConfirmation,
|
|
|
|
setUseBlockie,
|
|
|
|
updateCurrentLocale,
|
|
|
|
setFeatureFlag,
|
|
|
|
showModal,
|
2018-10-26 10:26:43 +02:00
|
|
|
setUseNativeCurrencyAsPrimaryCurrencyPreference,
|
2018-09-12 02:32:37 +02:00
|
|
|
} from '../../../../actions'
|
2018-10-17 01:03:29 +02:00
|
|
|
import { preferencesSelector } from '../../../../selectors'
|
2018-09-12 02:32:37 +02:00
|
|
|
|
|
|
|
const mapStateToProps = state => {
|
|
|
|
const { appState: { warning }, metamask } = state
|
|
|
|
const {
|
|
|
|
currentCurrency,
|
|
|
|
conversionDate,
|
2018-10-26 10:26:43 +02:00
|
|
|
nativeCurrency,
|
2018-09-12 02:32:37 +02:00
|
|
|
useBlockie,
|
2018-10-10 20:52:26 +02:00
|
|
|
featureFlags: {
|
|
|
|
sendHexData,
|
|
|
|
privacyMode,
|
|
|
|
} = {},
|
2018-09-12 02:32:37 +02:00
|
|
|
provider = {},
|
|
|
|
isMascara,
|
|
|
|
currentLocale,
|
|
|
|
} = metamask
|
2018-10-26 10:26:43 +02:00
|
|
|
const { useNativeCurrencyAsPrimaryCurrency } = preferencesSelector(state)
|
2018-09-12 02:32:37 +02:00
|
|
|
|
|
|
|
return {
|
|
|
|
warning,
|
|
|
|
isMascara,
|
|
|
|
currentLocale,
|
|
|
|
currentCurrency,
|
|
|
|
conversionDate,
|
2018-10-26 10:26:43 +02:00
|
|
|
nativeCurrency,
|
2018-09-12 02:32:37 +02:00
|
|
|
useBlockie,
|
|
|
|
sendHexData,
|
2018-10-10 20:52:26 +02:00
|
|
|
privacyMode,
|
2018-09-12 02:32:37 +02:00
|
|
|
provider,
|
2018-10-26 10:26:43 +02:00
|
|
|
useNativeCurrencyAsPrimaryCurrency,
|
2018-09-12 02:32:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const mapDispatchToProps = dispatch => {
|
|
|
|
return {
|
|
|
|
setCurrentCurrency: currency => dispatch(setCurrentCurrency(currency)),
|
2018-10-26 10:26:43 +02:00
|
|
|
setRpcTarget: (newRpc, chainId, ticker, nickname) => dispatch(setRpcTarget(newRpc, chainId, ticker, nickname)),
|
2018-09-12 02:32:37 +02:00
|
|
|
displayWarning: warning => dispatch(displayWarning(warning)),
|
|
|
|
revealSeedConfirmation: () => dispatch(revealSeedConfirmation()),
|
|
|
|
setUseBlockie: value => dispatch(setUseBlockie(value)),
|
|
|
|
updateCurrentLocale: key => dispatch(updateCurrentLocale(key)),
|
|
|
|
setFeatureFlagToBeta: () => {
|
|
|
|
return dispatch(setFeatureFlag('betaUI', false, 'OLD_UI_NOTIFICATION_MODAL'))
|
|
|
|
},
|
|
|
|
setHexDataFeatureFlag: shouldShow => dispatch(setFeatureFlag('sendHexData', shouldShow)),
|
2018-10-10 20:52:26 +02:00
|
|
|
setPrivacyMode: enabled => dispatch(setFeatureFlag('privacyMode', enabled)),
|
2018-09-12 02:32:37 +02:00
|
|
|
showResetAccountConfirmationModal: () => dispatch(showModal({ name: 'CONFIRM_RESET_ACCOUNT' })),
|
2018-10-26 10:26:43 +02:00
|
|
|
setUseNativeCurrencyAsPrimaryCurrencyPreference: value => {
|
|
|
|
return dispatch(setUseNativeCurrencyAsPrimaryCurrencyPreference(value))
|
2018-10-17 01:03:29 +02:00
|
|
|
},
|
2018-09-27 20:19:09 +02:00
|
|
|
showClearApprovalModal: () => dispatch(showModal({ name: 'CLEAR_APPROVED_ORIGINS' })),
|
2018-09-12 02:32:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default compose(
|
|
|
|
withRouter,
|
|
|
|
connect(mapStateToProps, mapDispatchToProps)
|
|
|
|
)(SettingsTab)
|