1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 11:28:51 +01:00
metamask-extension/ui/pages/settings/settings-tab/settings-tab.container.js
igorms-cons 6dbf6e3ab3
Latest update conversion date - issue #10741 (#12422)
* conversion date fix

* update in settings conversion date - no internet

* update conversionDate fetch - setting container

* no currency date message updated
2021-12-02 08:48:09 -03:30

59 lines
1.6 KiB
JavaScript

import { connect } from 'react-redux';
import {
setCurrentCurrency,
setUseBlockie,
updateCurrentLocale,
setUseNativeCurrencyAsPrimaryCurrencyPreference,
setHideZeroBalanceTokens,
setParticipateInMetaMetrics,
} from '../../../store/actions';
import { getPreferences } from '../../../selectors';
import SettingsTab from './settings-tab.component';
const mapStateToProps = (state, ownProps) => {
const {
appState: { warning },
metamask,
} = state;
const {
currentCurrency,
nativeCurrency,
useBlockie,
currentLocale,
} = metamask;
const {
useNativeCurrencyAsPrimaryCurrency,
hideZeroBalanceTokens,
} = getPreferences(state);
const { lastFetchedConversionDate } = ownProps;
return {
warning,
currentLocale,
currentCurrency,
nativeCurrency,
useBlockie,
useNativeCurrencyAsPrimaryCurrency,
hideZeroBalanceTokens,
lastFetchedConversionDate,
};
};
const mapDispatchToProps = (dispatch) => {
return {
setCurrentCurrency: (currency) => dispatch(setCurrentCurrency(currency)),
setUseBlockie: (value) => dispatch(setUseBlockie(value)),
updateCurrentLocale: (key) => dispatch(updateCurrentLocale(key)),
setUseNativeCurrencyAsPrimaryCurrencyPreference: (value) => {
return dispatch(setUseNativeCurrencyAsPrimaryCurrencyPreference(value));
},
setParticipateInMetaMetrics: (val) =>
dispatch(setParticipateInMetaMetrics(val)),
setHideZeroBalanceTokens: (value) =>
dispatch(setHideZeroBalanceTokens(value)),
};
};
export default connect(mapStateToProps, mapDispatchToProps)(SettingsTab);