2018-09-12 02:32:37 +02:00
|
|
|
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-26 08:11:58 +02:00
|
|
|
import { getPreferences } from '../../../selectors'
|
2020-08-18 21:18:25 +02:00
|
|
|
import SettingsTab from './settings-tab.component'
|
2018-09-12 02:32:37 +02:00
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const mapStateToProps = (state) => {
|
2020-11-03 00:41:28 +01:00
|
|
|
const {
|
|
|
|
appState: { warning },
|
|
|
|
metamask,
|
|
|
|
} = state
|
2018-09-12 02:32:37 +02:00
|
|
|
const {
|
|
|
|
currentCurrency,
|
|
|
|
conversionDate,
|
2018-10-26 10:26:43 +02:00
|
|
|
nativeCurrency,
|
2018-09-12 02:32:37 +02:00
|
|
|
useBlockie,
|
|
|
|
currentLocale,
|
|
|
|
} = metamask
|
2020-05-26 08:11:58 +02:00
|
|
|
const { useNativeCurrencyAsPrimaryCurrency } = getPreferences(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
|
|
|
},
|
2020-11-03 00:41:28 +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)
|