ordering-ui-react-native 0.12.20 → 0.12.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.12.20",
3
+ "version": "0.12.21",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -131,7 +131,20 @@ const AddressFormUI = (props: AddressFormParams) => {
131
131
  const maxLimitLocation = configState?.configs?.meters_to_change_address?.value
132
132
 
133
133
  const isGuestUser = props.isGuestUser || props.isGuestFromStore;
134
+ const isCountryAutocomplete = configState.configs?.country_autocomplete?.value !== '*'
134
135
 
136
+ const queryCountryAutoComplete = () => {
137
+ if (isCountryAutocomplete) {
138
+ return {
139
+ key: googleMapsApiKey,
140
+ components: `country:${configState.configs?.country_autocomplete?.value}`
141
+ }
142
+ } else {
143
+ return {
144
+ key: googleMapsApiKey,
145
+ }
146
+ }
147
+ }
135
148
  const continueAsGuest = () => navigation.navigate('BusinessList', {store, businessId, productId, categoryId})
136
149
  const goToBack = () => navigation?.canGoBack() && navigation.goBack()
137
150
 
@@ -487,7 +500,9 @@ const AddressFormUI = (props: AddressFormParams) => {
487
500
  onPress={(data: any, details: any) => {
488
501
  handleChangeAddress(data, details)
489
502
  }}
490
- query={{ key: googleMapsApiKey }}
503
+ query={
504
+ queryCountryAutoComplete()
505
+ }
491
506
  fetchDetails
492
507
  ref={googleInput}
493
508
  textInputProps={{