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.
82 lines
2.7 KiB
82 lines
2.7 KiB
6 years ago
|
import SettingsTab from './settings-tab.component'
|
||
|
import { compose } from 'recompose'
|
||
|
import { connect } from 'react-redux'
|
||
|
import { withRouter } from 'react-router-dom'
|
||
|
import {
|
||
|
setCurrentCurrency,
|
||
6 years ago
|
updateAndSetCustomRpc,
|
||
6 years ago
|
displayWarning,
|
||
|
revealSeedConfirmation,
|
||
|
setUseBlockie,
|
||
|
updateCurrentLocale,
|
||
|
setFeatureFlag,
|
||
|
showModal,
|
||
6 years ago
|
setUseNativeCurrencyAsPrimaryCurrencyPreference,
|
||
6 years ago
|
setShowFiatConversionOnTestnetsPreference,
|
||
6 years ago
|
setParticipateInMetaMetrics,
|
||
6 years ago
|
} from '../../../store/actions'
|
||
|
import { preferencesSelector } from '../../../selectors/selectors'
|
||
6 years ago
|
|
||
|
const mapStateToProps = state => {
|
||
|
const { appState: { warning }, metamask } = state
|
||
|
const {
|
||
|
currentCurrency,
|
||
|
conversionDate,
|
||
6 years ago
|
nativeCurrency,
|
||
6 years ago
|
useBlockie,
|
||
6 years ago
|
featureFlags: {
|
||
|
sendHexData,
|
||
|
privacyMode,
|
||
6 years ago
|
advancedInlineGas,
|
||
6 years ago
|
} = {},
|
||
6 years ago
|
provider = {},
|
||
|
currentLocale,
|
||
6 years ago
|
participateInMetaMetrics,
|
||
6 years ago
|
} = metamask
|
||
6 years ago
|
const { useNativeCurrencyAsPrimaryCurrency, showFiatInTestnets } = preferencesSelector(state)
|
||
6 years ago
|
|
||
|
return {
|
||
|
warning,
|
||
|
currentLocale,
|
||
|
currentCurrency,
|
||
|
conversionDate,
|
||
6 years ago
|
nativeCurrency,
|
||
6 years ago
|
useBlockie,
|
||
|
sendHexData,
|
||
6 years ago
|
advancedInlineGas,
|
||
6 years ago
|
privacyMode,
|
||
6 years ago
|
provider,
|
||
6 years ago
|
useNativeCurrencyAsPrimaryCurrency,
|
||
6 years ago
|
showFiatInTestnets,
|
||
6 years ago
|
participateInMetaMetrics,
|
||
6 years ago
|
}
|
||
|
}
|
||
|
|
||
|
const mapDispatchToProps = dispatch => {
|
||
|
return {
|
||
|
setCurrentCurrency: currency => dispatch(setCurrentCurrency(currency)),
|
||
6 years ago
|
setRpcTarget: (newRpc, chainId, ticker, nickname) => dispatch(updateAndSetCustomRpc(newRpc, chainId, ticker, nickname)),
|
||
6 years ago
|
displayWarning: warning => dispatch(displayWarning(warning)),
|
||
|
revealSeedConfirmation: () => dispatch(revealSeedConfirmation()),
|
||
|
setUseBlockie: value => dispatch(setUseBlockie(value)),
|
||
|
updateCurrentLocale: key => dispatch(updateCurrentLocale(key)),
|
||
|
setHexDataFeatureFlag: shouldShow => dispatch(setFeatureFlag('sendHexData', shouldShow)),
|
||
6 years ago
|
setAdvancedInlineGasFeatureFlag: shouldShow => dispatch(setFeatureFlag('advancedInlineGas', shouldShow)),
|
||
6 years ago
|
setPrivacyMode: enabled => dispatch(setFeatureFlag('privacyMode', enabled)),
|
||
6 years ago
|
showResetAccountConfirmationModal: () => dispatch(showModal({ name: 'CONFIRM_RESET_ACCOUNT' })),
|
||
6 years ago
|
setUseNativeCurrencyAsPrimaryCurrencyPreference: value => {
|
||
|
return dispatch(setUseNativeCurrencyAsPrimaryCurrencyPreference(value))
|
||
6 years ago
|
},
|
||
6 years ago
|
setShowFiatConversionOnTestnetsPreference: value => {
|
||
|
return dispatch(setShowFiatConversionOnTestnetsPreference(value))
|
||
|
},
|
||
6 years ago
|
showClearApprovalModal: () => dispatch(showModal({ name: 'CLEAR_APPROVED_ORIGINS' })),
|
||
6 years ago
|
setParticipateInMetaMetrics: (val) => dispatch(setParticipateInMetaMetrics(val)),
|
||
6 years ago
|
}
|
||
|
}
|
||
|
|
||
|
export default compose(
|
||
|
withRouter,
|
||
|
connect(mapStateToProps, mapDispatchToProps)
|
||
|
)(SettingsTab)
|