ordering-ui-react-native 0.22.21 → 0.22.22-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 (164) hide show
  1. package/package.json +6 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/Checkout/index.tsx +40 -39
  5. package/src/components/StripeMethodForm/index.tsx +4 -2
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/context/OfflineActions/index.tsx +236 -0
  8. package/src/types/index.tsx +2 -1
  9. package/themes/business/index.tsx +2 -0
  10. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
  11. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
  12. package/themes/business/src/components/BusinessController/index.tsx +8 -3
  13. package/themes/business/src/components/BusinessProductList/index.tsx +3 -2
  14. package/themes/business/src/components/Chat/index.tsx +15 -3
  15. package/themes/business/src/components/DriverMap/index.tsx +49 -26
  16. package/themes/business/src/components/FloatingButton/index.tsx +3 -2
  17. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  18. package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
  19. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  20. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  21. package/themes/business/src/components/MapView/index.tsx +36 -17
  22. package/themes/business/src/components/NewOrderNotification/index.tsx +38 -19
  23. package/themes/business/src/components/OrderDetails/Business.tsx +47 -27
  24. package/themes/business/src/components/OrderDetails/Delivery.tsx +134 -53
  25. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +128 -41
  26. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +45 -18
  27. package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
  28. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +17 -16
  29. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +3 -2
  30. package/themes/business/src/components/OrderSummary/index.tsx +6 -4
  31. package/themes/business/src/components/OrdersListManager/index.tsx +13 -1
  32. package/themes/business/src/components/OrdersOption/index.tsx +217 -156
  33. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  34. package/themes/business/src/components/PreviousMessages/index.tsx +26 -3
  35. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +39 -16
  36. package/themes/business/src/components/PreviousOrders/index.tsx +74 -66
  37. package/themes/business/src/components/PrinterEdition/MessageAlert.tsx +33 -0
  38. package/themes/business/src/components/PrinterEdition/index.tsx +431 -0
  39. package/themes/business/src/components/PrinterEdition/printerList.tsx +23 -0
  40. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  41. package/themes/business/src/components/PrinterSettings/index.tsx +162 -174
  42. package/themes/business/src/components/PrinterSettings/styles.tsx +14 -1
  43. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  44. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  45. package/themes/business/src/components/StoresList/index.tsx +2 -2
  46. package/themes/business/src/components/UserProfileForm/index.tsx +55 -22
  47. package/themes/business/src/components/UserProfileForm/styles.tsx +7 -0
  48. package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
  49. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  50. package/themes/business/src/config/currency.tsx +1010 -0
  51. package/themes/business/src/hooks/useLocation.tsx +16 -12
  52. package/themes/business/src/layouts/SafeAreaContainer.tsx +35 -19
  53. package/themes/business/src/types/index.tsx +16 -4
  54. package/themes/business/src/utils/index.tsx +33 -3
  55. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  56. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  57. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  58. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  59. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  60. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  61. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  62. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  63. package/themes/original/index.tsx +11 -0
  64. package/themes/original/src/components/AddressForm/index.tsx +32 -17
  65. package/themes/original/src/components/AddressList/index.tsx +8 -7
  66. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  67. package/themes/original/src/components/BusinessBasicInformation/index.tsx +5 -8
  68. package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
  69. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +103 -92
  70. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +8 -6
  71. package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
  72. package/themes/original/src/components/BusinessPreorder/index.tsx +46 -28
  73. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +73 -70
  74. package/themes/original/src/components/BusinessProductsList/index.tsx +6 -7
  75. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  76. package/themes/original/src/components/BusinessProductsListing/index.tsx +10 -6
  77. package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
  78. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  79. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  80. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  81. package/themes/original/src/components/Cart/index.tsx +46 -14
  82. package/themes/original/src/components/CartContent/index.tsx +2 -4
  83. package/themes/original/src/components/Checkout/index.tsx +127 -77
  84. package/themes/original/src/components/CitiesControl/index.tsx +0 -3
  85. package/themes/original/src/components/CouponControl/index.tsx +1 -3
  86. package/themes/original/src/components/DriverTips/index.tsx +1 -3
  87. package/themes/original/src/components/Favorite/index.tsx +1 -5
  88. package/themes/original/src/components/FavoriteList/index.tsx +0 -1
  89. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
  90. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
  91. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
  92. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
  93. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
  94. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +11 -12
  95. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  96. package/themes/original/src/components/Help/index.tsx +2 -0
  97. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  98. package/themes/original/src/components/Home/index.tsx +3 -11
  99. package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
  100. package/themes/original/src/components/LoginForm/index.tsx +12 -9
  101. package/themes/original/src/components/MessageListing/index.tsx +2 -1
  102. package/themes/original/src/components/Messages/index.tsx +27 -19
  103. package/themes/original/src/components/MomentOption/TimeListItem.tsx +56 -0
  104. package/themes/original/src/components/MomentOption/index.tsx +80 -51
  105. package/themes/original/src/components/MomentSelector/index.tsx +5 -2
  106. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  107. package/themes/original/src/components/MultiCheckout/index.tsx +55 -27
  108. package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -0
  109. package/themes/original/src/components/MyOrders/index.tsx +2 -2
  110. package/themes/original/src/components/NavBar/index.tsx +7 -4
  111. package/themes/original/src/components/NetworkError/index.tsx +0 -5
  112. package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
  113. package/themes/original/src/components/OrderDetails/OrderEta.tsx +4 -3
  114. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +16 -11
  115. package/themes/original/src/components/OrderDetails/index.tsx +44 -21
  116. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  117. package/themes/original/src/components/OrderProgress/index.tsx +4 -3
  118. package/themes/original/src/components/OrderSummary/index.tsx +29 -10
  119. package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
  120. package/themes/original/src/components/OrdersOption/index.tsx +3 -6
  121. package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
  122. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  123. package/themes/original/src/components/PaymentOptions/index.tsx +4 -3
  124. package/themes/original/src/components/PhoneInputNumber/index.tsx +92 -7
  125. package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
  126. package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
  127. package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
  128. package/themes/original/src/components/ProductForm/index.tsx +107 -102
  129. package/themes/original/src/components/ProductItemAccordion/index.tsx +50 -43
  130. package/themes/original/src/components/ProductItemAccordion/styles.tsx +0 -3
  131. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  132. package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
  133. package/themes/original/src/components/Promotions/index.tsx +6 -9
  134. package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
  135. package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
  136. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  137. package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
  138. package/themes/original/src/components/ServiceForm/index.tsx +52 -54
  139. package/themes/original/src/components/Sessions/index.tsx +3 -3
  140. package/themes/original/src/components/SignupForm/index.tsx +102 -88
  141. package/themes/original/src/components/SingleOrderCard/index.tsx +6 -4
  142. package/themes/original/src/components/SingleProductCard/index.tsx +5 -5
  143. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  144. package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
  145. package/themes/original/src/components/StripeCardsList/index.tsx +16 -3
  146. package/themes/original/src/components/StripeElementsForm/index.tsx +76 -62
  147. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  148. package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
  149. package/themes/original/src/components/TaxInformation/index.tsx +3 -2
  150. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
  151. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
  152. package/themes/original/src/components/UserDetails/index.tsx +17 -16
  153. package/themes/original/src/components/UserFormDetails/index.tsx +164 -135
  154. package/themes/original/src/components/UserProfile/index.tsx +9 -1
  155. package/themes/original/src/components/UserVerification/index.tsx +15 -4
  156. package/themes/original/src/components/Wallets/index.tsx +6 -3
  157. package/themes/original/src/components/WebsocketStatus/index.tsx +1 -4
  158. package/themes/original/src/components/shared/OAlert.tsx +2 -1
  159. package/themes/original/src/components/shared/OButton.tsx +5 -4
  160. package/themes/original/src/components/shared/OInput.tsx +4 -8
  161. package/themes/original/src/components/shared/OModal.tsx +7 -2
  162. package/themes/original/src/types/index.tsx +10 -3
  163. package/themes/original/src/utils/index.tsx +30 -1
  164. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { Modal, StyleSheet, Text, SafeAreaView, View, TouchableOpacity, Platform } from "react-native";
3
3
  import styled from 'styled-components/native';
4
4
  import AntDesignIcon from 'react-native-vector-icons/AntDesign'
5
-
5
+ import { Toast } from '../../../../../src/components/shared/OToast'
6
6
  interface Props {
7
7
  open?: boolean;
8
8
  title?: string;
@@ -22,6 +22,7 @@ interface Props {
22
22
  styleCloseButton?: any,
23
23
  isAvoidKeyBoardView?: boolean;
24
24
  styleContainerCloseButton?: any;
25
+ showToastInsideModal?: boolean;
25
26
  }
26
27
  const KeyboardView = styled.KeyboardAvoidingView`
27
28
  flex-grow: 1;
@@ -47,7 +48,8 @@ const OModal = (props: Props): React.ReactElement => {
47
48
  style,
48
49
  styleCloseButton,
49
50
  styleContainerCloseButton,
50
- isAvoidKeyBoardView
51
+ isAvoidKeyBoardView,
52
+ showToastInsideModal
51
53
  } = props
52
54
 
53
55
  const renderSafeAreaView = () => (
@@ -94,6 +96,9 @@ const OModal = (props: Props): React.ReactElement => {
94
96
  onRequestClose={() => onClose && onClose()}
95
97
  style={{ height: '100%', flex: 1, position: 'absolute', ...style, zIndex: 9999 }}
96
98
  >
99
+ {showToastInsideModal && (
100
+ <Toast />
101
+ )}
97
102
  {isAvoidKeyBoardView ? (
98
103
  <KeyboardView
99
104
  enabled
@@ -25,7 +25,8 @@ export interface LoginParams {
25
25
  generateOtpCode: (values?: any) => void,
26
26
  useLoginOtpEmail?: boolean,
27
27
  useLoginOtpCellphone?: boolean,
28
- useLoginOtp?: boolean
28
+ useLoginOtp?: boolean,
29
+ setCellphoneStartZero?: any
29
30
  }
30
31
  export interface ProfileParams {
31
32
  navigation?: any;
@@ -50,6 +51,7 @@ export interface ProfileParams {
50
51
  removeAccountState?: any;
51
52
  handleChangePromotions?: any;
52
53
  notificationsGroup?: any;
54
+ appVersion?: string
53
55
  }
54
56
 
55
57
  export interface AddressListParams {
@@ -130,6 +132,7 @@ export interface SignupParams {
130
132
  setSignUpTab?: (in1: string) => void;
131
133
  setWillVerifyOtpState?: (in1: boolean) => void;
132
134
  setOtpState?: (in1: string) => void;
135
+ setCellphoneStartZero?: any
133
136
  }
134
137
 
135
138
  export interface PhoneInputParams {
@@ -147,7 +150,8 @@ export interface PhoneInputParams {
147
150
  isDisabled?: any;
148
151
  isStartValidation?: any;
149
152
  changeCountry?: any;
150
- updateStateWithSubmit?: boolean
153
+ updateStateWithSubmit?: boolean,
154
+ defaultCodeFallback?: number
151
155
  }
152
156
 
153
157
  export interface LanguageSelectorParams {
@@ -607,7 +611,7 @@ export interface UpsellingProductsParams {
607
611
  business?: any;
608
612
  businessId?: number;
609
613
  cartProducts?: Array<any>;
610
- handleUpsellingPage: (cart ?: any) => void;
614
+ handleUpsellingPage: (cart?: any) => void;
611
615
  openUpselling: boolean;
612
616
  canOpenUpselling?: boolean;
613
617
  setCanOpenUpselling?: (value: any) => void;
@@ -637,6 +641,9 @@ export interface GoogleMapsParams {
637
641
  isIntGeoCoder: boolean,
638
642
  businessZones?: any
639
643
  delta?: number
644
+ setAutoCompleteAddress?: (val: boolean) => void,
645
+ autoCompleteAddress?: boolean,
646
+ manualZoom?: boolean
640
647
  }
641
648
 
642
649
  export interface HelpParams {
@@ -4,6 +4,7 @@ import FontAwesome from 'react-native-vector-icons/FontAwesome';
4
4
  import { CODES } from 'ordering-components/native'
5
5
  import { ORDER_TYPES } from '../config/constants';
6
6
  import { useTheme } from 'styled-components/native';
7
+ import ReactNativeHapticFeedback from "react-native-haptic-feedback";
7
8
 
8
9
  const [languageState, t] = useLanguage();
9
10
  const theme = useTheme()
@@ -258,7 +259,7 @@ export const sortInputFields = ({ fields, values }: any) => {
258
259
 
259
260
  fieldsBase.forEach((f: any) => {
260
261
  fieldsArray && fieldsArray.forEach((field: any) => {
261
- if (f === field.code) {
262
+ if (f === (field.validation_field?.code || field?.code)) {
262
263
  fieldsSorted.push(field)
263
264
  }
264
265
  })
@@ -567,6 +568,24 @@ export const getOrderStatus = (s: string) => {
567
568
  slug: 'ORDER_DRIVER_ON_WAY',
568
569
  percentage: 0.8,
569
570
  image: theme.images.order.status8
571
+ },
572
+ {
573
+ key: 24,
574
+ value: t('ORDER_DRIVER_WAITING_FOR_ORDER', 'Driver waiting for order'),
575
+ slug: 'ORDER_DRIVER_WAITING_FOR_ORDER',
576
+ percentage: 0.25
577
+ },
578
+ {
579
+ key: 25,
580
+ value: t('ORDER_ACCEPTED_BY_DRIVER_COMPANY', 'Accepted by driver company'),
581
+ slug: 'ORDER_ACCEPTED_BY_DRIVER_COMPANY',
582
+ percentage: 0.25
583
+ },
584
+ {
585
+ key: 26,
586
+ value: t('ORDER_DRIVER_ARRIVED_CUSTOMER', 'Driver arrived to customer'),
587
+ slug: 'ORDER_DRIVER_ARRIVED_CUSTOMER',
588
+ percentage: 0.8
570
589
  }
571
590
  ];
572
591
 
@@ -725,3 +744,13 @@ export const lightenDarkenColor = (color: any) => {
725
744
  return false
726
745
  }
727
746
  }
747
+
748
+ export const vibrateApp = (impact ?: string) => {
749
+ const options = {
750
+ enableVibrateFallback: true,
751
+ ignoreAndroidSystemSettings: false
752
+ };
753
+
754
+ ReactNativeHapticFeedback.trigger(impact || "impactLight", options);
755
+
756
+ }
@@ -144,7 +144,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
144
144
  {isFarAway && (
145
145
  <FarAwayMessage style={styles.farAwayMsg}>
146
146
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
147
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
147
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
148
148
  </FarAwayMessage>
149
149
  )}
150
150
  <View style={styles.wrapperOrderOptions}>