mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
* updating controllers with conversionRate change with minimal required changes in extension * swapping showFiat selector in places where possible * adding invalid conversion protection * lint fixes * adjusting list-item styling logic
29 lines
732 B
JavaScript
29 lines
732 B
JavaScript
import { connect } from 'react-redux';
|
|
import PropTypes from 'prop-types';
|
|
import { getTokenExchangeRates, getShouldShowFiat } from '../../../selectors';
|
|
import TokenInput from './token-input.component';
|
|
|
|
const mapStateToProps = (state) => {
|
|
const {
|
|
metamask: { currentCurrency },
|
|
} = state;
|
|
|
|
return {
|
|
currentCurrency,
|
|
tokenExchangeRates: getTokenExchangeRates(state),
|
|
hideConversion: !getShouldShowFiat(state),
|
|
};
|
|
};
|
|
|
|
const TokenInputContainer = connect(mapStateToProps)(TokenInput);
|
|
|
|
TokenInputContainer.propTypes = {
|
|
token: PropTypes.shape({
|
|
address: PropTypes.string.isRequired,
|
|
decimals: PropTypes.number,
|
|
symbol: PropTypes.string,
|
|
}).isRequired,
|
|
};
|
|
|
|
export default TokenInputContainer;
|