Skip to content

Commit

Permalink
Merge pull request #13476 from daraksha-dk/currency-picker-button
Browse files Browse the repository at this point in the history
Add tooltip for currency picker button
  • Loading branch information
dangrous authored Dec 9, 2022
2 parents 5ab92f5 + e1ea2d5 commit a75a01e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/components/CurrencySymbolButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,30 @@ import {TouchableOpacity} from 'react-native';
import PropTypes from 'prop-types';
import Text from './Text';
import styles from '../styles/styles';
import Tooltip from './Tooltip';
import withLocalize, {withLocalizePropTypes} from './withLocalize';

const propTypes = {
/** Currency symbol of selected currency */
currencySymbol: PropTypes.string.isRequired,

/** Function to call when currency button is pressed */
onCurrencyButtonPress: PropTypes.func.isRequired,

...withLocalizePropTypes,
};

function CurrencySymbolButton(props) {
return (
<TouchableOpacity onPress={props.onCurrencyButtonPress}>
<Text style={styles.iouAmountText}>{props.currencySymbol}</Text>
</TouchableOpacity>
<Tooltip text={props.translate('iOUCurrencySelection.selectCurrency')}>
<TouchableOpacity onPress={props.onCurrencyButtonPress}>
<Text style={styles.iouAmountText}>{props.currencySymbol}</Text>
</TouchableOpacity>
</Tooltip>
);
}

CurrencySymbolButton.propTypes = propTypes;
CurrencySymbolButton.displayName = 'CurrencySymbolButton';

export default CurrencySymbolButton;
export default withLocalize(CurrencySymbolButton);

0 comments on commit a75a01e

Please sign in to comment.