diff --git a/src/components/account/AddAccountAddress.js b/src/components/account/AddAccountAddress.js index a1aaf14..09f9d4b 100644 --- a/src/components/account/AddAccountAddress.js +++ b/src/components/account/AddAccountAddress.js @@ -122,7 +122,7 @@ class AddAccountAddress extends Component { renderRegions = () => { const theme = this.context; - const { countryId, countries } = this.props; + const { countryId, countries, region } = this.props; if (countryId && countryId.length && countries && countries.length) { const country = countries.find(item => item.id === countryId); if (country && country.available_regions) { @@ -131,11 +131,16 @@ class AddAccountAddress extends Component { key: value.id, })); + const label = region?.region + ? region?.region + : translate('common.region'); + return ( item.id === countryId); if (country && country.available_regions) { @@ -193,11 +193,16 @@ class CheckoutCustomerAccount extends Component { key: value.id, })); + const label = region?.region + ? region?.region + : translate('common.region'); + return ( item.id === countryId); + const label = country + ? country.full_name_locale + : translate('common.country'); + return ( { +const ModalSelect = ({ + data, + disabled, + label, + onChange, + attribute, + style, + withLabel = true, +}) => { const [value, setValue] = useState(''); const _onChange = option => { - setValue( - attribute === 'CurrencyCode' - ? option.label - : `${label} : ${option.label}`, - ); + setValue(!withLabel ? option.label : `${label} : ${option.label}`); if (onChange) { onChange(attribute, option.key); diff --git a/src/components/home/CurrencyPicker.js b/src/components/home/CurrencyPicker.js index e93b4a4..e15f1bd 100644 --- a/src/components/home/CurrencyPicker.js +++ b/src/components/home/CurrencyPicker.js @@ -34,6 +34,7 @@ const CurrencyPicker = ({ disabled={data.length === 0} label={selectedCurrencyCode} attribute="CurrencyCode" + withLabel={false} data={data} onChange={onChange} style={styles.currencyContainer}