ordering-ui-react-native 0.16.92 → 0.16.93-release

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.
Files changed (208) hide show
  1. package/package.json +5 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/styles.tsx +8 -14
  4. package/src/components/BusinessInformation/index.tsx +19 -4
  5. package/src/components/BusinessInformation/styles.tsx +2 -2
  6. package/src/components/BusinessProductsList/index.tsx +1 -1
  7. package/src/components/BusinessesListing/index.tsx +1 -1
  8. package/src/components/OrderCreating/index.tsx +1 -21
  9. package/src/components/OrdersOption/index.tsx +54 -56
  10. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  11. package/src/components/SingleProductReview/index.tsx +7 -4
  12. package/src/components/VerifyPhone/styles.tsx +1 -2
  13. package/src/components/shared/OToast.tsx +4 -4
  14. package/src/utils/index.tsx +2 -1
  15. package/themes/business/index.tsx +2 -0
  16. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  17. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  18. package/themes/business/src/components/BusinessController/index.tsx +2 -3
  19. package/themes/business/src/components/Chat/index.tsx +30 -30
  20. package/themes/business/src/components/DriverMap/index.tsx +22 -9
  21. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  22. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  23. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  24. package/themes/business/src/components/LoginForm/index.tsx +239 -80
  25. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  26. package/themes/business/src/components/MapView/index.tsx +18 -7
  27. package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
  28. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  29. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
  30. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  31. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  32. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  33. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  34. package/themes/business/src/components/OrdersOption/index.tsx +33 -75
  35. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +1 -1
  36. package/themes/business/src/components/PreviousMessages/index.tsx +16 -18
  37. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  38. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  39. package/themes/business/src/components/PreviousOrders/index.tsx +447 -247
  40. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  41. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  42. package/themes/business/src/components/ReviewCustomer/index.tsx +42 -25
  43. package/themes/business/src/components/StoresList/index.tsx +2 -2
  44. package/themes/business/src/components/shared/OLink.tsx +33 -13
  45. package/themes/business/src/components/shared/OModal.tsx +16 -9
  46. package/themes/business/src/components/shared/OText.tsx +8 -2
  47. package/themes/business/src/types/index.tsx +33 -2
  48. package/themes/business/src/utils/index.tsx +53 -0
  49. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  50. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  51. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  52. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  53. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  54. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  55. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  56. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  57. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  58. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  59. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  60. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  61. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
  62. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  63. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  64. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  65. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  66. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  67. package/themes/kiosk/src/types/index.d.ts +13 -0
  68. package/themes/kiosk/src/utils/index.tsx +15 -0
  69. package/themes/original/index.tsx +8 -0
  70. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  71. package/themes/original/src/components/AddressForm/index.tsx +143 -115
  72. package/themes/original/src/components/AddressList/index.tsx +26 -21
  73. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  74. package/themes/original/src/components/AnalyticsSegment/index.tsx +164 -8
  75. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  76. package/themes/original/src/components/BusinessBasicInformation/index.tsx +121 -80
  77. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -4
  78. package/themes/original/src/components/BusinessController/index.tsx +100 -47
  79. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  80. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  81. package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -5
  82. package/themes/original/src/components/BusinessListingSearch/index.tsx +52 -24
  83. package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
  84. package/themes/original/src/components/BusinessProductsList/index.tsx +16 -9
  85. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  86. package/themes/original/src/components/BusinessProductsListing/index.tsx +606 -490
  87. package/themes/original/src/components/BusinessProductsListing/styles.tsx +7 -13
  88. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  89. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  90. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +96 -73
  91. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  92. package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
  93. package/themes/original/src/components/Cart/index.tsx +93 -43
  94. package/themes/original/src/components/CartContent/index.tsx +77 -15
  95. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  96. package/themes/original/src/components/Checkout/index.tsx +294 -175
  97. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  98. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  99. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  100. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  101. package/themes/original/src/components/DriverTips/index.tsx +52 -37
  102. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  103. package/themes/original/src/components/Favorite/index.tsx +7 -4
  104. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  105. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  106. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  107. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  108. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  109. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  110. package/themes/original/src/components/Help/index.tsx +8 -8
  111. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  112. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  113. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  114. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  115. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  116. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  117. package/themes/original/src/components/Home/index.tsx +13 -4
  118. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  119. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  120. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  121. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  122. package/themes/original/src/components/LoginForm/index.tsx +43 -19
  123. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  124. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  125. package/themes/original/src/components/Messages/index.tsx +31 -10
  126. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  127. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  128. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  129. package/themes/original/src/components/MultiCheckout/index.tsx +210 -79
  130. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  131. package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
  132. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  133. package/themes/original/src/components/MyOrders/index.tsx +66 -17
  134. package/themes/original/src/components/NavBar/index.tsx +6 -11
  135. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  136. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  137. package/themes/original/src/components/Notifications/index.tsx +144 -0
  138. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  139. package/themes/original/src/components/OrderDetails/OrderEta.tsx +59 -0
  140. package/themes/original/src/components/OrderDetails/index.tsx +110 -221
  141. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  142. package/themes/original/src/components/OrderItAgain/index.tsx +47 -43
  143. package/themes/original/src/components/OrderProgress/index.tsx +74 -112
  144. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  145. package/themes/original/src/components/OrderSummary/index.tsx +52 -17
  146. package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -3
  147. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +28 -19
  148. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  149. package/themes/original/src/components/OrdersOption/index.tsx +76 -83
  150. package/themes/original/src/components/PageBanner/index.tsx +171 -0
  151. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  152. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  153. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  154. package/themes/original/src/components/PaymentOptions/index.tsx +2 -2
  155. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  156. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  157. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  158. package/themes/original/src/components/ProductForm/index.tsx +247 -269
  159. package/themes/original/src/components/ProductForm/styles.tsx +4 -7
  160. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  161. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  162. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  163. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  164. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
  165. package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
  166. package/themes/original/src/components/Promotions/index.tsx +234 -220
  167. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  168. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  169. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  170. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  171. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  172. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  173. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  174. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  175. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  176. package/themes/original/src/components/ServiceForm/index.tsx +377 -270
  177. package/themes/original/src/components/Sessions/index.tsx +11 -8
  178. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  179. package/themes/original/src/components/SignupForm/index.tsx +79 -66
  180. package/themes/original/src/components/SingleOrderCard/index.tsx +126 -57
  181. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  182. package/themes/original/src/components/SingleProductCard/index.tsx +106 -46
  183. package/themes/original/src/components/SingleProductCard/styles.tsx +19 -13
  184. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  185. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  186. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  187. package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
  188. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -218
  189. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  190. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  191. package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
  192. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  193. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  194. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  195. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  196. package/themes/original/src/components/Wallets/index.tsx +20 -21
  197. package/themes/original/src/components/Wallets/styles.tsx +2 -0
  198. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  199. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  200. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  201. package/themes/original/src/components/shared/OButton.tsx +6 -2
  202. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  203. package/themes/original/src/components/shared/OInput.tsx +10 -1
  204. package/themes/original/src/components/shared/OModal.tsx +3 -3
  205. package/themes/original/src/layouts/Container.tsx +13 -9
  206. package/themes/original/src/types/index.tsx +45 -7
  207. package/themes/original/src/utils/index.tsx +321 -58
  208. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -58,12 +58,15 @@ const AddressFormUI = (props: AddressFormParams) => {
58
58
  saveAddress,
59
59
  isGuestUser,
60
60
  isRequiredField,
61
+ showField,
61
62
  isFromProductsList,
62
63
  hasAddressDefault,
63
64
  afterSignup,
65
+ businessSlug
64
66
  } = props;
65
67
 
66
68
  const theme = useTheme();
69
+ const [autoCompleteInputFocused, setAutoCompleteInputFocused] = useState(false)
67
70
 
68
71
  const tagsName = [
69
72
  { icon: theme.images.general.tag_home, value: 'home' },
@@ -82,7 +85,6 @@ const AddressFormUI = (props: AddressFormParams) => {
82
85
  backgroundColor: theme.colors.clear
83
86
  },
84
87
  inputsStyle: {
85
- borderColor: theme.colors.border,
86
88
  borderRadius: 10,
87
89
  marginBottom: 20,
88
90
  height: 50,
@@ -91,7 +93,6 @@ const AddressFormUI = (props: AddressFormParams) => {
91
93
  flex: 1,
92
94
  },
93
95
  textAreaStyles: {
94
- borderColor: theme.colors.border,
95
96
  borderRadius: 10,
96
97
  marginBottom: 20,
97
98
  height: 104,
@@ -105,6 +106,12 @@ const AddressFormUI = (props: AddressFormParams) => {
105
106
  end: 0,
106
107
  top: 12,
107
108
  zIndex: 1002,
109
+ right: autoCompleteInputFocused && (
110
+ !!address?.address ||
111
+ !!formState.changes?.address ||
112
+ !!addressState.address.address
113
+ ) ? 30 : 15,
114
+ width: 16
108
115
  },
109
116
  wrapperNavbar: Platform.OS === 'ios'
110
117
  ? { paddingVertical: 0, paddingHorizontal: 40 }
@@ -153,8 +160,10 @@ const AddressFormUI = (props: AddressFormParams) => {
153
160
  'true';
154
161
  const maxLimitLocation =
155
162
  configState?.configs?.meters_to_change_address?.value;
156
-
157
- const continueAsGuest = () => navigation.navigate('BusinessList', { isGuestUser: true });
163
+ const countryCode = configState?.configs?.country_autocomplete?.value
164
+ const isHideMap = theme?.address?.components?.map?.hidden
165
+ const isHideIcons = theme?.address?.components?.icons?.hidden
166
+ const continueAsGuest = () => navigation.navigate(!!businessSlug ? 'Business' : 'BusinessList', { isGuestUser: true });
158
167
  const goToBack = () => navigation?.canGoBack() && navigation.goBack();
159
168
 
160
169
  const getAddressFormatted = (address: any) => {
@@ -356,7 +365,7 @@ const AddressFormUI = (props: AddressFormParams) => {
356
365
  if (
357
366
  orderState.loading &&
358
367
  !addressesList &&
359
- orderState.options.address &&
368
+ orderState?.options?.address &&
360
369
  auth &&
361
370
  !afterSignup
362
371
  ) {
@@ -364,7 +373,7 @@ const AddressFormUI = (props: AddressFormParams) => {
364
373
  ? navigation.navigate('BottomTab')
365
374
  : navigation.navigate('Business');
366
375
  }
367
- }, [orderState.options.address]);
376
+ }, [orderState?.options?.address]);
368
377
 
369
378
  useEffect(() => {
370
379
  if (alertState.open && alertState?.key !== 'ERROR_MAX_LIMIT_LOCATION') {
@@ -543,7 +552,10 @@ const AddressFormUI = (props: AddressFormParams) => {
543
552
  onPress={(data, details: any) => {
544
553
  handleChangeAddress(data, details);
545
554
  }}
546
- query={{ key: googleMapsApiKey }}
555
+ query={{
556
+ key: googleMapsApiKey,
557
+ components: countryCode && countryCode !== '*' ? `country:${countryCode}` : ''
558
+ }}
547
559
  fetchDetails
548
560
  ref={googleInput}
549
561
  textInputProps={{
@@ -562,6 +574,8 @@ const AddressFormUI = (props: AddressFormParams) => {
562
574
  autoCorrect: false,
563
575
  blurOnSubmit: false,
564
576
  returnKeyType: 'next',
577
+ onFocus: () => setAutoCompleteInputFocused(true),
578
+ onBlur: () => setAutoCompleteInputFocused(false)
565
579
  }}
566
580
  onFail={(error) =>
567
581
  setAlertState({
@@ -585,13 +599,14 @@ const AddressFormUI = (props: AddressFormParams) => {
585
599
  textInput: {
586
600
  borderWidth: 1,
587
601
  borderRadius: 7.6,
588
- borderColor: theme.colors.border,
602
+ borderColor: autoCompleteInputFocused ? theme.colors.primary : theme.colors.border,
589
603
  flexGrow: 1,
590
604
  fontSize: 15,
591
- paddingHorizontal: 16,
605
+ paddingLeft: 16,
606
+ paddingRight: 32,
592
607
  minHeight: 50,
593
608
  fontFamily: 'Poppins-Regular',
594
- marginBottom: 24,
609
+ marginBottom: 24
595
610
  },
596
611
  }}
597
612
  />
@@ -599,9 +614,10 @@ const AddressFormUI = (props: AddressFormParams) => {
599
614
  />
600
615
 
601
616
  {(
602
- (!isEditing && !formState.changes?.address) ||
603
- (isEditing && !formState.changes?.address && formState.changes?.address !== undefined)) &&
604
- (
617
+ ((!isEditing && !isGuestUser) ||
618
+ (isEditing && !isGuestUser)) ||
619
+ (isGuestUser)) &&
620
+ (
605
621
  <View style={styles.pinIcon}>
606
622
  <GPSButton
607
623
  apiKey={googleMapsApiKey}
@@ -615,7 +631,7 @@ const AddressFormUI = (props: AddressFormParams) => {
615
631
  IconButton={<OIcon src={theme.images.general.pin} width={16} />}
616
632
  />
617
633
  </View>
618
- )}
634
+ )}
619
635
  </AutocompleteInput>
620
636
 
621
637
  {(locationChange || formState.changes?.location) && (
@@ -640,129 +656,141 @@ const AddressFormUI = (props: AddressFormParams) => {
640
656
  )}
641
657
 
642
658
  <View style={{ flexDirection: 'row', flexBasis: '50%' }}>
643
- <Controller
644
- control={control}
645
- name="internal_number"
646
- rules={{
647
- required:
648
- isRequiredField && isRequiredField('internal_number')
649
- ? t(
650
- `VALIDATION_ERROR_INTERNAL_NUMBER_REQUIRED`,
651
- `The field internal number is required`,
652
- )
653
- : null,
654
- }}
655
- defaultValue={
656
- address?.internal_number ||
657
- formState.changes?.internal_number ||
658
- addressState?.address?.internal_number ||
659
- ''
660
- }
661
- render={() => (
662
- <OInput
663
- name="internal_number"
664
- placeholder={t('INTERNAL_NUMBER', 'Internal number')}
665
- onChange={(text: string) => {
666
- handleChangeInput(text);
667
- setValue('internal_number', text);
668
- }}
669
- value={
670
- address?.internal_number ||
671
- formState.changes?.internal_number ||
672
- addressState?.address?.internal_number ||
673
- ''
674
- }
675
- style={{ ...styles.inputsStyle, marginRight: 24 }}
676
- forwardRef={internalNumberRef}
677
- returnKeyType="next"
678
- onSubmitEditing={() => zipCodeRef?.current?.focus?.()}
679
- blurOnSubmit={false}
680
- />
681
- )}
682
- />
659
+ {showField && showField('internal_number') && (
660
+ <Controller
661
+ control={control}
662
+ name="internal_number"
663
+ rules={{
664
+ required:
665
+ isRequiredField && isRequiredField('internal_number')
666
+ ? t(
667
+ `VALIDATION_ERROR_INTERNAL_NUMBER_REQUIRED`,
668
+ `The field internal number is required`,
669
+ )
670
+ : null,
671
+ }}
672
+ defaultValue={
673
+ address?.internal_number ||
674
+ formState.changes?.internal_number ||
675
+ addressState?.address?.internal_number ||
676
+ ''
677
+ }
678
+ render={() => (
679
+ <OInput
680
+ name="internal_number"
681
+ placeholder={t('INTERNAL_NUMBER', 'Internal number')}
682
+ onChange={(text: string) => {
683
+ handleChangeInput(text);
684
+ setValue('internal_number', text);
685
+ }}
686
+ value={
687
+ address?.internal_number ||
688
+ formState.changes?.internal_number ||
689
+ addressState?.address?.internal_number ||
690
+ ''
691
+ }
692
+ isFocusHighlight
693
+ style={{
694
+ ...styles.inputsStyle,
695
+ marginRight: showField('internal_number') && showField('zipcode') ? 24 : 0
696
+ }}
697
+ forwardRef={internalNumberRef}
698
+ returnKeyType="next"
699
+ onSubmitEditing={() => zipCodeRef?.current?.focus?.()}
700
+ blurOnSubmit={false}
701
+ />
702
+ )}
703
+ />
704
+ )}
705
+
706
+ {showField && showField('zipcode') && (
707
+ <Controller
708
+ control={control}
709
+ name="zipcode"
710
+ rules={{
711
+ required:
712
+ isRequiredField && isRequiredField('zipcode')
713
+ ? t(
714
+ `VALIDATION_ERROR_ZIP_CODE_REQUIRED`,
715
+ `The field Zip Code is required`,
716
+ )
717
+ : null,
718
+ }}
719
+ defaultValue={
720
+ address?.zipcode ||
721
+ formState.changes?.zipcode ||
722
+ addressState.address.zipcode ||
723
+ ''
724
+ }
725
+ render={() => (
726
+ <OInput
727
+ name="zipcode"
728
+ placeholder={t('ZIP_CODE', 'Zip code')}
729
+ onChange={(text: string) => {
730
+ handleChangeInput(text);
731
+ setValue('zipcode', text);
732
+ }}
733
+ value={
734
+ address?.zipcode ||
735
+ formState.changes?.zipcode ||
736
+ addressState.address.zipcode ||
737
+ ''
738
+ }
739
+ isFocusHighlight
740
+ style={styles.inputsStyle}
741
+ forwardRef={zipCodeRef}
742
+ returnKeyType="next"
743
+ onSubmitEditing={() => addressNotesRef?.current?.focus?.()}
744
+ blurOnSubmit={false}
745
+ />
746
+ )}
747
+ />
748
+ )}
749
+ </View>
683
750
 
751
+ {showField && showField('address_notes') && (
684
752
  <Controller
685
753
  control={control}
686
- name="zipcode"
754
+ name="address_notes"
687
755
  rules={{
688
756
  required:
689
- isRequiredField && isRequiredField('zipcode')
757
+ isRequiredField && isRequiredField('address_notes')
690
758
  ? t(
691
- `VALIDATION_ERROR_ZIP_CODE_REQUIRED`,
692
- `The field Zip Code is required`,
759
+ `VALIDATION_ERROR_ADDRESS_NOTES_REQUIRED`,
760
+ `The field address notes is required`,
693
761
  )
694
762
  : null,
695
763
  }}
696
764
  defaultValue={
697
- address?.zipcode ||
698
- formState.changes?.zipcode ||
699
- addressState.address.zipcode ||
765
+ address?.address_notes ||
766
+ formState.changes?.address_notes ||
767
+ addressState.address.address_notes ||
700
768
  ''
701
769
  }
702
770
  render={() => (
703
771
  <OInput
704
- name="zipcode"
705
- placeholder={t('ZIP_CODE', 'Zip code')}
706
- onChange={(text: string) => {
772
+ name="address_notes"
773
+ placeholder={t('ADDRESS_NOTES', 'Address notes')}
774
+ onChange={(text: any) => {
707
775
  handleChangeInput(text);
708
- setValue('zipcode', text);
776
+ setValue('address_notes', text);
709
777
  }}
710
778
  value={
711
- address?.zipcode ||
712
- formState.changes?.zipcode ||
713
- addressState.address.zipcode ||
779
+ address?.address_notes ||
780
+ formState.changes?.address_notes ||
781
+ addressState.address.address_notes ||
714
782
  ''
715
783
  }
716
- style={styles.inputsStyle}
717
- forwardRef={zipCodeRef}
718
- returnKeyType="next"
719
- onSubmitEditing={() => addressNotesRef?.current?.focus?.()}
720
- blurOnSubmit={false}
784
+ multiline
785
+ isFocusHighlight
786
+ style={styles.textAreaStyles}
787
+ returnKeyType="done"
788
+ forwardRef={addressNotesRef}
789
+ blurOnSubmit
721
790
  />
722
791
  )}
723
792
  />
724
- </View>
725
-
726
- <Controller
727
- control={control}
728
- name="address_notes"
729
- rules={{
730
- required:
731
- isRequiredField && isRequiredField('address_notes')
732
- ? t(
733
- `VALIDATION_ERROR_ADDRESS_NOTES_REQUIRED`,
734
- `The field address notes is required`,
735
- )
736
- : null,
737
- }}
738
- defaultValue={
739
- address?.address_notes ||
740
- formState.changes?.address_notes ||
741
- addressState.address.address_notes ||
742
- ''
743
- }
744
- render={() => (
745
- <OInput
746
- name="address_notes"
747
- placeholder={t('ADDRESS_NOTES', 'Address notes')}
748
- onChange={(text: any) => {
749
- handleChangeInput(text);
750
- setValue('address_notes', text);
751
- }}
752
- value={
753
- address?.address_notes ||
754
- formState.changes?.address_notes ||
755
- addressState.address.address_notes ||
756
- ''
757
- }
758
- multiline
759
- style={styles.textAreaStyles}
760
- returnKeyType="done"
761
- forwardRef={addressNotesRef}
762
- blurOnSubmit
763
- />
764
- )}
765
- />
793
+ )}
766
794
  </FormInput>
767
795
  <IconsContainer>
768
796
  {tagsName.map((tag) => (
@@ -1,9 +1,8 @@
1
1
  import React, { useEffect } from 'react'
2
2
  import { AddressList as AddressListController, useLanguage, useOrder, useSession } from 'ordering-components/native'
3
- import { AddressListContainer, AddressItem } from './styles'
3
+ import { AddressItem, Container } from './styles'
4
4
  import { Platform, RefreshControl, StyleSheet, View } from 'react-native'
5
5
  import { OButton, OText, OAlert, OModal, OIcon } from '../shared'
6
- import { Container } from '../../layouts/Container'
7
6
  import { AddressListParams } from '../../types'
8
7
  import { NotFoundSource } from '../NotFoundSource'
9
8
  import NavBar from '../NavBar'
@@ -40,9 +39,6 @@ const AddressListUI = (props: AddressListParams) => {
40
39
 
41
40
  const [isProfile, setIsProfile] = useState(isFromProfile || route?.params?.isFromProfile);
42
41
 
43
- const goToBack = () => navigation?.canGoBack() && navigation.goBack()
44
- const onNavigationRedirect = (route: string, params?: any) => navigation.navigate(route, params)
45
-
46
42
  const onNavigatorRedirect = () => {
47
43
  if (route && (isFromBusinesses || isGoBack)) {
48
44
  isGoBack ? goToBack() : onNavigationRedirect('BottomTab')
@@ -104,7 +100,6 @@ const AddressListUI = (props: AddressListParams) => {
104
100
  const handleSetAddress = (address: any) => {
105
101
  if (address.id === orderState?.options?.address_id) return
106
102
  handleSetDefault(address)
107
- onNavigatorRedirect()
108
103
  }
109
104
 
110
105
  const handleSaveAddress = (address: any) => {
@@ -133,13 +128,21 @@ const AddressListUI = (props: AddressListParams) => {
133
128
  }
134
129
  }
135
130
 
131
+ const goToBack = () => navigation?.canGoBack() && navigation.goBack()
132
+ const onNavigationRedirect = (route: string, params?: any) => navigation.navigate(route, params)
133
+
134
+ useEffect(() => {
135
+ if (orderState.loading && auth && orderState.options.address?.location) {
136
+ onNavigatorRedirect()
137
+ }
138
+ }, [orderState.options.address])
139
+
136
140
  useEffect(() => {
137
141
  console.log('From profile : ' + isProfile)
138
142
  }, [])
139
143
 
140
144
  return (
141
- <Container
142
- noPadding
145
+ <Container
143
146
  refreshControl={
144
147
  <RefreshControl
145
148
  refreshing={refreshing}
@@ -147,17 +150,18 @@ const AddressListUI = (props: AddressListParams) => {
147
150
  />
148
151
  }
149
152
  >
150
- {isProfile && (
151
- <NavBar
152
- title={t('SAVED_PLACES', 'My saved places')}
153
- titleAlign={'center'}
154
- onActionLeft={goToBack}
155
- showCall={false}
156
- style={{ paddingHorizontal: 40, paddingVertical: Platform.OS === 'ios' ? 0 : 20, marginTop: Platform.OS === 'ios' ? 0 : 30 }}
157
- />
158
- )}
159
153
  {(!addressList.loading || (isFromProductsList || isFromBusinesses || isFromProfile || isProfile)) && (
160
- <AddressListContainer>
154
+ <>
155
+ {isProfile && (
156
+ <NavBar
157
+ title={t('SAVED_PLACES', 'My saved places')}
158
+ titleAlign={'center'}
159
+ onActionLeft={goToBack}
160
+ showCall={false}
161
+ paddingTop={10}
162
+ btnStyle={{ paddingLeft: 0 }}
163
+ />
164
+ )}
161
165
  {
162
166
  route &&
163
167
  (
@@ -173,8 +177,8 @@ const AddressListUI = (props: AddressListParams) => {
173
177
  onActionLeft={() => goToBack()}
174
178
  showCall={false}
175
179
  btnStyle={{ paddingLeft: 0 }}
176
- paddingTop={0}
177
- style={{ marginTop: Platform.OS === 'ios' ? 0 : 40 }}
180
+ paddingTop={10}
181
+ style={{ marginTop: 0 }}
178
182
  titleWrapStyle={{ paddingHorizontal: 0 }}
179
183
  titleStyle={{ marginLeft: 0, marginRight: 0 }}
180
184
  />
@@ -323,7 +327,8 @@ const AddressListUI = (props: AddressListParams) => {
323
327
  />
324
328
  </>
325
329
  )}
326
- </AddressListContainer>
330
+ </>
331
+
327
332
  )}
328
333
  </Container>
329
334
  )
@@ -1,10 +1,12 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
- export const AddressListContainer = styled.View`
3
+ export const Container = styled.ScrollView`
4
+ position: relative;
4
5
  flex: 1;
5
6
  paddingLeft: 40px;
6
7
  paddingRight: 40px;
7
- paddingBottom: 20px;
8
+ margin-bottom: 40px;
9
+ padding-top: 10px;
8
10
  `
9
11
 
10
12
  export const AddressItem = styled.TouchableOpacity`