You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.1 KiB
68 lines
2.1 KiB
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,
|
|
setUseNativeCurrencyAsPrimaryCurrencyPreference,
|
|
} from '../../../../actions'
|
|
import { preferencesSelector } from '../../../../selectors'
|
|
|
|
const mapStateToProps = state => {
|
|
const { appState: { warning }, metamask } = state
|
|
const {
|
|
currentCurrency,
|
|
conversionDate,
|
|
nativeCurrency,
|
|
useBlockie,
|
|
featureFlags: { sendHexData } = {},
|
|
provider = {},
|
|
isMascara,
|
|
currentLocale,
|
|
} = metamask
|
|
const { useNativeCurrencyAsPrimaryCurrency } = preferencesSelector(state)
|
|
|
|
return {
|
|
warning,
|
|
isMascara,
|
|
currentLocale,
|
|
currentCurrency,
|
|
conversionDate,
|
|
nativeCurrency,
|
|
useBlockie,
|
|
sendHexData,
|
|
provider,
|
|
useNativeCurrencyAsPrimaryCurrency,
|
|
}
|
|
}
|
|
|
|
const mapDispatchToProps = dispatch => {
|
|
return {
|
|
setCurrentCurrency: currency => dispatch(setCurrentCurrency(currency)),
|
|
setRpcTarget: (newRpc, chainId, ticker, nickname) => dispatch(setRpcTarget(newRpc, chainId, ticker, nickname)),
|
|
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)),
|
|
showResetAccountConfirmationModal: () => dispatch(showModal({ name: 'CONFIRM_RESET_ACCOUNT' })),
|
|
setUseNativeCurrencyAsPrimaryCurrencyPreference: value => {
|
|
return dispatch(setUseNativeCurrencyAsPrimaryCurrencyPreference(value))
|
|
},
|
|
}
|
|
}
|
|
|
|
export default compose(
|
|
withRouter,
|
|
connect(mapStateToProps, mapDispatchToProps)
|
|
)(SettingsTab)
|
|
|