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.
58 lines
1.5 KiB
58 lines
1.5 KiB
4 years ago
|
import { connect } from 'react-redux';
|
||
6 years ago
|
import {
|
||
|
setCurrentCurrency,
|
||
|
setUseBlockie,
|
||
|
updateCurrentLocale,
|
||
6 years ago
|
setUseNativeCurrencyAsPrimaryCurrencyPreference,
|
||
4 years ago
|
setHideZeroBalanceTokens,
|
||
6 years ago
|
setParticipateInMetaMetrics,
|
||
4 years ago
|
} from '../../../store/actions';
|
||
|
import { getPreferences } from '../../../selectors';
|
||
|
import SettingsTab from './settings-tab.component';
|
||
6 years ago
|
|
||
5 years ago
|
const mapStateToProps = (state) => {
|
||
4 years ago
|
const {
|
||
|
appState: { warning },
|
||
|
metamask,
|
||
4 years ago
|
} = state;
|
||
6 years ago
|
const {
|
||
|
currentCurrency,
|
||
|
conversionDate,
|
||
6 years ago
|
nativeCurrency,
|
||
6 years ago
|
useBlockie,
|
||
|
currentLocale,
|
||
4 years ago
|
} = metamask;
|
||
4 years ago
|
const {
|
||
|
useNativeCurrencyAsPrimaryCurrency,
|
||
|
hideZeroBalanceTokens,
|
||
|
} = getPreferences(state);
|
||
6 years ago
|
|
||
|
return {
|
||
|
warning,
|
||
|
currentLocale,
|
||
|
currentCurrency,
|
||
|
conversionDate,
|
||
6 years ago
|
nativeCurrency,
|
||
6 years ago
|
useBlockie,
|
||
6 years ago
|
useNativeCurrencyAsPrimaryCurrency,
|
||
4 years ago
|
hideZeroBalanceTokens,
|
||
4 years ago
|
};
|
||
|
};
|
||
6 years ago
|
|
||
5 years ago
|
const mapDispatchToProps = (dispatch) => {
|
||
6 years ago
|
return {
|
||
5 years ago
|
setCurrentCurrency: (currency) => dispatch(setCurrentCurrency(currency)),
|
||
|
setUseBlockie: (value) => dispatch(setUseBlockie(value)),
|
||
|
updateCurrentLocale: (key) => dispatch(updateCurrentLocale(key)),
|
||
|
setUseNativeCurrencyAsPrimaryCurrencyPreference: (value) => {
|
||
4 years ago
|
return dispatch(setUseNativeCurrencyAsPrimaryCurrencyPreference(value));
|
||
6 years ago
|
},
|
||
4 years ago
|
setParticipateInMetaMetrics: (val) =>
|
||
|
dispatch(setParticipateInMetaMetrics(val)),
|
||
4 years ago
|
setHideZeroBalanceTokens: (value) =>
|
||
|
dispatch(setHideZeroBalanceTokens(value)),
|
||
4 years ago
|
};
|
||
|
};
|
||
6 years ago
|
|
||
4 years ago
|
export default connect(mapStateToProps, mapDispatchToProps)(SettingsTab);
|