ordering-ui-react-native 0.16.59 → 0.16.60-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 (202) hide show
  1. package/package.json +6 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/index.tsx +61 -63
  4. package/src/components/ActiveOrders/styles.tsx +8 -14
  5. package/src/components/BusinessInformation/index.tsx +19 -4
  6. package/src/components/BusinessInformation/styles.tsx +2 -2
  7. package/src/components/BusinessProductsList/index.tsx +10 -10
  8. package/src/components/BusinessesListing/index.tsx +1 -1
  9. package/src/components/Checkout/index.tsx +2 -1
  10. package/src/components/LanguageSelector/index.tsx +21 -16
  11. package/src/components/Messages/index.tsx +2 -2
  12. package/src/components/NotificationSetting/index.tsx +85 -0
  13. package/src/components/OrdersOption/index.tsx +54 -56
  14. package/src/components/PaymentOptions/index.tsx +298 -345
  15. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  16. package/src/components/SingleProductReview/index.tsx +7 -4
  17. package/src/components/StripeElementsForm/index.tsx +25 -16
  18. package/src/components/VerifyPhone/styles.tsx +1 -2
  19. package/src/components/shared/OBottomPopup.tsx +6 -2
  20. package/src/components/shared/OToast.tsx +4 -4
  21. package/src/index.tsx +2 -0
  22. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  23. package/src/utils/index.tsx +2 -1
  24. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
  25. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  26. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  27. package/themes/business/src/components/Chat/index.tsx +40 -32
  28. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  29. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  30. package/themes/business/src/components/MapView/index.tsx +12 -1
  31. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  32. package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
  33. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +70 -43
  34. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
  35. package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
  36. package/themes/business/src/components/OrdersOption/index.tsx +76 -77
  37. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  38. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  39. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  40. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  41. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  42. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  43. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  44. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  45. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  46. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  47. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  48. package/themes/business/src/components/PreviousOrders/index.tsx +440 -245
  49. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  50. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  51. package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
  52. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  53. package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
  54. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  55. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  56. package/themes/business/src/components/shared/OLink.tsx +33 -13
  57. package/themes/business/src/components/shared/OText.tsx +8 -2
  58. package/themes/business/src/types/index.tsx +25 -11
  59. package/themes/business/src/utils/index.tsx +10 -0
  60. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  61. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  62. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  63. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  64. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  65. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  66. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  67. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  68. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  69. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  70. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  71. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  72. package/themes/kiosk/src/types/index.d.ts +2 -0
  73. package/themes/original/index.tsx +8 -0
  74. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  75. package/themes/original/src/components/AddressForm/index.tsx +153 -137
  76. package/themes/original/src/components/AddressList/index.tsx +1 -1
  77. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  78. package/themes/original/src/components/BusinessBasicInformation/index.tsx +53 -37
  79. package/themes/original/src/components/BusinessController/index.tsx +112 -48
  80. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  81. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  82. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  83. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  84. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  85. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  86. package/themes/original/src/components/BusinessListingSearch/index.tsx +87 -142
  87. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  88. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  89. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  90. package/themes/original/src/components/BusinessProductsList/index.tsx +59 -61
  91. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  92. package/themes/original/src/components/BusinessProductsListing/index.tsx +177 -93
  93. package/themes/original/src/components/BusinessProductsListing/styles.tsx +14 -12
  94. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  95. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +112 -107
  97. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  98. package/themes/original/src/components/BusinessesListing/index.tsx +16 -9
  99. package/themes/original/src/components/Cart/index.tsx +77 -24
  100. package/themes/original/src/components/Cart/styles.tsx +4 -0
  101. package/themes/original/src/components/CartContent/index.tsx +77 -18
  102. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  103. package/themes/original/src/components/Checkout/index.tsx +115 -118
  104. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  105. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  106. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  107. package/themes/original/src/components/DriverTips/index.tsx +4 -4
  108. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  109. package/themes/original/src/components/FavoriteList/index.tsx +69 -45
  110. package/themes/original/src/components/FloatingButton/index.tsx +0 -1
  111. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  112. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  113. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  114. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  115. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
  116. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
  117. package/themes/original/src/components/HelpGuide/index.tsx +9 -8
  118. package/themes/original/src/components/HelpOrder/index.tsx +9 -8
  119. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  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 +98 -41
  123. package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
  124. package/themes/original/src/components/Messages/index.tsx +35 -20
  125. package/themes/original/src/components/MomentOption/index.tsx +8 -6
  126. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  127. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  128. package/themes/original/src/components/MultiCheckout/index.tsx +96 -65
  129. package/themes/original/src/components/MultiOrdersDetails/index.tsx +34 -16
  130. package/themes/original/src/components/MyOrders/index.tsx +89 -25
  131. package/themes/original/src/components/NavBar/index.tsx +11 -5
  132. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  133. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  134. package/themes/original/src/components/Notifications/index.tsx +148 -0
  135. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  136. package/themes/original/src/components/OrderDetails/index.tsx +114 -15
  137. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  138. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  139. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  140. package/themes/original/src/components/OrderProgress/index.tsx +77 -66
  141. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  142. package/themes/original/src/components/OrderSummary/index.tsx +2 -35
  143. package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
  144. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  145. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
  146. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  147. package/themes/original/src/components/OrdersOption/index.tsx +95 -55
  148. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  149. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  150. package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
  151. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  152. package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
  153. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  154. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  155. package/themes/original/src/components/ProductForm/index.tsx +379 -396
  156. package/themes/original/src/components/ProductForm/styles.tsx +7 -12
  157. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  158. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  159. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  160. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
  161. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  162. package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
  163. package/themes/original/src/components/Promotions/index.tsx +232 -219
  164. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  165. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  166. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  167. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  168. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  169. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  170. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  171. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  172. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  173. package/themes/original/src/components/ServiceForm/index.tsx +328 -264
  174. package/themes/original/src/components/SignupForm/index.tsx +134 -89
  175. package/themes/original/src/components/SingleOrderCard/index.tsx +240 -130
  176. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  177. package/themes/original/src/components/SingleProductCard/index.tsx +116 -72
  178. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -9
  179. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  180. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  181. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  182. package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
  183. package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
  184. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  185. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  186. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  187. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  188. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  189. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  190. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  191. package/themes/original/src/components/Wallets/index.tsx +176 -164
  192. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  193. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  194. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  195. package/themes/original/src/components/shared/OBottomPopup.tsx +11 -7
  196. package/themes/original/src/components/shared/OButton.tsx +8 -3
  197. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  198. package/themes/original/src/components/shared/OInput.tsx +10 -1
  199. package/themes/original/src/layouts/Container.tsx +13 -9
  200. package/themes/original/src/types/index.tsx +65 -8
  201. package/themes/original/src/utils/index.tsx +103 -58
  202. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -5,7 +5,6 @@ import {
5
5
  TouchableOpacity,
6
6
  Keyboard,
7
7
  TouchableWithoutFeedback,
8
- KeyboardAvoidingView,
9
8
  Platform,
10
9
  } from 'react-native';
11
10
  import {
@@ -22,7 +21,7 @@ import Spinner from 'react-native-loading-spinner-overlay';
22
21
  import { useForm, Controller } from 'react-hook-form';
23
22
  import Geocoder from 'react-native-geocoding';
24
23
 
25
- import { OInput, OButton, OText, OModal, OIcon } from '../shared';
24
+ import { OInput, OButton, OModal, OIcon } from '../shared';
26
25
  import { AddressFormParams } from '../../types';
27
26
  import { getTraduction } from '../../utils';
28
27
  import { useTheme } from 'styled-components/native';
@@ -57,15 +56,16 @@ const AddressFormUI = (props: AddressFormParams) => {
57
56
  addressState,
58
57
  addressesList,
59
58
  saveAddress,
60
- userCustomerSetup,
61
59
  isGuestUser,
62
60
  isRequiredField,
61
+ showField,
63
62
  isFromProductsList,
64
63
  hasAddressDefault,
65
64
  afterSignup,
66
65
  } = props;
67
66
 
68
67
  const theme = useTheme();
68
+ const [autoCompleteInputFocused, setAutoCompleteInputFocused] = useState(false)
69
69
 
70
70
  const tagsName = [
71
71
  { icon: theme.images.general.tag_home, value: 'home' },
@@ -84,7 +84,6 @@ const AddressFormUI = (props: AddressFormParams) => {
84
84
  backgroundColor: theme.colors.clear
85
85
  },
86
86
  inputsStyle: {
87
- borderColor: theme.colors.border,
88
87
  borderRadius: 10,
89
88
  marginBottom: 20,
90
89
  height: 50,
@@ -93,7 +92,6 @@ const AddressFormUI = (props: AddressFormParams) => {
93
92
  flex: 1,
94
93
  },
95
94
  textAreaStyles: {
96
- borderColor: theme.colors.border,
97
95
  borderRadius: 10,
98
96
  marginBottom: 20,
99
97
  height: 104,
@@ -107,6 +105,12 @@ const AddressFormUI = (props: AddressFormParams) => {
107
105
  end: 0,
108
106
  top: 12,
109
107
  zIndex: 1002,
108
+ right: autoCompleteInputFocused && (
109
+ !!address?.address ||
110
+ !!formState.changes?.address ||
111
+ !!addressState.address.address
112
+ ) ? 30 : 15,
113
+ width: 16
110
114
  },
111
115
  wrapperNavbar: Platform.OS === 'ios'
112
116
  ? { paddingVertical: 0, paddingHorizontal: 40 }
@@ -155,7 +159,7 @@ const AddressFormUI = (props: AddressFormParams) => {
155
159
  'true';
156
160
  const maxLimitLocation =
157
161
  configState?.configs?.meters_to_change_address?.value;
158
-
162
+ const countryCode = configState?.configs?.country_autocomplete?.value
159
163
  const continueAsGuest = () => navigation.navigate('BusinessList', { isGuestUser: true });
160
164
  const goToBack = () => navigation?.canGoBack() && navigation.goBack();
161
165
 
@@ -545,7 +549,10 @@ const AddressFormUI = (props: AddressFormParams) => {
545
549
  onPress={(data, details: any) => {
546
550
  handleChangeAddress(data, details);
547
551
  }}
548
- query={{ key: googleMapsApiKey }}
552
+ query={{
553
+ key: googleMapsApiKey,
554
+ components: countryCode && countryCode !== '*' ? `country:${countryCode}` : ''
555
+ }}
549
556
  fetchDetails
550
557
  ref={googleInput}
551
558
  textInputProps={{
@@ -564,6 +571,8 @@ const AddressFormUI = (props: AddressFormParams) => {
564
571
  autoCorrect: false,
565
572
  blurOnSubmit: false,
566
573
  returnKeyType: 'next',
574
+ onFocus: () => setAutoCompleteInputFocused(true),
575
+ onBlur: () => setAutoCompleteInputFocused(false)
567
576
  }}
568
577
  onFail={(error) =>
569
578
  setAlertState({
@@ -587,45 +596,40 @@ const AddressFormUI = (props: AddressFormParams) => {
587
596
  textInput: {
588
597
  borderWidth: 1,
589
598
  borderRadius: 7.6,
590
- borderColor: theme.colors.border,
599
+ borderColor: autoCompleteInputFocused ? theme.colors.primary : theme.colors.border,
591
600
  flexGrow: 1,
592
601
  fontSize: 15,
593
- paddingHorizontal: 16,
602
+ paddingLeft: 16,
603
+ paddingRight: 32,
594
604
  minHeight: 50,
595
605
  fontFamily: 'Poppins-Regular',
596
- marginBottom: 24,
606
+ marginBottom: 24
597
607
  },
598
608
  }}
599
609
  />
600
610
  )}
601
611
  />
602
- {hasEditing ? (
603
- <View style={styles.pinIcon}>
604
- <GPSButton
605
- apiKey={googleMapsApiKey}
606
- handleGPS={(data: any, detail: any) => {
607
- handleChangeAddress(data, detail);
608
- setValue(data.address);
609
- if (googleInput?.current) {
610
- googleInput?.current?.setAddressText(data.address);
611
- }
612
- }}
613
- IconButton={<OIcon src={theme.images.general.pin} width={16} />}
614
- />
615
- </View>
616
- ) : null}
617
- </AutocompleteInput>
618
612
 
619
- {/* {!isKeyboardShow && (addressState?.address?.location || formState?.changes?.location) && (
620
- <TouchableOpacity onPress={handleToggleMap} style={{ marginBottom: 10 }}>
621
- <OText
622
- color={theme.colors.primary}
623
- style={{ textAlign: 'center' }}
624
- >
625
- {t('VIEW_MAP', 'View map to modify the exact location')}
626
- </OText>
627
- </TouchableOpacity>
628
- )} */}
613
+ {(
614
+ ((!isEditing && !isGuestUser) ||
615
+ (isEditing && !isGuestUser)) ||
616
+ (isGuestUser)) &&
617
+ (
618
+ <View style={styles.pinIcon}>
619
+ <GPSButton
620
+ apiKey={googleMapsApiKey}
621
+ handleGPS={(data: any, detail: any) => {
622
+ handleChangeAddress(data, detail);
623
+ setValue('address', data.address);
624
+ if (googleInput?.current) {
625
+ googleInput?.current?.setAddressText(data.address);
626
+ }
627
+ }}
628
+ IconButton={<OIcon src={theme.images.general.pin} width={16} />}
629
+ />
630
+ </View>
631
+ )}
632
+ </AutocompleteInput>
629
633
 
630
634
  {(locationChange || formState.changes?.location) && (
631
635
  <View
@@ -649,129 +653,141 @@ const AddressFormUI = (props: AddressFormParams) => {
649
653
  )}
650
654
 
651
655
  <View style={{ flexDirection: 'row', flexBasis: '50%' }}>
652
- <Controller
653
- control={control}
654
- name="internal_number"
655
- rules={{
656
- required:
657
- isRequiredField && isRequiredField('internal_number')
658
- ? t(
659
- `VALIDATION_ERROR_INTERNAL_NUMBER_REQUIRED`,
660
- `The field internal number is required`,
661
- )
662
- : null,
663
- }}
664
- defaultValue={
665
- address?.internal_number ||
666
- formState.changes?.internal_number ||
667
- addressState?.address?.internal_number ||
668
- ''
669
- }
670
- render={() => (
671
- <OInput
672
- name="internal_number"
673
- placeholder={t('INTERNAL_NUMBER', 'Internal number')}
674
- onChange={(text: string) => {
675
- handleChangeInput(text);
676
- setValue('internal_number', text);
677
- }}
678
- value={
679
- address?.internal_number ||
680
- formState.changes?.internal_number ||
681
- addressState?.address?.internal_number ||
682
- ''
683
- }
684
- style={{ ...styles.inputsStyle, marginRight: 24 }}
685
- forwardRef={internalNumberRef}
686
- returnKeyType="next"
687
- onSubmitEditing={() => zipCodeRef?.current?.focus?.()}
688
- blurOnSubmit={false}
689
- />
690
- )}
691
- />
656
+ {showField && showField('internal_number') && (
657
+ <Controller
658
+ control={control}
659
+ name="internal_number"
660
+ rules={{
661
+ required:
662
+ isRequiredField && isRequiredField('internal_number')
663
+ ? t(
664
+ `VALIDATION_ERROR_INTERNAL_NUMBER_REQUIRED`,
665
+ `The field internal number is required`,
666
+ )
667
+ : null,
668
+ }}
669
+ defaultValue={
670
+ address?.internal_number ||
671
+ formState.changes?.internal_number ||
672
+ addressState?.address?.internal_number ||
673
+ ''
674
+ }
675
+ render={() => (
676
+ <OInput
677
+ name="internal_number"
678
+ placeholder={t('INTERNAL_NUMBER', 'Internal number')}
679
+ onChange={(text: string) => {
680
+ handleChangeInput(text);
681
+ setValue('internal_number', text);
682
+ }}
683
+ value={
684
+ address?.internal_number ||
685
+ formState.changes?.internal_number ||
686
+ addressState?.address?.internal_number ||
687
+ ''
688
+ }
689
+ isFocusHighlight
690
+ style={{
691
+ ...styles.inputsStyle,
692
+ marginRight: showField('internal_number') && showField('zipcode') ? 24 : 0
693
+ }}
694
+ forwardRef={internalNumberRef}
695
+ returnKeyType="next"
696
+ onSubmitEditing={() => zipCodeRef?.current?.focus?.()}
697
+ blurOnSubmit={false}
698
+ />
699
+ )}
700
+ />
701
+ )}
692
702
 
703
+ {showField && showField('zipcode') && (
704
+ <Controller
705
+ control={control}
706
+ name="zipcode"
707
+ rules={{
708
+ required:
709
+ isRequiredField && isRequiredField('zipcode')
710
+ ? t(
711
+ `VALIDATION_ERROR_ZIP_CODE_REQUIRED`,
712
+ `The field Zip Code is required`,
713
+ )
714
+ : null,
715
+ }}
716
+ defaultValue={
717
+ address?.zipcode ||
718
+ formState.changes?.zipcode ||
719
+ addressState.address.zipcode ||
720
+ ''
721
+ }
722
+ render={() => (
723
+ <OInput
724
+ name="zipcode"
725
+ placeholder={t('ZIP_CODE', 'Zip code')}
726
+ onChange={(text: string) => {
727
+ handleChangeInput(text);
728
+ setValue('zipcode', text);
729
+ }}
730
+ value={
731
+ address?.zipcode ||
732
+ formState.changes?.zipcode ||
733
+ addressState.address.zipcode ||
734
+ ''
735
+ }
736
+ isFocusHighlight
737
+ style={styles.inputsStyle}
738
+ forwardRef={zipCodeRef}
739
+ returnKeyType="next"
740
+ onSubmitEditing={() => addressNotesRef?.current?.focus?.()}
741
+ blurOnSubmit={false}
742
+ />
743
+ )}
744
+ />
745
+ )}
746
+ </View>
747
+
748
+ {showField && showField('address_notes') && (
693
749
  <Controller
694
750
  control={control}
695
- name="zipcode"
751
+ name="address_notes"
696
752
  rules={{
697
753
  required:
698
- isRequiredField && isRequiredField('zipcode')
754
+ isRequiredField && isRequiredField('address_notes')
699
755
  ? t(
700
- `VALIDATION_ERROR_ZIP_CODE_REQUIRED`,
701
- `The field Zip Code is required`,
756
+ `VALIDATION_ERROR_ADDRESS_NOTES_REQUIRED`,
757
+ `The field address notes is required`,
702
758
  )
703
759
  : null,
704
760
  }}
705
761
  defaultValue={
706
- address?.zipcode ||
707
- formState.changes?.zipcode ||
708
- addressState.address.zipcode ||
762
+ address?.address_notes ||
763
+ formState.changes?.address_notes ||
764
+ addressState.address.address_notes ||
709
765
  ''
710
766
  }
711
767
  render={() => (
712
768
  <OInput
713
- name="zipcode"
714
- placeholder={t('ZIP_CODE', 'Zip code')}
715
- onChange={(text: string) => {
769
+ name="address_notes"
770
+ placeholder={t('ADDRESS_NOTES', 'Address notes')}
771
+ onChange={(text: any) => {
716
772
  handleChangeInput(text);
717
- setValue('zipcode', text);
773
+ setValue('address_notes', text);
718
774
  }}
719
775
  value={
720
- address?.zipcode ||
721
- formState.changes?.zipcode ||
722
- addressState.address.zipcode ||
776
+ address?.address_notes ||
777
+ formState.changes?.address_notes ||
778
+ addressState.address.address_notes ||
723
779
  ''
724
780
  }
725
- style={styles.inputsStyle}
726
- forwardRef={zipCodeRef}
727
- returnKeyType="next"
728
- onSubmitEditing={() => addressNotesRef?.current?.focus?.()}
729
- blurOnSubmit={false}
781
+ multiline
782
+ isFocusHighlight
783
+ style={styles.textAreaStyles}
784
+ returnKeyType="done"
785
+ forwardRef={addressNotesRef}
786
+ blurOnSubmit
730
787
  />
731
788
  )}
732
789
  />
733
- </View>
734
-
735
- <Controller
736
- control={control}
737
- name="address_notes"
738
- rules={{
739
- required:
740
- isRequiredField && isRequiredField('address_notes')
741
- ? t(
742
- `VALIDATION_ERROR_ADDRESS_NOTES_REQUIRED`,
743
- `The field address notes is required`,
744
- )
745
- : null,
746
- }}
747
- defaultValue={
748
- address?.address_notes ||
749
- formState.changes?.address_notes ||
750
- addressState.address.address_notes ||
751
- ''
752
- }
753
- render={() => (
754
- <OInput
755
- name="address_notes"
756
- placeholder={t('ADDRESS_NOTES', 'Address notes')}
757
- onChange={(text: any) => {
758
- handleChangeInput(text);
759
- setValue('address_notes', text);
760
- }}
761
- value={
762
- address?.address_notes ||
763
- formState.changes?.address_notes ||
764
- addressState.address.address_notes ||
765
- ''
766
- }
767
- multiline
768
- style={styles.textAreaStyles}
769
- returnKeyType="done"
770
- forwardRef={addressNotesRef}
771
- blurOnSubmit
772
- />
773
- )}
774
- />
790
+ )}
775
791
  </FormInput>
776
792
  <IconsContainer>
777
793
  {tagsName.map((tag) => (
@@ -56,7 +56,7 @@ const AddressListUI = (props: AddressListParams) => {
56
56
  }
57
57
 
58
58
  const uniqueAddressesList = (addressList.addresses && addressList.addresses.filter(
59
- (address: any, i: number, self: any) =>
59
+ (address: any, i: number, self: any) => address.address &&
60
60
  i === self.findIndex((obj: any) => (
61
61
  address.address === obj.address &&
62
62
  address.address_notes === obj.address_notes &&
@@ -21,7 +21,7 @@ export const AppleLogin = (props: any) => {
21
21
  const [{ configs }] = useConfig();
22
22
  const [credentialStateForUser, updateCredentialStateForUser] = useState<any>(-1);
23
23
 
24
- let user : any= null
24
+ let user: any = null
25
25
 
26
26
  const buttonText = auth
27
27
  ? t('CONTINUE_WITH_APPLE', 'Logout with Apple')
@@ -53,7 +53,7 @@ export const AppleLogin = (props: any) => {
53
53
  }
54
54
  }
55
55
 
56
- const fetchAndUpdateCredentialState = async (updateCredentialStateForUser : any) => {
56
+ const fetchAndUpdateCredentialState = async (updateCredentialStateForUser: any) => {
57
57
  if (user === null) {
58
58
  updateCredentialStateForUser('N/A');
59
59
  } else {
@@ -66,7 +66,7 @@ export const AppleLogin = (props: any) => {
66
66
  }
67
67
  }
68
68
 
69
- const onIOSButtonPress = async (updateCredentialStateForUser : any) => {
69
+ const onIOSButtonPress = async (updateCredentialStateForUser: any) => {
70
70
  try {
71
71
  const appleAuthRequestResponse = await appleAuth.performRequest({
72
72
  requestedOperation: appleAuth.Operation.LOGIN,
@@ -79,7 +79,7 @@ export const AppleLogin = (props: any) => {
79
79
  identityToken,
80
80
  authorizationCode
81
81
  } = appleAuthRequestResponse;
82
-
82
+
83
83
  user = newUser;
84
84
 
85
85
  fetchAndUpdateCredentialState(updateCredentialStateForUser).catch(error =>
@@ -1,6 +1,7 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import { StyleSheet, View, TouchableOpacity, Linking } from 'react-native';
3
- import { useUtils, useOrder, useLanguage, useOrderingTheme } from 'ordering-components/native';
2
+ import { StyleSheet, View, TouchableOpacity, Linking, Pressable } from 'react-native';
3
+ import FastImage from 'react-native-fast-image'
4
+ import { useUtils, useOrder, useLanguage } from 'ordering-components/native';
4
5
  import { useTheme } from 'styled-components/native';
5
6
  import { OIcon, OText, OModal } from '../shared';
6
7
  import { BusinessBasicInformationParams } from '../../types';
@@ -38,7 +39,6 @@ export const BusinessBasicInformation = (
38
39
  const { business, loading } = businessState;
39
40
 
40
41
  const theme = useTheme();
41
- const [orderingTheme] = useOrderingTheme()
42
42
  const [orderState] = useOrder();
43
43
  const [, t] = useLanguage();
44
44
  const [{ parsePrice, parseDistance, optimizeImage }] = useUtils();
@@ -46,9 +46,9 @@ export const BusinessBasicInformation = (
46
46
  const [openBusinessReviews, setOpenBusinessReviews] = useState(false);
47
47
  const [businessInformationObtained, setBusinessInformationObtained] = useState(false)
48
48
  const [businessReviewsObtained, setBusinessReviewsObtainedbtained] = useState(false)
49
- const isChewLayout = theme?.layouts?.business_view?.components?.header?.components?.layout?.type === 'chew'
50
- const showLogo = !orderingTheme?.theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
51
-
49
+ const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
50
+ const showLogo = !theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
51
+
52
52
  const styles = StyleSheet.create({
53
53
  businesInfoheaderStyle: {
54
54
  height: 150,
@@ -56,12 +56,12 @@ export const BusinessBasicInformation = (
56
56
  headerStyle: {
57
57
  height: isChewLayout ? 170 : 260,
58
58
  },
59
- businessLogo: {
59
+ logoStyle: {
60
60
  width: 72,
61
61
  height: 72,
62
62
  borderRadius: 7.6,
63
63
  justifyContent: 'flex-start',
64
- alignItems: 'flex-start',
64
+ alignItems: 'flex-start'
65
65
  },
66
66
  businessInfo: {
67
67
  paddingHorizontal: 40,
@@ -104,7 +104,10 @@ export const BusinessBasicInformation = (
104
104
  height: 12,
105
105
  width: 12,
106
106
  margin: 0,
107
- padding: 0
107
+ padding: 0,
108
+ display: 'flex',
109
+ justifyContent: 'center',
110
+ alignItems: 'center'
108
111
  },
109
112
  headerChewStyle: {
110
113
  paddingHorizontal: 30,
@@ -218,14 +221,15 @@ export const BusinessBasicInformation = (
218
221
  />
219
222
  )}
220
223
  {!!business?.tiktok_profile && (
221
- <TouchableOpacity style={styles.socialIcon} onPress={() => Linking.openURL(business?.tiktok_profile)}>
224
+ <Pressable style={styles.socialIcon} onPress={() => Linking.openURL(business?.tiktok_profile)}>
222
225
  <View style={styles.tiktokIcon}>
223
226
  <OIcon
224
227
  src={theme.images.general.tiktok}
225
- style={{ width: '100%', height: '100%' }}
228
+ style={{ width: 10, height: 12 }}
229
+ cover
226
230
  />
227
231
  </View>
228
- </TouchableOpacity>
232
+ </Pressable>
229
233
  )}
230
234
  {!!business?.pinterest_profile && (
231
235
  <SocialNetWork
@@ -247,7 +251,11 @@ export const BusinessBasicInformation = (
247
251
  )}
248
252
  {isChewLayout && (
249
253
  <TouchableOpacity onPress={() => handleClickBusinessInformation()}>
250
- <OText style={{textDecorationColor: theme.colors.black, textDecorationLine: 'underline'}}>
254
+ <OText
255
+ color={theme.colors.primary}
256
+ style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
257
+ size={12}
258
+ >
251
259
  {t('SEE_MORE_DESCRIPTION', 'See more')}
252
260
  </OText>
253
261
  </TouchableOpacity>
@@ -267,11 +275,11 @@ export const BusinessBasicInformation = (
267
275
  ? styles.businesInfoheaderStyle
268
276
  : { ...styles.headerStyle, backgroundColor: theme.colors.backgroundGray }
269
277
  }
270
- source={{
271
- uri:
272
- header ||
273
- optimizeImage(businessState?.business?.header, 'h_250,c_limit'),
274
- }}
278
+ {...(!loading && {
279
+ source: (header || businessState?.business?.header) ? {
280
+ uri: header || optimizeImage(businessState?.business?.header, 'h_250,c_limit')
281
+ } : theme?.images?.dummies?.businessHeader
282
+ })}
275
283
  imageStyle={{ opacity: isChewLayout ? 0.5 : 1 }}
276
284
  >
277
285
  {!isBusinessInfoShow && !isChewLayout && (
@@ -279,7 +287,7 @@ export const BusinessBasicInformation = (
279
287
  <OIcon src={theme.images.general.info} width={24} />
280
288
  </WrapBusinessInfo>
281
289
  )}
282
- {isChewLayout && (
290
+ {isChewLayout && !loading && (
283
291
  <View style={styles.headerChewStyle}>
284
292
  <OText size={24} weight={'600'} mBottom={-5}>
285
293
  {business?.name}
@@ -298,22 +306,22 @@ export const BusinessBasicInformation = (
298
306
  <BusinessInfo style={styles.businessInfo}>
299
307
  {showLogo && (
300
308
  <BusinessLogo isChewLayout={isChewLayout}>
301
- {loading ? (
302
- <View>
303
- <Placeholder Animation={Fade}>
304
- <PlaceholderLine height={50} width={20} />
305
- </Placeholder>
306
- </View>
307
- ) : (
308
- !isBusinessInfoShow && (
309
+ {!isBusinessInfoShow && (
310
+ logo || businessState?.business?.logo ?
311
+ <FastImage
312
+ style={styles.logoStyle}
313
+ source={{
314
+ uri: logo || optimizeImage(businessState?.business?.logo, 'h_70,c_limit'),
315
+ priority: FastImage.priority.high,
316
+ cache: FastImage.cacheControl.web
317
+ }}
318
+ resizeMode={FastImage.resizeMode.contain}
319
+ />
320
+ :
309
321
  <OIcon
310
- url={
311
- logo ||
312
- optimizeImage(businessState?.business?.logo, 'h_70,c_limit')
313
- }
314
- style={styles.businessLogo}
322
+ src={theme?.images?.dummies?.businessLogo}
323
+ style={styles.logoStyle}
315
324
  />
316
- )
317
325
  )}
318
326
  </BusinessLogo>
319
327
  )}
@@ -327,7 +335,7 @@ export const BusinessBasicInformation = (
327
335
  </Placeholder>
328
336
  ) : (
329
337
  <TitleWrapper>
330
- <OText size={24} weight={'600'}>
338
+ <OText size={24} weight={'600'} numberOfLines={2}>
331
339
  {business?.name}
332
340
  </OText>
333
341
  {business?.ribbon?.enabled && (
@@ -412,15 +420,23 @@ export const BusinessBasicInformation = (
412
420
  {isPreOrder && (!business?.professionals || business?.professionals?.length === 0) && (
413
421
  <>
414
422
  <TouchableOpacity onPress={() => navigation.navigate('BusinessPreorder', { business: businessState?.business, handleBusinessClick: () => navigation?.goBack() })}>
415
- <OText color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>
416
- {t('PRE_ORDER', 'Preorder')}
423
+ <OText
424
+ color={theme.colors.primary}
425
+ style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
426
+ size={12}
427
+ >
428
+ {t('PREORDER', 'Preorder')}
417
429
  </OText>
418
430
  </TouchableOpacity>
419
431
  <OText size={12} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
420
432
  </>
421
433
  )}
422
434
  <TouchableOpacity onPress={() => handleClickBusinessReviews()}>
423
- <OText color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>
435
+ <OText
436
+ color={theme.colors.primary}
437
+ style={{ textDecorationColor: theme.colors.primary, textDecorationLine: 'underline' }}
438
+ size={12}
439
+ >
424
440
  {t('REVIEWS', 'Reviews')}
425
441
  </OText>
426
442
  </TouchableOpacity>