ordering-ui-react-native 0.14.92 → 0.14.94-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 (121) hide show
  1. package/package.json +6 -3
  2. package/src/DeliveryApp.tsx +32 -1
  3. package/src/components/BusinessTypeFilter/index.tsx +9 -2
  4. package/src/components/BusinessTypeFilter/styles.tsx +1 -1
  5. package/src/components/BusinessesListing/index.tsx +1 -1
  6. package/src/components/Cart/index.tsx +1 -1
  7. package/src/components/Checkout/index.tsx +0 -1
  8. package/src/components/Home/index.tsx +3 -5
  9. package/src/components/LanguageSelector/index.tsx +65 -97
  10. package/src/components/LanguageSelector/styles.tsx +4 -17
  11. package/src/components/Messages/index.tsx +38 -30
  12. package/src/components/MomentOption/index.tsx +3 -1
  13. package/src/components/OrderDetails/index.tsx +26 -5
  14. package/src/components/PaymentOptions/index.tsx +7 -16
  15. package/src/components/PaymentOptionsWebView/index.tsx +123 -124
  16. package/src/components/ProductForm/index.tsx +1 -1
  17. package/src/components/ProductForm/styles.tsx +1 -0
  18. package/src/components/StripeElementsForm/index.tsx +27 -48
  19. package/src/components/UserProfileForm/index.tsx +35 -1
  20. package/src/components/VerifyPhone/styles.tsx +1 -2
  21. package/src/config.json +0 -2
  22. package/src/pages/Checkout.tsx +1 -1
  23. package/src/providers/AlertProvider.tsx +4 -1
  24. package/src/types/index.tsx +2 -9
  25. package/src/utils/index.tsx +2 -1
  26. package/themes/business/index.tsx +2 -0
  27. package/themes/business/src/components/Chat/index.tsx +32 -31
  28. package/themes/business/src/components/OrderDetails/Business.tsx +1 -0
  29. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +85 -17
  30. package/themes/business/src/components/OrdersListManager/index.tsx +871 -0
  31. package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
  32. package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
  33. package/themes/business/src/components/OrdersOption/index.tsx +18 -68
  34. package/themes/business/src/components/OrdersOption/styles.tsx +2 -5
  35. package/themes/business/src/components/PreviousOrders/index.tsx +80 -23
  36. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  37. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  38. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  39. package/themes/kiosk/src/components/BusinessController/index.tsx +27 -6
  40. package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
  41. package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +51 -24
  42. package/themes/kiosk/src/components/Cart/index.tsx +1 -1
  43. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
  44. package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
  45. package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
  46. package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
  47. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +7 -5
  48. package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
  49. package/themes/kiosk/src/components/Intro/index.tsx +13 -13
  50. package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
  51. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  52. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  53. package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
  54. package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
  55. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
  56. package/themes/kiosk/src/components/ProductForm/index.tsx +172 -124
  57. package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
  58. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
  59. package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
  60. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
  61. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  62. package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
  63. package/themes/original/index.tsx +34 -6
  64. package/themes/original/src/components/AddressForm/index.tsx +15 -10
  65. package/themes/original/src/components/AddressList/index.tsx +27 -1
  66. package/themes/original/src/components/AnalyticsSegment/index.tsx +127 -0
  67. package/themes/original/src/components/BusinessBasicInformation/index.tsx +100 -45
  68. package/themes/original/src/components/BusinessController/index.tsx +34 -18
  69. package/themes/original/src/components/BusinessMenuList/index.tsx +14 -5
  70. package/themes/original/src/components/BusinessPreorder/index.tsx +142 -121
  71. package/themes/original/src/components/BusinessProductsCategories/index.tsx +7 -5
  72. package/themes/original/src/components/BusinessProductsList/index.tsx +52 -8
  73. package/themes/original/src/components/BusinessProductsListing/index.tsx +21 -15
  74. package/themes/original/src/components/BusinessReviews/index.tsx +4 -3
  75. package/themes/original/src/components/BusinessesListing/index.tsx +39 -52
  76. package/themes/original/src/components/Cart/index.tsx +42 -9
  77. package/themes/original/src/components/CartContent/index.tsx +2 -2
  78. package/themes/original/src/components/Checkout/index.tsx +56 -32
  79. package/themes/original/src/components/Checkout/styles.tsx +7 -0
  80. package/themes/original/src/components/CouponControl/index.tsx +1 -0
  81. package/themes/original/src/components/DriverTips/index.tsx +1 -1
  82. package/themes/original/src/components/ForgotPasswordForm/index.tsx +8 -12
  83. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +105 -90
  84. package/themes/original/src/components/LoginForm/index.tsx +83 -68
  85. package/themes/original/src/components/Messages/index.tsx +52 -45
  86. package/themes/original/src/components/Messages/styles.tsx +1 -3
  87. package/themes/original/src/components/MomentOption/index.tsx +127 -152
  88. package/themes/original/src/components/MomentOption/styles.tsx +42 -18
  89. package/themes/original/src/components/OrderDetails/index.tsx +103 -124
  90. package/themes/original/src/components/OrderDetails/styles.tsx +3 -1
  91. package/themes/original/src/components/OrderProgress/index.tsx +5 -6
  92. package/themes/original/src/components/OrderSummary/index.tsx +34 -1
  93. package/themes/original/src/components/OrdersOption/index.tsx +15 -46
  94. package/themes/original/src/components/OrdersOption/styles.tsx +0 -6
  95. package/themes/original/src/components/PaymentOptions/index.tsx +24 -25
  96. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -8
  97. package/themes/original/src/components/PlaceSpot/index.tsx +114 -0
  98. package/themes/original/src/components/PlaceSpot/styles.tsx +11 -0
  99. package/themes/original/src/components/PreviousOrders/index.tsx +19 -13
  100. package/themes/original/src/components/ProductForm/index.tsx +154 -105
  101. package/themes/original/src/components/ProductForm/styles.tsx +5 -3
  102. package/themes/original/src/components/ProductOptionSubOption/index.tsx +6 -1
  103. package/themes/original/src/components/ReviewOrder/index.tsx +10 -9
  104. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  105. package/themes/original/src/components/SignupForm/index.tsx +173 -154
  106. package/themes/original/src/components/SingleProductCard/index.tsx +6 -13
  107. package/themes/original/src/components/SingleProductCard/styles.tsx +1 -1
  108. package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
  109. package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
  110. package/themes/original/src/components/UserDetails/index.tsx +4 -95
  111. package/themes/original/src/components/UserFormDetails/index.tsx +2 -14
  112. package/themes/original/src/components/UserProfile/index.tsx +16 -11
  113. package/themes/original/src/components/UserProfileForm/index.tsx +16 -8
  114. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  115. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  116. package/themes/original/src/components/shared/HeaderTitle.tsx +20 -0
  117. package/themes/original/src/components/shared/index.tsx +2 -0
  118. package/themes/original/src/types/index.tsx +25 -9
  119. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +5 -5
  120. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  121. package/src/components/StripeMethodForm/index.tsx +0 -163
@@ -61,7 +61,6 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
61
61
  handleChangeSearch,
62
62
  businessId
63
63
  } = props;
64
-
65
64
  const theme = useTheme();
66
65
  const isFocused = useIsFocused();
67
66
  const appState = useRef(AppState.currentState)
@@ -119,7 +118,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
119
118
 
120
119
  const isPreorderEnabled = (configs?.preorder_status_enabled?.value === '1' || configs?.preorder_status_enabled?.value === 'true') &&
121
120
  Number(configs?.max_days_preorder?.value) > 0
122
-
121
+ const isPreOrderSetting = configs?.preorder_status_enabled?.value === '1'
123
122
  const timerId = useRef<any>(false)
124
123
  // const panResponder = useRef(
125
124
  // PanResponder.create({
@@ -165,25 +164,22 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
165
164
  return R * c
166
165
  }
167
166
 
168
- useEffect(() => {
169
- if (businessesList.businesses.length > 0) {
170
- const fb = businessesList.businesses.filter((b) => b.featured == true);
171
- const ary = [];
172
- while (fb.length > 0) {
173
- ary.push(fb.splice(0, 2));
174
- }
175
- setFeaturedBusinesses(ary);
176
- }
177
- }, [businessesList.businesses]);
178
-
179
167
  const resetInactivityTimeout = () => {
180
168
  clearTimeout(timerId.current)
181
169
  timerId.current = setInterval(() => {
182
170
  getBusinesses(true)
183
- }, 300000)
171
+ }, 120000)
184
172
  }
185
173
 
186
174
  useEffect(() => {
175
+ if (!businessesList?.loading) {
176
+ const fb = businessesList.businesses.filter((b) => b.featured === true && b?.open);
177
+ const ary = [];
178
+ while (fb.length > 0) {
179
+ ary.push(fb.splice(0, 2));
180
+ }
181
+ setFeaturedBusinesses(ary);
182
+ }
187
183
  resetInactivityTimeout()
188
184
  }, [businessesList.loading])
189
185
 
@@ -206,27 +202,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
206
202
  })
207
203
  }, [orderState?.options?.address?.location])
208
204
 
209
- useEffect(() => {
210
- const onFocusApp = (nextAppState: any) => {
211
- if (
212
- appState.current.match(/inactive|background/) &&
213
- nextAppState === "active"
214
- ) {
215
- getBusinesses(true);
216
- }
217
- appState.current = nextAppState;
218
- setAppStateVisible(appState.current);
219
- }
220
-
221
- AppState.addEventListener("change", onFocusApp);
222
- return () => {
223
- AppState.removeEventListener('change', onFocusApp);
224
- };
225
- }, [])
226
-
227
205
  useFocusEffect(
228
206
  useCallback(() => {
229
- getBusinesses(true)
230
207
  resetInactivityTimeout()
231
208
  return () => clearTimeout(timerId.current)
232
209
  }, [navigation])
@@ -287,25 +264,27 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
287
264
  style={{ marginStart: 8 }}
288
265
  />
289
266
  </WrapMomentOption>
290
- <WrapMomentOption
291
- onPress={() => handleMomentClick()}>
292
- <OText
293
- size={12}
294
- numberOfLines={1}
295
- ellipsizeMode="tail"
296
- color={theme.colors.textSecondary}>
297
- {orderState.options?.momentß
298
- ? parseDate(orderState.options?.moment, { outputFormat: configs?.dates_moment_format?.value })
299
- : t('ASAP_ABBREVIATION', 'ASAP')}
300
- </OText>
301
- {isPreorderEnabled && (
302
- <OIcon
303
- src={theme.images.general.arrow_down}
304
- width={10}
305
- style={{ marginStart: 8 }}
306
- />
307
- )}
308
- </WrapMomentOption>
267
+ {isPreOrderSetting && (
268
+ <WrapMomentOption
269
+ onPress={() => handleMomentClick()}>
270
+ <OText
271
+ size={12}
272
+ numberOfLines={1}
273
+ ellipsizeMode="tail"
274
+ color={theme.colors.textSecondary}>
275
+ {orderState.options?.momentß
276
+ ? parseDate(orderState.options?.moment, { outputFormat: configs?.dates_moment_format?.value })
277
+ : t('ASAP_ABBREVIATION', 'ASAP')}
278
+ </OText>
279
+ {isPreorderEnabled && (
280
+ <OIcon
281
+ src={theme.images.general.arrow_down}
282
+ width={10}
283
+ style={{ marginStart: 8 }}
284
+ />
285
+ )}
286
+ </WrapMomentOption>
287
+ )}
309
288
 
310
289
  {!businessId && (
311
290
  <SearchBar
@@ -397,6 +376,14 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
397
376
  handleCustomClick={handleBusinessClick}
398
377
  orderType={orderState?.options?.type}
399
378
  navigation={navigation}
379
+ businessHeader={business?.header}
380
+ businessFeatured={business?.featured}
381
+ businessLogo={business?.logo}
382
+ businessReviews={business?.reviews}
383
+ businessDeliveryPrice={business?.delivery_price}
384
+ businessDeliveryTime={business?.delivery_time}
385
+ businessPickupTime={business?.pickup_time}
386
+ businessDistance={business?.distance}
400
387
  />
401
388
  )
402
389
  )}
@@ -24,6 +24,7 @@ import AntIcon from 'react-native-vector-icons/AntDesign'
24
24
  import { TaxInformation } from '../TaxInformation';
25
25
  import { CartStoresListing } from '../CartStoresListing';
26
26
  import { OAlert } from '../../../../../src/components/shared'
27
+ import { PlaceSpot } from '../PlaceSpot'
27
28
 
28
29
  const CartUI = (props: any) => {
29
30
  const {
@@ -54,12 +55,14 @@ const CartUI = (props: any) => {
54
55
  const [canOpenUpselling, setCanOpenUpselling] = useState(false)
55
56
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, data: null, type: '' })
56
57
  const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
58
+ const [openPlaceModal, setOpenPlaceModal] = useState(false)
57
59
 
58
60
  const isCartPending = cart?.status === 2
59
61
  const isCouponEnabled = validationFields?.fields?.checkout?.coupon?.enabled
60
62
 
61
63
  const business: any = (orderState?.carts && Object.values(orderState.carts).find((_cart: any) => _cart?.uuid === props.cartuuid)) ?? {}
62
64
  const businessId = business?.business_id ?? null
65
+ const placeSpotTypes = [3, 4]
63
66
 
64
67
  const momentFormatted = !orderState?.option?.moment
65
68
  ? t('RIGHT_NOW', 'Right Now')
@@ -219,7 +222,7 @@ const CartUI = (props: any) => {
219
222
  </OSTable>
220
223
  ))
221
224
  }
222
- <Divider />
225
+ {/* <Divider /> */}
223
226
  {cart?.subtotal_with_discount > 0 && cart?.discount > 0 && cart?.total >= 0 && (
224
227
  <OSTable>
225
228
  <OText size={12} lineHeight={18} numberOfLines={1}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
@@ -252,7 +255,7 @@ const CartUI = (props: any) => {
252
255
  <OSRow>
253
256
  <OText size={12} lineHeight={18} numberOfLines={1}>
254
257
  {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
255
- ({parsePrice(fee?.fixed)} + {fee?.percentage}%){' '}
258
+ ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%){' '}
256
259
  </OText>
257
260
  <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })} >
258
261
  <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
@@ -353,6 +356,24 @@ const CartUI = (props: any) => {
353
356
  </OText>
354
357
  </OSTable>
355
358
  </OSTotal>
359
+ {placeSpotTypes.includes(orderState?.options?.type) && (
360
+ <OSTable style={{ marginTop: 15 }}>
361
+ <OText size={14} lineHeight={21} weight={'600'}>
362
+ {t('SPOT', 'Spot')}: {cart?.place?.name || t('NO_SELECTED', 'No selected')}
363
+ </OText>
364
+ <TouchableOpacity onPress={() => setOpenPlaceModal(true)}>
365
+ <OText
366
+ size={14}
367
+ lineHeight={21}
368
+ weight={'600'}
369
+ color={theme.colors.primary}
370
+ style={{ textDecorationLine: 'underline' }}
371
+ >
372
+ {t('EDIT', 'Edit')}
373
+ </OText>
374
+ </TouchableOpacity>
375
+ </OSTable>
376
+ )}
356
377
  {cart?.status !== 2 && (
357
378
  <OSTable>
358
379
  <View style={{ width: '100%', marginTop: 20 }}>
@@ -434,14 +455,26 @@ const CartUI = (props: any) => {
434
455
  products={cart?.products}
435
456
  />
436
457
  </OModal>
437
- <OAlert
438
- open={confirm.open}
439
- title={confirm.title}
440
- content={confirm.content}
441
- onAccept={confirm.handleOnAccept}
442
- onCancel={() => setConfirm({ ...confirm, open: false, title: null })}
443
- onClose={() => setConfirm({ ...confirm, open: false, title: null })}
458
+ <OModal
459
+ open={openPlaceModal}
460
+ title={t('CHOOSE_YOUR_SPOT', 'Choose your spot')}
461
+ onClose={() => setOpenPlaceModal(false)}
462
+ entireModal
463
+ >
464
+ <PlaceSpot
465
+ cart={cart}
466
+ isOpenPlaceSpot={openPlaceModal}
467
+ setOpenPlaceModal={setOpenPlaceModal}
444
468
  />
469
+ </OModal>
470
+ <OAlert
471
+ open={confirm.open}
472
+ title={confirm.title}
473
+ content={confirm.content}
474
+ onAccept={confirm.handleOnAccept}
475
+ onCancel={() => setConfirm({ ...confirm, open: false, title: null })}
476
+ onClose={() => setConfirm({ ...confirm, open: false, title: null })}
477
+ />
445
478
  </CContainer>
446
479
  )
447
480
  }
@@ -22,9 +22,9 @@ export const CartContent = (props: any) => {
22
22
  <CCContainer>
23
23
  {isOrderStateCarts && carts?.length > 0 && (
24
24
  <>
25
- <OText size={24} lineHeight={36} weight={'600'} style={{ marginBottom: 20 }}>
25
+ {/* <OText size={24} lineHeight={36} weight={'600'} style={{ marginBottom: 20 }}>
26
26
  {carts.length > 1 ? t('MY_CARTS', 'My Carts') : t('CART', 'Cart')}
27
- </OText>
27
+ </OText> */}
28
28
  {carts.map((cart: any, i: number) => (
29
29
  <CCList key={i} style={{ overflow: 'visible' }}>
30
30
  {cart.products.length > 0 && (
@@ -39,7 +39,8 @@ import {
39
39
  ChCart,
40
40
  DeliveryOptionsContainer,
41
41
  DeliveryOptionItem,
42
- WalletPaymentOptionContainer
42
+ WalletPaymentOptionContainer,
43
+ CartHeader
43
44
  } from './styles';
44
45
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
45
46
 
@@ -131,9 +132,11 @@ const CheckoutUI = (props: any) => {
131
132
  const [isDeliveryOptionModalVisible, setIsDeliveryOptionModalVisible] = useState(false)
132
133
  const [showGateway, setShowGateway] = useState<any>({ closedByUsed: false, open: false });
133
134
  const [webviewPaymethod, setWebviewPaymethod] = useState<any>(null)
134
-
135
-
135
+
136
+ const placeSpotTypes = [3, 4]
136
137
  const isWalletEnabled = configs?.wallet_enabled?.value === '1' && (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
138
+ const isPreOrder = configs?.preorder_status_enabled?.value === '1'
139
+ const isDisabledButtonPlace = loading || !cart?.valid || (!paymethodSelected && cart?.balance > 0) || placing || errorCash || cart?.subtotal < cart?.minimum || (placeSpotTypes.includes(options?.type) && !cart?.place)
137
140
 
138
141
  const driverTipsOptions = typeof configs?.driver_tip_options?.value === 'string'
139
142
  ? JSON.parse(configs?.driver_tip_options?.value) || []
@@ -149,6 +152,12 @@ const CheckoutUI = (props: any) => {
149
152
  }
150
153
  })
151
154
 
155
+ const handleMomentClick = () => {
156
+ if (isPreOrder) {
157
+ navigation.navigate('MomentOption')
158
+ }
159
+ }
160
+
152
161
  const handlePlaceOrder = () => {
153
162
  if (!userErrors.length) {
154
163
  handlerClickPlaceOrder && handlerClickPlaceOrder()
@@ -193,8 +202,8 @@ const CheckoutUI = (props: any) => {
193
202
  if (
194
203
  !user?.cellphone &&
195
204
  ((validationFields?.fields?.checkout?.cellphone?.enabled &&
196
- validationFields?.fields?.checkout?.cellphone?.required) ||
197
- configs?.verification_phone_required?.value === '1')
205
+ validationFields?.fields?.checkout?.cellphone?.required) ||
206
+ configs?.verification_phone_required?.value === '1')
198
207
  ) {
199
208
  errors.push(t('VALIDATION_ERROR_MOBILE_PHONE_REQUIRED', 'The field Phone number is required'))
200
209
  }
@@ -244,8 +253,8 @@ const CheckoutUI = (props: any) => {
244
253
  isVertical
245
254
  onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
246
255
  title={t('CHECKOUT', 'Checkout')}
247
- style={styles.pagePadding}
248
- titleStyle={{ marginLeft: 0, marginRight: 0 }}
256
+ titleStyle={{ marginLeft: 0, marginRight: 0, paddingLeft: 40 }}
257
+ btnStyle={{ marginLeft: 40, padding: 40 }}
249
258
  />
250
259
  <ChContainer style={styles.pagePadding}>
251
260
  <ChSection style={{ paddingTop: 0 }}>
@@ -260,7 +269,7 @@ const CheckoutUI = (props: any) => {
260
269
  />
261
270
  </CHMomentWrapper>
262
271
  <CHMomentWrapper
263
- onPress={() => navigation.navigate('MomentOption')}
272
+ onPress={() => handleMomentClick()}
264
273
  disabled={loading}
265
274
  >
266
275
  <OText size={12} numberOfLines={1} ellipsizeMode='tail' color={theme.colors.textSecondary}>
@@ -268,11 +277,13 @@ const CheckoutUI = (props: any) => {
268
277
  ? parseDate(options?.moment, { outputFormat: configs?.dates_moment_format?.value })
269
278
  : t('ASAP_ABBREVIATION', 'ASAP')}
270
279
  </OText>
271
- <OIcon
272
- src={theme.images.general.arrow_down}
273
- width={10}
274
- style={{ marginStart: 8 }}
275
- />
280
+ {isPreOrder && (
281
+ <OIcon
282
+ src={theme.images.general.arrow_down}
283
+ width={10}
284
+ style={{ marginStart: 8 }}
285
+ />
286
+ )}
276
287
  </CHMomentWrapper>
277
288
  </ChHeader>
278
289
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 18, marginHorizontal: -40 }} />
@@ -535,7 +546,6 @@ const CheckoutUI = (props: any) => {
535
546
  onNavigationRedirect={onNavigationRedirect}
536
547
  paySelected={paymethodSelected}
537
548
  handlePaymentMethodClickCustom={handlePaymentMethodClick}
538
- handlePlaceOrder={handlePlaceOrder}
539
549
  />
540
550
  </ChPaymethods>
541
551
  </ChSection>
@@ -561,9 +571,28 @@ const CheckoutUI = (props: any) => {
561
571
  />
562
572
  ) : (
563
573
  <>
564
- <OText size={16} lineHeight={24} color={theme.colors.textNormal}>
565
- {t('ORDER_SUMMARY', 'Order Summary')}
566
- </OText>
574
+ <CartHeader>
575
+ <OText
576
+ size={16}
577
+ lineHeight={24}
578
+ color={theme.colors.textNormal}
579
+ style={{ fontWeight: '500' }}
580
+ >
581
+ {t('MOBILE_FRONT_YOUR_ORDER', 'Your order')}
582
+ </OText>
583
+ <TouchableOpacity
584
+ onPress={() => onNavigationRedirect('Business', { store: cart?.business?.slug })}
585
+ >
586
+ <OText
587
+ size={10}
588
+ lineHeight={15}
589
+ color={theme.colors.primary}
590
+ style={{ textDecorationLine: 'underline' }}
591
+ >
592
+ {t('ADD_PRODUCTS', 'Add products')}
593
+ </OText>
594
+ </TouchableOpacity>
595
+ </CartHeader>
567
596
  {props.isFranchiseApp && (
568
597
  <TouchableOpacity
569
598
  onPress={() => setOpenChangeStore(true)}
@@ -619,6 +648,14 @@ const CheckoutUI = (props: any) => {
619
648
  {t('WARNING_INVALID_PRODUCTS', 'Some products are invalid, please check them.')}
620
649
  </OText>
621
650
  )}
651
+ {placeSpotTypes.includes(options?.type) && !cart?.place && (
652
+ <OText
653
+ color={theme.colors.error}
654
+ size={12}
655
+ >
656
+ {t('WARNING_PLACE_SPOT', 'Please, select your spot to place order.')}
657
+ </OText>
658
+ )}
622
659
  </ChErrors>
623
660
  </View>
624
661
  )}
@@ -638,8 +675,8 @@ const CheckoutUI = (props: any) => {
638
675
  {!cartState.loading && cart && cart?.status !== 2 && (
639
676
  <FloatingButton
640
677
  handleClick={() => handlePlaceOrder()}
641
- isSecondaryBtn={loading || !cart?.valid || (!paymethodSelected && cart?.balance > 0) || placing || errorCash || cart?.subtotal < cart?.minimum}
642
- disabled={loading || !cart?.valid || (!paymethodSelected && cart?.balance > 0) || placing || errorCash || cart?.subtotal < cart?.minimum}
678
+ isSecondaryBtn={isDisabledButtonPlace}
679
+ disabled={isDisabledButtonPlace}
643
680
  btnText={cart?.subtotal >= cart?.minimum
644
681
  ? (
645
682
  placing
@@ -667,19 +704,6 @@ const CheckoutUI = (props: any) => {
667
704
  setShowGateway={setShowGateway}
668
705
  />
669
706
  )}
670
- {webviewPaymethod?.gateway === 'square' && showGateway.open && (
671
- <PaymentOptionsWebView
672
- onNavigationRedirect={onNavigationRedirect}
673
- uri={`https://test-square-f50f7.web.app`}
674
- user={user}
675
- token={token}
676
- cart={cart}
677
- currency={currency}
678
- webviewPaymethod={webviewPaymethod}
679
- setShowGateway={setShowGateway}
680
- locationId={'L1NGAY5M6KJRX'}
681
- />
682
- )}
683
707
  </>
684
708
  )
685
709
  }
@@ -105,3 +105,10 @@ export const DeliveryOptionItem = styled.View`
105
105
  flex-direction: row;
106
106
  background-color: ${(props : any) => props?.backgroundColor ?? '#fff'};
107
107
  `;
108
+
109
+ export const CartHeader = styled.View`
110
+ align-items: center;
111
+ flex-direction: row;
112
+ justify-content: space-between;
113
+ margin-bottom: 10px;
114
+ `
@@ -87,6 +87,7 @@ const CouponControlUI = (props: any) => {
87
87
  ) : (
88
88
  <CCWrapper>
89
89
  <OInput
90
+ value={couponInput}
90
91
  placeholder={t('DISCOUNT_COUPON', 'Discount coupon')}
91
92
  onChange={(e: any) => onChangeInputCoupon(e)}
92
93
  style={styles.inputsStyle}
@@ -63,7 +63,7 @@ const DriverTipsUI = (props: any) => {
63
63
  return (
64
64
  <DTContainer>
65
65
  <DTWrapperTips>
66
- {driverTipsOptions.map((option: any, i: number) => (
66
+ {driverTipsOptions.map((option: any, i: number) => (
67
67
  <TouchableOpacity
68
68
  key={i}
69
69
  onPress={() => handlerChangeOption(option)}
@@ -65,18 +65,6 @@ const ForgotPasswordUI = (props: any) => {
65
65
  }
66
66
  }, [formState])
67
67
 
68
- useEffect(() => {
69
- if (Object.keys(errors).length > 0) {
70
- // Convert all errors in one string to show in toast provider
71
- const list = Object.values(errors)
72
- let stringError = ''
73
- list.map((item: any, i: number) => {
74
- stringError += (i + 1) === list.length ? `- ${item.message}` : `- ${item.message}\n`
75
- })
76
- showToast(ToastType.Error, stringError)
77
- }
78
- }, [errors])
79
-
80
68
  return (
81
69
  <Container>
82
70
  <NavBar
@@ -100,6 +88,14 @@ const ForgotPasswordUI = (props: any) => {
100
88
  {t('FORGOT_PASSWORD_TEXT_MESSAGE', "Enter your email address and we'll sent a link to reset your password.")}
101
89
  </OText>
102
90
  <FormInput>
91
+ {errors?.email && (
92
+ <OText
93
+ size={14}
94
+ color={theme.colors.danger5}
95
+ weight={'normal'}>
96
+ {errors?.email?.message}{errors?.email?.type === 'required' && '*'}
97
+ </OText>
98
+ )}
103
99
  <Controller
104
100
  control={control}
105
101
  render={({ onChange, value }: any) => (