ordering-ui-react-native 0.21.78 → 0.21.79-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 (165) 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/PaymentOptionsWebView/index.tsx +1 -0
  5. package/src/components/StripeMethodForm/index.tsx +6 -4
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/types/index.tsx +3 -1
  8. package/themes/business/index.tsx +4 -0
  9. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
  10. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
  11. package/themes/business/src/components/BusinessProductList/index.tsx +2 -1
  12. package/themes/business/src/components/Chat/index.tsx +3 -1
  13. package/themes/business/src/components/DriverMap/index.tsx +44 -27
  14. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  15. package/themes/business/src/components/Home/index.tsx +5 -1
  16. package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
  17. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  18. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  19. package/themes/business/src/components/MapView/index.tsx +36 -17
  20. package/themes/business/src/components/NewOrderNotification/index.tsx +74 -24
  21. package/themes/business/src/components/OrderDetails/Business.tsx +65 -7
  22. package/themes/business/src/components/OrderDetails/Delivery.tsx +35 -20
  23. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +110 -40
  24. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +61 -35
  25. package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
  26. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  27. package/themes/business/src/components/OrderSummary/index.tsx +222 -72
  28. package/themes/business/src/components/OrdersListManager/index.tsx +9 -1
  29. package/themes/business/src/components/OrdersOption/index.tsx +247 -159
  30. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  31. package/themes/business/src/components/PreviousMessages/index.tsx +12 -0
  32. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +25 -15
  33. package/themes/business/src/components/PreviousOrders/index.tsx +5 -3
  34. package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
  35. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  36. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  37. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
  38. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  39. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  40. package/themes/business/src/components/Sessions/index.tsx +187 -0
  41. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  42. package/themes/business/src/components/StoresList/index.tsx +2 -2
  43. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  44. package/themes/business/src/components/UserProfileForm/index.tsx +84 -47
  45. package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
  46. package/themes/business/src/components/shared/OInput.tsx +2 -0
  47. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  48. package/themes/business/src/hooks/useLocation.tsx +5 -4
  49. package/themes/business/src/types/index.tsx +23 -5
  50. package/themes/business/src/utils/index.tsx +19 -1
  51. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  52. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  53. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  54. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  55. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  56. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  57. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  58. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  59. package/themes/original/index.tsx +13 -1
  60. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  61. package/themes/original/src/components/AddressForm/index.tsx +32 -17
  62. package/themes/original/src/components/AddressList/index.tsx +8 -7
  63. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  64. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  65. package/themes/original/src/components/BusinessBasicInformation/index.tsx +6 -9
  66. package/themes/original/src/components/BusinessController/index.tsx +12 -7
  67. package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
  68. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +2 -3
  69. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +1 -3
  70. package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
  71. package/themes/original/src/components/BusinessPreorder/index.tsx +20 -15
  72. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +5 -5
  73. package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
  74. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  75. package/themes/original/src/components/BusinessProductsListing/index.tsx +18 -6
  76. package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
  77. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  78. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -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 +38 -11
  82. package/themes/original/src/components/CartContent/index.tsx +21 -8
  83. package/themes/original/src/components/Checkout/index.tsx +108 -60
  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/GiftCardOrdersList/index.tsx +64 -0
  91. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  92. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
  93. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
  94. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
  95. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
  96. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  97. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  98. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +82 -0
  99. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  100. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  101. package/themes/original/src/components/Help/index.tsx +2 -0
  102. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  103. package/themes/original/src/components/Home/index.tsx +2 -10
  104. package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
  105. package/themes/original/src/components/LoginForm/index.tsx +4 -7
  106. package/themes/original/src/components/MessageListing/index.tsx +1 -0
  107. package/themes/original/src/components/Messages/index.tsx +8 -7
  108. package/themes/original/src/components/MomentOption/index.tsx +13 -2
  109. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  110. package/themes/original/src/components/MultiCheckout/index.tsx +139 -87
  111. package/themes/original/src/components/MultiOrdersDetails/index.tsx +2 -1
  112. package/themes/original/src/components/MyOrders/index.tsx +21 -26
  113. package/themes/original/src/components/NavBar/index.tsx +4 -2
  114. package/themes/original/src/components/NetworkError/index.tsx +0 -5
  115. package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
  116. package/themes/original/src/components/OrderDetails/OrderEta.tsx +1 -1
  117. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +5 -7
  118. package/themes/original/src/components/OrderDetails/index.tsx +27 -10
  119. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  120. package/themes/original/src/components/OrderProgress/index.tsx +22 -3
  121. package/themes/original/src/components/OrderSummary/index.tsx +28 -9
  122. package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
  123. package/themes/original/src/components/OrdersOption/index.tsx +2 -4
  124. package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
  125. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  126. package/themes/original/src/components/PaymentOptions/index.tsx +17 -9
  127. package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
  128. package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
  129. package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
  130. package/themes/original/src/components/ProductForm/index.tsx +107 -102
  131. package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -49
  132. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  133. package/themes/original/src/components/ProductOptionSubOption/index.tsx +8 -1
  134. package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
  135. package/themes/original/src/components/Promotions/index.tsx +6 -9
  136. package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
  137. package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
  138. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  139. package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
  140. package/themes/original/src/components/ServiceForm/index.tsx +52 -54
  141. package/themes/original/src/components/Sessions/index.tsx +3 -3
  142. package/themes/original/src/components/SignupForm/index.tsx +86 -78
  143. package/themes/original/src/components/SingleOrderCard/index.tsx +1 -2
  144. package/themes/original/src/components/SingleProductCard/index.tsx +3 -4
  145. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  146. package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
  147. package/themes/original/src/components/StripeCardsList/index.tsx +10 -3
  148. package/themes/original/src/components/StripeElementsForm/index.tsx +77 -60
  149. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  150. package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
  151. package/themes/original/src/components/TaxInformation/index.tsx +3 -2
  152. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
  153. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
  154. package/themes/original/src/components/UserDetails/index.tsx +3 -2
  155. package/themes/original/src/components/UserFormDetails/index.tsx +155 -131
  156. package/themes/original/src/components/UserProfile/index.tsx +11 -2
  157. package/themes/original/src/components/Wallets/index.tsx +6 -3
  158. package/themes/original/src/components/WebsocketStatus/index.tsx +169 -0
  159. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  160. package/themes/original/src/components/shared/OAlert.tsx +2 -1
  161. package/themes/original/src/components/shared/OButton.tsx +5 -4
  162. package/themes/original/src/components/shared/OInput.tsx +4 -8
  163. package/themes/original/src/types/index.tsx +5 -1
  164. package/themes/original/src/utils/index.tsx +12 -1
  165. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -57,8 +57,9 @@ export interface ProfileParams {
57
57
  showField?: any;
58
58
  isRequiredField?: any;
59
59
  isAlsea?: boolean;
60
- isHideDriverStatus?: boolean;
60
+ isShowDriverStatus?: boolean;
61
61
  isFocused?: boolean;
62
+ isBusinessApp?: boolean;
62
63
  }
63
64
 
64
65
  export interface AddressListParams {
@@ -303,15 +304,16 @@ export interface OrdersOptionParams {
303
304
  filtered?: any;
304
305
  handleClickOrder?: any;
305
306
  orderGroupStatusCustom?: {
307
+ active?: Array<number>;
306
308
  pending?: Array<number>;
307
309
  inProgress?: Array<number>;
308
310
  completed?: Array<number>;
309
311
  cancelled?: Array<number>;
310
312
  };
311
313
  isBusinessApp?: boolean;
312
- handleClickLogisticOrder: (status: number, orderId: number) => void,
313
- logisticOrders: { orders: Array<any>, loading: boolean, error: Array<string> | string },
314
- loadLogisticOrders: () => void;
314
+ handleClickLogisticOrder?: (status: number, orderId: number) => void,
315
+ logisticOrders?: { orders: Array<any>, loading: boolean, error: Array<string> | string },
316
+ loadLogisticOrders?: () => void;
315
317
  isLogisticActivated?: boolean;
316
318
  isAlsea?: boolean;
317
319
  checkNotification?: boolean;
@@ -319,6 +321,10 @@ export interface OrdersOptionParams {
319
321
  handleChangeOrderStatus?: () => void;
320
322
  handleSendCustomerReview?: () => void;
321
323
  orderDetailsProps?: any;
324
+ isNetConnected?: boolean;
325
+ isDriverApp?: boolean;
326
+ combineTabs?: boolean;
327
+ setCombineTabsState?: any;
322
328
  }
323
329
  export interface ActiveOrdersParams {
324
330
  orders?: any;
@@ -390,7 +396,7 @@ export interface OrderDetailsParams {
390
396
  urlToShare?: string;
391
397
  messages?: any;
392
398
  handleAssignDriver?: (id: any) => {};
393
- handleChangeOrderStatus?: (status: any) => {};
399
+ handleChangeOrderStatus?: (status: any, isAcceptOrReject: any) => {};
394
400
  order?: any;
395
401
  isFromRoot?: any;
396
402
  handleOrderRedirect?: () => {};
@@ -409,6 +415,8 @@ export interface OrderDetailsParams {
409
415
  orderTitle?: any;
410
416
  forceUpdate?: number;
411
417
  getPermissions?: any
418
+ loadMessages?: any;
419
+ notificationApp?: string
412
420
  }
413
421
  export interface ProductItemAccordionParams {
414
422
  isCartPending?: boolean;
@@ -444,6 +452,7 @@ export interface MessagesParams {
444
452
  sendMessage?: any;
445
453
  canRead?: any;
446
454
  setCanRead?: any;
455
+ notificationApp?: string
447
456
  handleSend?: () => {};
448
457
  setImage?: (image: string | null) => {};
449
458
  setMessage?: (comment: string) => {};
@@ -595,6 +604,7 @@ export interface AcceptOrRejectOrderParams {
595
604
  isPage?: boolean
596
605
  navigation?: any
597
606
  route?: any
607
+ isLoadingOrder?: boolean
598
608
  }
599
609
 
600
610
  export interface MapViewParams {
@@ -629,3 +639,11 @@ export interface OrderDetailsLogisticParams {
629
639
  orderAssingId: number,
630
640
  order: any
631
641
  }
642
+
643
+ export interface SessionsParams {
644
+ navigation: any,
645
+ sessionsList: any,
646
+ actionState: any,
647
+ handleDeleteSession: any,
648
+ handleDeleteAllSessions: any
649
+ }
@@ -39,7 +39,8 @@ export const getTraduction = (key: string, t: any) => {
39
39
  ERROR_USER_UPDATE_YOU_HAVE_ASSIGNED_ORDERS:
40
40
  "You can't because you have assigned orders",
41
41
  ERROR_INVALID_OFFER: 'The offer doesn\'t exist',
42
- ERROR_AUTH_DRIVER_LOGIN_VALIDATION: 'Error auth driver login validation'
42
+ ERROR_AUTH_DRIVER_LOGIN_VALIDATION: 'Error auth driver login validation',
43
+ ERROR_DRIVER_UPDATE_SCHEDULE: 'Error driver update schedule',
43
44
  };
44
45
 
45
46
  return keyList[key] ? t(key, keyList[key]) : t(key);
@@ -146,6 +147,11 @@ export const transformCountryCode = (countryCode: number) => {
146
147
  return code?.countryCode;
147
148
  };
148
149
 
150
+ export const findExitingCode = (countryCode: string) => {
151
+ const code = CODES.find((code: any) => code.countryCode === (countryCode || '').toUpperCase())
152
+ return code?.countryCode
153
+ }
154
+
149
155
  /**
150
156
  * Function to check if a number is decimal or not
151
157
  * @param {*} value number to check if decimal or not
@@ -338,6 +344,18 @@ export const getOrderStatus = (s: string, t: any) => {
338
344
  value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
339
345
  slug: 'ORDER_DRIVER_ON_WAY',
340
346
  percentage: 45
347
+ },
348
+ {
349
+ key: 24,
350
+ value: t('ORDER_DRIVER_WAITING_FOR_ORDER', 'Driver waiting for order'),
351
+ slug: 'ORDER_DRIVER_WAITING_FOR_ORDER',
352
+ percentage: 25
353
+ },
354
+ {
355
+ key: 25,
356
+ value: t('ORDER_ACCEPTED_BY_DRIVER_COMPANY', 'Accepted by driver company'),
357
+ slug: 'ORDER_ACCEPTED_BY_DRIVER_COMPANY',
358
+ percentage: 25
341
359
  }
342
360
  ];
343
361
 
@@ -197,7 +197,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
197
197
  {isFarAway && (
198
198
  <FarAwayMessage style={styles.farAwayMsg}>
199
199
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
200
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
200
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
201
201
  </FarAwayMessage>
202
202
  )}
203
203
  {!auth && (
@@ -410,8 +410,7 @@ const LoginFormUI = (props: LoginParams) => {
410
410
  textInputProps={{
411
411
  returnKeyType: 'next',
412
412
  onSubmitEditing: () => inputRef?.current?.focus?.(),
413
- style: { borderWidth: 0, fontSize: 12 },
414
- maxLength: 10
413
+ style: { borderWidth: 0, fontSize: 12 }
415
414
  }}
416
415
  textWrapStyle={{ borderColor: theme.colors.clear, borderWidth: 0, height: 40, paddingStart: 0 }}
417
416
  />
@@ -155,7 +155,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
155
155
  {isFarAway && (
156
156
  <FarAwayMessage style={styles.farAwayMsg}>
157
157
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
158
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
158
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
159
159
  </FarAwayMessage>
160
160
  )}
161
161
  <View style={styles.wrapperOrderOptions}>
@@ -50,6 +50,12 @@ const CheckoutUI = (props: any) => {
50
50
  }
51
51
  }, [cart])
52
52
 
53
+ useEffect(() => {
54
+ if (!cartState.loading && cart && !cart?.valid && cart?.status === 2) {
55
+ navigation?.canGoBack() && navigation.goBack()
56
+ }
57
+ }, [cart])
58
+
53
59
  return (
54
60
  <>
55
61
  <PaymentOptions
@@ -4,6 +4,7 @@ import { OIcon, OButton, OText } from '../shared'
4
4
  import { ImageStyle, TextStyle, View, Platform, TouchableOpacity } from 'react-native'
5
5
  import { useConfig, useLanguage, useOrder } from 'ordering-components/native'
6
6
  import { useTheme } from 'styled-components/native'
7
+
7
8
  const Wrapper = styled.View`
8
9
  background-color: ${(props: any) => props.theme.colors.white};
9
10
  padding: 10px 0px 20px 0px;
@@ -65,28 +66,27 @@ const NavBar = (props: Props) => {
65
66
 
66
67
  return (
67
68
  <Wrapper style={{ paddingTop: props.paddingTop, ...props.style }}>
68
- {(props?.onActionLeft) && (
69
+ {(props?.onActionLeft || props?.leftImg) && (
69
70
  <OButton
70
- imgLeftSrc={props.leftImg}
71
+ imgLeftSrc={props.leftImg || theme.images.general.arrow_left}
71
72
  imgRightSrc={null}
72
73
  style={{ ...btnBackArrow, ...props.btnStyle }}
73
74
  onClick={props.onActionLeft}
74
- imgLeftStyle={props.imgLeftStyle}
75
- {...(!props.leftImg && { iconProps: { name: 'arrowleft', size: 28, color: props.btnStyle?.color } })}
75
+ imgLeftStyle= {props.imgLeftStyle}
76
76
  />)
77
77
  }
78
78
  <TitleTopWrapper>
79
79
  {props.withIcon
80
80
  ? (
81
- <OIcon
82
- url={props.icon}
83
- style={{
84
- borderColor: theme.colors.lightGray,
85
- borderRadius: 20,
86
- }}
87
- width={60}
88
- height={60}
89
- />
81
+ <OIcon
82
+ url={props.icon}
83
+ style={{
84
+ borderColor: theme.colors.lightGray,
85
+ borderRadius: 20,
86
+ }}
87
+ width={60}
88
+ height={60}
89
+ />
90
90
  )
91
91
  : null
92
92
  }
@@ -134,7 +134,7 @@ const NavBar = (props: Props) => {
134
134
  </View>
135
135
  )}
136
136
 
137
- {props.rightComponent}
137
+ { props.rightComponent }
138
138
  </Wrapper>
139
139
  )
140
140
  }
@@ -95,7 +95,7 @@ interface Props {
95
95
  style?: ViewStyle;
96
96
  bgImage: ImageSourcePropType;
97
97
  innerStyle?: ViewStyle;
98
- icon?: ImageSourcePropType;
98
+ icon: ImageSourcePropType;
99
99
  iconStyle?: ImageStyle;
100
100
  callToActionText: string;
101
101
  callToActionTextStyle?: TextStyle;
@@ -15,8 +15,6 @@ import { Container } from '../../layouts/Container'
15
15
  import NavBar from '../NavBar'
16
16
  import { LANDSCAPE, PORTRAIT, useDeviceOrientation } from '../../../../../src/hooks/DeviceOrientation'
17
17
  import GridContainer from '../../layouts/GridContainer'
18
- import AntDesignIcon from 'react-native-vector-icons/AntDesign'
19
- import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons'
20
18
 
21
19
  const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
22
20
  const {
@@ -29,7 +27,7 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
29
27
  callback
30
28
  } = props
31
29
 
32
- const theme = useTheme();
30
+ const theme = useTheme();
33
31
  const [, t] = useLanguage();
34
32
  const [orientationState] = useDeviceOrientation();
35
33
  const [orderState] = useOrder()
@@ -47,7 +45,7 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
47
45
  }
48
46
 
49
47
  useEffect(() => {
50
- if (isCardCliked) {
48
+ if(isCardCliked){
51
49
  callback?.()
52
50
  setIsCardClicked(false)
53
51
  setIsLoadingCard(null)
@@ -85,13 +83,13 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
85
83
  style={cardStyle}
86
84
  isDisabled={isCardCliked}
87
85
  isLoading={isLoadingCard === 'Eat In'}
88
- title={t('EAT_IN', 'Eat In')}
86
+ title={t('EAT_IN','Eat In')}
89
87
  description={t('EAT_IN_DESCRIPTION', 'We are very glad to have you here. Bon appetit!')}
90
88
  bgImage={theme.images.general.eatIn}
91
- VectorIcon={() => <MaterialIcon name='pin-outline' size={28} color='white' style={{ marginBottom: 10 }} />}
89
+ icon={theme.images.general.pushPin}
92
90
  callToActionText={t('START_MY_ORDER', 'Start my order')}
93
91
  onClick={() => {
94
- if (_eatIn?.value !== orderState?.options?.type) {
92
+ if(_eatIn?.value !== orderState?.options?.type){
95
93
  handleChangeOrderType(_eatIn?.value);
96
94
  setIsCardClicked(true)
97
95
  setIsLoadingCard('Eat In')
@@ -108,15 +106,15 @@ const OrderTypeSelectorCardUI = (props: OrderTypeSelectParams) => {
108
106
 
109
107
  <OptionCard
110
108
  style={cardStyle}
111
- title={t('TAKE_OUT', 'Take out')}
109
+ title={t('TAKE_OUT','Take out')}
112
110
  isDisabled={isCardCliked}
113
111
  isLoading={isLoadingCard === 'Take out'}
114
112
  description={t('TAKE_OUT_DESCRIPTION', 'You are very welcome anytime you visit us!')}
115
113
  bgImage={theme.images.general.takeOut}
116
- VectorIcon={() => <AntDesignIcon name='shoppingcart' size={28} color='white' style={{ marginBottom: 10 }} />}
114
+ icon={theme.images.general.shoppingCart}
117
115
  callToActionText={t('START_MY_ORDER', 'Start my order')}
118
116
  onClick={() => {
119
- if (_takeOut?.value !== orderState?.options?.type) {
117
+ if(_takeOut?.value !== orderState?.options?.type){
120
118
  handleChangeOrderType(_takeOut?.value);
121
119
  setIsCardClicked(true)
122
120
  setIsLoadingCard('Take out')
@@ -10,8 +10,6 @@ import {
10
10
 
11
11
  import * as React from 'react';
12
12
  import styled from 'styled-components/native';
13
- import AntDesignIcon from 'react-native-vector-icons/AntDesign'
14
- import { Icon, IconProps } from 'react-native-vector-icons/Icon';
15
13
 
16
14
  const StyledButton = styled.View<Props>`
17
15
  background-color: ${(props: any) => props.theme.colors.primary};
@@ -79,19 +77,17 @@ interface Props {
79
77
  isCircle?: boolean;
80
78
  bgColor?: string;
81
79
  borderColor?: string;
82
- iconProps?: IconProps;
83
- IconCustom?: React.FunctionComponent
84
80
  }
85
81
 
86
82
  const OButton = (props: Props): React.ReactElement => {
87
83
  if (props.isDisabled) {
88
84
  return (
89
85
  <View style={props.parentStyle}>
90
- <StyledButtonDisabled style={props.style}>
91
- <StyledTextDisabled style={props.disabledTextStyle ? props.disabledTextStyle : props.textStyle}>
92
- {props.text}
93
- </StyledTextDisabled>
94
- </StyledButtonDisabled>
86
+ <StyledButtonDisabled style={props.style}>
87
+ <StyledTextDisabled style={props.disabledTextStyle ? props.disabledTextStyle : props.textStyle}>
88
+ {props.text}
89
+ </StyledTextDisabled>
90
+ </StyledButtonDisabled>
95
91
  </View>
96
92
  );
97
93
  }
@@ -115,15 +111,6 @@ const OButton = (props: Props): React.ReactElement => {
115
111
  {props.imgLeftSrc ? (
116
112
  <StyledImage style={props.imgLeftStyle} source={props.imgLeftSrc} />
117
113
  ) : null}
118
- {props.iconProps ? (
119
- <>
120
- {props?.IconCustom ? (
121
- <props.IconCustom {...props.iconProps} />
122
- ) : (
123
- <AntDesignIcon {...props.iconProps} />
124
- )}
125
- </>
126
- ) : null}
127
114
  {props.text ? (
128
115
  <StyledText style={props.textStyle}>{props.text}</StyledText>
129
116
  ) : null}
@@ -19,6 +19,7 @@ import { Favorite } from './src/components/Favorite';
19
19
  import { FavoriteList } from './src/components/FavoriteList';
20
20
  import { FloatingButton } from './src/components/FloatingButton';
21
21
  import { ForgotPasswordForm } from './src/components/ForgotPasswordForm';
22
+ import { GPSButton } from './src/components/GPSButton';
22
23
  import { MomentOption } from './src/components/MomentOption';
23
24
  import { OrdersOption } from './src/components/OrdersOption';
24
25
  import { OrderDetails } from './src/components/OrderDetails';
@@ -85,6 +86,7 @@ import { VerifyPhone } from './src/components/VerifyPhone';
85
86
  import { GoogleLogin } from './src/components/GoogleLogin';
86
87
  import { PreviousOrders } from './src/components/PreviousOrders';
87
88
  import { PaymentOptionCash } from './src/components/PaymentOptionCash';
89
+ import { SendGiftCard } from './src/components/GiftCard/SendGiftCard';
88
90
  import { StripeElementsForm } from './src/components/StripeElementsForm';
89
91
  import { StripeCardsList } from './src/components/StripeCardsList';
90
92
  import { ProductIngredient } from './src/components/ProductIngredient';
@@ -100,12 +102,14 @@ import { PageBanner } from './src/components/PageBanner'
100
102
  import { MultiCart } from './src/components/MultiCart'
101
103
  import { USER_TYPE, ORDER_TYPES } from './src/config/constants'
102
104
  import { DatePickerUI } from './src/components/DatePicker'
103
-
105
+ import { WebsocketStatus } from './src/components/WebsocketStatus';
104
106
  import { OSBill, OSTable, OSCoupon, OSTotal, OSRow } from './src/components/OrderSummary/styles';
105
107
 
106
108
  import { FormInput, FormSide, ButtonsWrapper, LoginWith, OTab, OTabs } from './src/components/LoginForm/styles';
107
109
  import { OSItem, OSItemContent, OSItemActions } from './src/components/PaymentOptionStripe/styles';
108
110
 
111
+ import { orderTypeList, getTraduction, verifyDecimals, getOrderStatus, getOrderStatuPickUp } from './src/utils'
112
+
109
113
  import Alert from './src/providers/AlertProvider'
110
114
 
111
115
  import {
@@ -182,6 +186,7 @@ export {
182
186
  Checkout,
183
187
  Favorite,
184
188
  FavoriteList,
189
+ GPSButton,
185
190
  ForgotPasswordForm,
186
191
  MomentOption,
187
192
  OrdersOption,
@@ -256,6 +261,7 @@ export {
256
261
  ProductIngredient,
257
262
  ProductOption,
258
263
  ProductOptionSubOption,
264
+ SendGiftCard,
259
265
  Sessions,
260
266
  SingleProductReview,
261
267
  LogoutButton,
@@ -265,6 +271,7 @@ export {
265
271
  PageBanner,
266
272
  MyOrders,
267
273
  MultiCart,
274
+ WebsocketStatus,
268
275
  ORDER_TYPES,
269
276
  USER_TYPE,
270
277
 
@@ -342,6 +349,11 @@ export {
342
349
  _setStoreData,
343
350
  _removeStoreData,
344
351
  _clearStoreData,
352
+ orderTypeList,
353
+ getTraduction,
354
+ verifyDecimals,
355
+ getOrderStatus,
356
+ getOrderStatuPickUp,
345
357
 
346
358
  // Date Picker
347
359
  DatePickerUI
@@ -1,30 +1,40 @@
1
1
  import React from 'react';
2
2
  import FastImage from 'react-native-fast-image'
3
- import { StyleSheet, TouchableOpacity, View } from 'react-native';
3
+ import { StyleSheet, TouchableOpacity, useWindowDimensions } from 'react-native';
4
4
  import {
5
5
  AddressDetails as AddressDetailsController,
6
6
  useOrder,
7
7
  useLanguage,
8
8
  } from 'ordering-components/native';
9
+ import { useTheme } from 'styled-components/native';
9
10
 
10
11
  import { ADContainer, ADHeader, ADAddress, ADMap } from './styles';
11
-
12
- import { useTheme } from 'styled-components/native';
13
- import { OText, OIcon } from '../shared';
14
- import { useWindowDimensions } from 'react-native';
12
+ import { OText } from '../shared';
13
+ import { getTypesText } from '../../utils';
15
14
 
16
15
  const AddressDetailsUI = (props: any) => {
17
- const { navigation, addressToShow, isCartPending, googleMapsUrl, apiKey } =
18
- props;
16
+ const {
17
+ navigation,
18
+ addressToShow,
19
+ isCartPending,
20
+ googleMapsUrl,
21
+ apiKey
22
+ } = props;
19
23
 
20
24
  const theme = useTheme();
21
25
  const [orderState] = useOrder();
26
+ const [{ options }] = useOrder();
22
27
  const [, t] = useLanguage();
23
28
  const { width } = useWindowDimensions();
24
29
 
30
+ const orderTypeText = {
31
+ key: getTypesText(options?.type || 1),
32
+ value: t(getTypesText(options?.type || 1), 'Delivery')
33
+ }
34
+
25
35
  const styles = StyleSheet.create({
26
36
  productStyle: {
27
- width: width,
37
+ width,
28
38
  height: 151,
29
39
  marginVertical: 10
30
40
  }
@@ -39,13 +49,13 @@ const AddressDetailsUI = (props: any) => {
39
49
  lineHeight={24}
40
50
  color={theme.colors.textNormal}
41
51
  >
42
- {t('DELIVERY_ADDRESS', 'Delivery address')}
52
+ {t(`${orderTypeText.key}_ADDRESS`, `${orderTypeText.value} address`)}
43
53
  </OText>
44
54
  )}
45
55
  </ADHeader>
46
56
  {!!apiKey && googleMapsUrl && (
47
57
  <ADMap
48
- style={{ marginStart: -40, marginEnd: -40, width: width, flex: 1 }}>
58
+ style={{ width, flex: 1, marginStart: -20, marginEnd: -20, }}>
49
59
  <FastImage
50
60
  style={styles.productStyle}
51
61
  source={{
@@ -66,7 +66,9 @@ const AddressFormUI = (props: AddressFormParams) => {
66
66
  isFromProductsList,
67
67
  hasAddressDefault,
68
68
  afterSignup,
69
- businessSlug
69
+ businessSlug,
70
+ isFromCheckout,
71
+ onNavigationRedirect
70
72
  } = props;
71
73
 
72
74
  const theme = useTheme();
@@ -132,6 +134,7 @@ const AddressFormUI = (props: AddressFormParams) => {
132
134
  const [configState] = useConfig();
133
135
  const [orderState] = useOrder();
134
136
  const { handleSubmit, errors, control, setValue } = useForm();
137
+ const [autoCompleteAddress, setAutoCompleteAddress] = useState(false)
135
138
 
136
139
  const [toggleMap, setToggleMap] = useState(false);
137
140
  const [alertState, setAlertState] = useState<{
@@ -172,6 +175,8 @@ const AddressFormUI = (props: AddressFormParams) => {
172
175
  const isHideMap = theme?.address?.components?.map?.hidden
173
176
  const isHideIcons = theme?.address?.components?.icons?.hidden
174
177
  const continueAsGuest = () => navigation.navigate(!!businessSlug ? 'Business' : 'BusinessList', { isGuestUser: true });
178
+ const unaddressedTypes = configState?.configs?.unaddressed_order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
179
+ const isAllowUnaddressOrderType = unaddressedTypes.includes(orderState?.options?.type)
175
180
  const goToBack = () => navigation?.canGoBack() && navigation.goBack();
176
181
 
177
182
  const getAddressFormatted = (address: any) => {
@@ -351,9 +356,6 @@ const AddressFormUI = (props: AddressFormParams) => {
351
356
  map_data: { library: 'google', place_id: data.place_id },
352
357
  zip_code: data?.zip_code || null,
353
358
  };
354
- if (googleInput?.current) {
355
- googleInput?.current?.setAddressText(addressSelected.address);
356
- }
357
359
  updateChanges(addressSelected);
358
360
  };
359
361
 
@@ -371,6 +373,10 @@ const AddressFormUI = (props: AddressFormParams) => {
371
373
  setToggleMap(!toggleMap);
372
374
  };
373
375
 
376
+ const showFieldWithTheme = (name) => {
377
+ return !theme?.address?.components?.[name]?.hidden
378
+ }
379
+
374
380
  useEffect(() => {
375
381
  if (
376
382
  orderState.loading &&
@@ -379,9 +385,11 @@ const AddressFormUI = (props: AddressFormParams) => {
379
385
  auth &&
380
386
  !afterSignup
381
387
  ) {
382
- !isFromProductsList
383
- ? navigation.navigate('BottomTab')
384
- : navigation.navigate('Business');
388
+ isFromCheckout
389
+ ? navigation.goBack()
390
+ : !isFromProductsList
391
+ ? navigation.navigate('BottomTab')
392
+ : navigation.navigate('Business');
385
393
  }
386
394
  }, [orderState?.options?.address]);
387
395
 
@@ -520,6 +528,12 @@ const AddressFormUI = (props: AddressFormParams) => {
520
528
  setIsSignUpEffect(true);
521
529
  }, [orderState.loading]);
522
530
 
531
+ useEffect(() => {
532
+ if (isAllowUnaddressOrderType) {
533
+ onNavigationRedirect && onNavigationRedirect(!!businessSlug ? 'Business' : 'BusinessList')
534
+ }
535
+ }, [isAllowUnaddressOrderType])
536
+
523
537
  return (
524
538
  <ScrollView
525
539
  keyboardShouldPersistTaps='always'
@@ -565,6 +579,7 @@ const AddressFormUI = (props: AddressFormParams) => {
565
579
  placeholder={t('ADD_ADDRESS', 'Add a address')}
566
580
  onPress={(data, details: any) => {
567
581
  handleChangeAddress(data, details);
582
+ setAutoCompleteAddress(true);
568
583
  }}
569
584
  query={{
570
585
  key: googleMapsApiKey,
@@ -579,6 +594,7 @@ const AddressFormUI = (props: AddressFormParams) => {
579
594
  target: { name: 'address', value: text },
580
595
  });
581
596
  setValue('address', text);
597
+ setAutoCompleteAddress(true)
582
598
  }
583
599
  setIsFirstTime(false);
584
600
  setAddressEditing(text.length == 0);
@@ -666,13 +682,15 @@ const AddressFormUI = (props: AddressFormParams) => {
666
682
  setSaveLocation={setSaveMapLocation}
667
683
  handleToggleMap={handleToggleMap}
668
684
  isIntGeoCoder
685
+ setAutoCompleteAddress={setAutoCompleteAddress}
686
+ autoCompleteAddress={autoCompleteAddress}
669
687
  />
670
688
  </GoogleMapContainer>
671
689
  </View>
672
690
  )}
673
691
 
674
692
  <View style={{ flexDirection: 'row', flexBasis: '50%' }}>
675
- {showField && showField('internal_number') && (
693
+ {((isRequiredField && isRequiredField('internal_number')) || showFieldWithTheme('internal_number')) && (
676
694
  <Controller
677
695
  control={control}
678
696
  name="internal_number"
@@ -708,7 +726,7 @@ const AddressFormUI = (props: AddressFormParams) => {
708
726
  isFocusHighlight
709
727
  style={{
710
728
  ...styles.inputsStyle,
711
- marginRight: showField('internal_number') && showField('zipcode') ? 24 : 0
729
+ marginRight: showField?.('internal_number') && showField?.('zipcode') ? 24 : 0
712
730
  }}
713
731
  forwardRef={internalNumberRef}
714
732
  returnKeyType="next"
@@ -719,7 +737,7 @@ const AddressFormUI = (props: AddressFormParams) => {
719
737
  />
720
738
  )}
721
739
 
722
- {showField && showField('zipcode') && (
740
+ {((isRequiredField && isRequiredField('zipcode')) || showFieldWithTheme('zipcode')) && (
723
741
  <Controller
724
742
  control={control}
725
743
  name="zipcode"
@@ -764,7 +782,7 @@ const AddressFormUI = (props: AddressFormParams) => {
764
782
  )}
765
783
  </View>
766
784
 
767
- {showField && showField('address_notes') && (
785
+ {((isRequiredField && isRequiredField('address_notes')) || showFieldWithTheme('address_notes')) && (
768
786
  <Controller
769
787
  control={control}
770
788
  name="address_notes"
@@ -845,9 +863,6 @@ const AddressFormUI = (props: AddressFormParams) => {
845
863
  : t('LOADING', 'Loading')
846
864
  }
847
865
  onClick={handleSubmit(onSubmit)}
848
- bgColor={theme.colors.primary}
849
- borderColor={theme.colors.primary}
850
- textStyle={{ color: theme.colors.white }}
851
866
  isDisabled={formState.loading}
852
867
  style={{ borderRadius: 7.6, shadowOpacity: 0 }}
853
868
  showNextIcon
@@ -855,8 +870,9 @@ const AddressFormUI = (props: AddressFormParams) => {
855
870
  ) : (
856
871
  <OButton
857
872
  text={t('CANCEL', 'Cancel')}
858
- bgColor={theme.colors.white}
859
- borderColor={theme.colors.primary}
873
+ bgColor={theme.colors.secundary}
874
+ borderColor={theme.colors.secundary}
875
+ textStyle={{ color: theme.colors.textNormal }}
860
876
  style={{ borderRadius: 7.6, borderWidth: 1, shadowOpacity: 0 }}
861
877
  onClick={() => navigation?.canGoBack() && navigation.goBack()}
862
878
  />
@@ -882,7 +898,6 @@ const AddressFormUI = (props: AddressFormParams) => {
882
898
  )}
883
899
  <OButton
884
900
  text={t('SAVE', 'Save')}
885
- textStyle={{ color: theme.colors.white }}
886
901
  imgRightSrc={null}
887
902
  style={{ marginHorizontal: 30, marginBottom: 10 }}
888
903
  onClick={() => setSaveMapLocation(true)}