2018-09-12 02:32:37 +02:00
|
|
|
import SettingsTab from './settings-tab.component'
|
|
|
|
import { connect } from 'react-redux'
|
|
|
|
import {
|
|
|
|
setCurrentCurrency,
|
|
|
|
setUseBlockie,
|
|
|
|
updateCurrentLocale,
|
2018-10-26 10:26:43 +02:00
|
|
|
setUseNativeCurrencyAsPrimaryCurrencyPreference,
|
2019-03-05 16:45:01 +01:00
|
|
|
setParticipateInMetaMetrics,
|
2019-03-22 00:03:30 +01:00
|
|
|
} from '../../../store/actions'
|
2020-05-02 21:41:17 +02:00
|
|
|
import { preferencesSelector } from '../../../selectors'
|
2018-09-12 02:32:37 +02:00
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const mapStateToProps = (state) => {
|
2018-09-12 02:32:37 +02:00
|
|
|
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,
|
|
|
|
currentLocale,
|
|
|
|
} = metamask
|
2019-03-25 17:13:23 +01:00
|
|
|
const { useNativeCurrencyAsPrimaryCurrency } = preferencesSelector(state)
|
2018-09-12 02:32:37 +02:00
|
|
|
|
|
|
|
return {
|
|
|
|
warning,
|
|
|
|
currentLocale,
|
|
|
|
currentCurrency,
|
|
|
|
conversionDate,
|
2018-10-26 10:26:43 +02:00
|
|
|
nativeCurrency,
|
2018-09-12 02:32:37 +02:00
|
|
|
useBlockie,
|
2018-10-26 10:26:43 +02:00
|
|
|
useNativeCurrencyAsPrimaryCurrency,
|
2018-09-12 02:32:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const mapDispatchToProps = (dispatch) => {
|
2018-09-12 02:32:37 +02:00
|
|
|
return {
|
2020-02-15 21:34:12 +01:00
|
|
|
setCurrentCurrency: (currency) => dispatch(setCurrentCurrency(currency)),
|
|
|
|
setUseBlockie: (value) => dispatch(setUseBlockie(value)),
|
|
|
|
updateCurrentLocale: (key) => dispatch(updateCurrentLocale(key)),
|
|
|
|
setUseNativeCurrencyAsPrimaryCurrencyPreference: (value) => {
|
2018-10-26 10:26:43 +02:00
|
|
|
return dispatch(setUseNativeCurrencyAsPrimaryCurrencyPreference(value))
|
2018-10-17 01:03:29 +02:00
|
|
|
},
|
2019-03-05 16:45:01 +01:00
|
|
|
setParticipateInMetaMetrics: (val) => dispatch(setParticipateInMetaMetrics(val)),
|
2018-09-12 02:32:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-24 20:12:49 +01:00
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(SettingsTab)
|