ordering-ui-react-native 0.14.98 → 0.15.0-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 (126) 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/Checkout/index.tsx +0 -1
  7. package/src/components/Home/index.tsx +3 -5
  8. package/src/components/LanguageSelector/index.tsx +65 -97
  9. package/src/components/LanguageSelector/styles.tsx +4 -17
  10. package/src/components/Messages/index.tsx +38 -30
  11. package/src/components/MomentOption/index.tsx +3 -1
  12. package/src/components/OrderDetails/index.tsx +25 -4
  13. package/src/components/PaymentOptions/index.tsx +7 -16
  14. package/src/components/PaymentOptionsWebView/index.tsx +123 -124
  15. package/src/components/ProductForm/index.tsx +1 -1
  16. package/src/components/ProductForm/styles.tsx +1 -0
  17. package/src/components/StripeElementsForm/index.tsx +27 -48
  18. package/src/components/UserProfileForm/index.tsx +35 -1
  19. package/src/components/VerifyPhone/styles.tsx +1 -2
  20. package/src/config.json +0 -2
  21. package/src/pages/Checkout.tsx +1 -1
  22. package/src/types/index.tsx +2 -9
  23. package/src/utils/index.tsx +2 -1
  24. package/themes/business/index.tsx +2 -0
  25. package/themes/business/src/components/Chat/index.tsx +32 -31
  26. package/themes/business/src/components/OrderDetails/Business.tsx +1 -0
  27. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +85 -17
  28. package/themes/business/src/components/OrdersListManager/index.tsx +874 -0
  29. package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
  30. package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
  31. package/themes/business/src/components/OrdersOption/index.tsx +70 -116
  32. package/themes/business/src/components/OrdersOption/styles.tsx +2 -5
  33. package/themes/business/src/components/PreviousOrders/index.tsx +82 -23
  34. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  35. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  36. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  37. package/themes/kiosk/src/components/BusinessController/index.tsx +27 -6
  38. package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
  39. package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +51 -24
  40. package/themes/kiosk/src/components/Cart/index.tsx +1 -1
  41. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
  42. package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
  43. package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
  44. package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
  45. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +7 -5
  46. package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
  47. package/themes/kiosk/src/components/Intro/index.tsx +13 -13
  48. package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
  49. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  50. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  51. package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
  52. package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
  53. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
  54. package/themes/kiosk/src/components/ProductForm/index.tsx +172 -124
  55. package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
  56. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
  57. package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
  58. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
  59. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  60. package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
  61. package/themes/original/index.tsx +179 -2
  62. package/themes/original/src/components/AddressForm/index.tsx +15 -10
  63. package/themes/original/src/components/AddressList/index.tsx +27 -1
  64. package/themes/original/src/components/AnalyticsSegment/index.tsx +127 -0
  65. package/themes/original/src/components/BusinessBasicInformation/index.tsx +100 -45
  66. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +28 -1
  67. package/themes/original/src/components/BusinessController/index.tsx +36 -22
  68. package/themes/original/src/components/BusinessMenuList/index.tsx +14 -5
  69. package/themes/original/src/components/BusinessPreorder/index.tsx +142 -121
  70. package/themes/original/src/components/BusinessProductsCategories/index.tsx +7 -5
  71. package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
  72. package/themes/original/src/components/BusinessProductsListing/index.tsx +23 -30
  73. package/themes/original/src/components/BusinessReviews/index.tsx +4 -3
  74. package/themes/original/src/components/BusinessTypeFilter/index.tsx +2 -13
  75. package/themes/original/src/components/BusinessesListing/index.tsx +41 -58
  76. package/themes/original/src/components/Cart/index.tsx +40 -7
  77. package/themes/original/src/components/CartContent/index.tsx +2 -2
  78. package/themes/original/src/components/Checkout/index.tsx +58 -33
  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 +102 -123
  90. package/themes/original/src/components/OrderDetails/styles.tsx +3 -1
  91. package/themes/original/src/components/OrderProgress/index.tsx +6 -7
  92. package/themes/original/src/components/OrderProgress/styles.tsx +1 -0
  93. package/themes/original/src/components/OrderSummary/index.tsx +34 -1
  94. package/themes/original/src/components/OrdersOption/index.tsx +15 -46
  95. package/themes/original/src/components/OrdersOption/styles.tsx +0 -6
  96. package/themes/original/src/components/PaymentOptionWallet/index.tsx +6 -2
  97. package/themes/original/src/components/PaymentOptions/index.tsx +24 -25
  98. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -8
  99. package/themes/original/src/components/PlaceSpot/index.tsx +114 -0
  100. package/themes/original/src/components/PlaceSpot/styles.tsx +11 -0
  101. package/themes/original/src/components/PreviousOrders/index.tsx +19 -13
  102. package/themes/original/src/components/ProductForm/index.tsx +153 -104
  103. package/themes/original/src/components/ProductForm/styles.tsx +5 -3
  104. package/themes/original/src/components/ProductOptionSubOption/index.tsx +6 -1
  105. package/themes/original/src/components/ReviewOrder/index.tsx +10 -9
  106. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  107. package/themes/original/src/components/SearchBar/index.tsx +4 -10
  108. package/themes/original/src/components/SignupForm/index.tsx +173 -154
  109. package/themes/original/src/components/SingleProductCard/index.tsx +2 -10
  110. package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
  111. package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
  112. package/themes/original/src/components/UserDetails/index.tsx +4 -95
  113. package/themes/original/src/components/UserFormDetails/index.tsx +2 -14
  114. package/themes/original/src/components/UserProfile/index.tsx +16 -11
  115. package/themes/original/src/components/UserProfileForm/index.tsx +16 -8
  116. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  117. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  118. package/themes/original/src/components/shared/HeaderTitle.tsx +21 -0
  119. package/themes/original/src/components/shared/OInput.tsx +1 -2
  120. package/themes/original/src/components/shared/index.tsx +2 -0
  121. package/themes/original/src/types/index.tsx +25 -28
  122. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +5 -5
  123. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  124. package/src/components/StripeMethodForm/index.tsx +0 -163
  125. package/themes/original/src/components/BusinessListingSearch/index.tsx +0 -469
  126. package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -76
@@ -21,6 +21,7 @@ import {
21
21
  TimeContentWrapper,
22
22
  TimeItem
23
23
  } from './styles'
24
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
24
25
 
25
26
  const windowHeight = Dimensions.get('window').height;
26
27
 
@@ -50,7 +51,9 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
50
51
  const [selectDate, setSelectedDate] = useState<any>(null)
51
52
  const [datesWhitelist, setDateWhitelist] = useState<any>([{ start: null, end: null }])
52
53
  const [isEnabled, setIsEnabled] = useState(false)
53
-
54
+ const { top } = useSafeAreaInsets()
55
+ const showOrderTime = (selectedPreorderType === 1 && Object.keys(menu)?.length > 0) || selectedPreorderType === 0
56
+ const isPreOrderSetting = configs?.preorder_status_enabled?.value === '1'
54
57
  const styles = StyleSheet.create({
55
58
  container: {
56
59
  height: windowHeight,
@@ -299,60 +302,62 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
299
302
  />
300
303
  </View>
301
304
  </BusinessInfoWrapper>
302
- <PreorderTypeWrapper>
303
- <OText
304
- size={16}
305
- style={{
306
- fontWeight: '600',
307
- lineHeight: 24,
308
- marginBottom: 12
309
- }}
310
- >
311
- {t('PREORDER_TYPE', 'Preorder type')}
312
- </OText>
313
- <SelectDropdown
314
- defaultValueByIndex={selectedPreorderType}
315
- data={preorderTypeList}
316
- // disabled={orderState.loading}
317
- onSelect={(selectedItem, index) => {
318
- setSelectedPreorderType(index)
319
- }}
320
- buttonTextAfterSelection={(selectedItem, index) => {
321
- return selectedItem.name
322
- }}
323
- rowTextForSelection={(item, index) => {
324
- return item.name
325
- }}
326
- buttonStyle={styles.selectOption}
327
- buttonTextStyle={{
328
- color: theme.colors.disabled,
329
- fontSize: 14,
330
- textAlign: 'left',
331
- marginHorizontal: 0
332
- }}
333
- dropdownStyle={{
334
- borderRadius: 8,
335
- borderColor: theme.colors.lightGray,
336
- marginTop: Platform.OS === 'ios' ? 12 : -15
337
- }}
338
- rowStyle={{
339
- borderBottomColor: theme.colors.backgroundGray100,
340
- backgroundColor: theme.colors.backgroundGray100,
341
- height: 40,
342
- flexDirection: 'column',
343
- alignItems: 'flex-start',
344
- paddingTop: 8,
345
- paddingHorizontal: 14
346
- }}
347
- rowTextStyle={{
348
- color: theme.colors.disabled,
349
- fontSize: 14,
350
- marginHorizontal: 0
351
- }}
352
- renderDropdownIcon={() => dropDownIcon()}
353
- dropdownOverlayColor='transparent'
354
- />
355
- </PreorderTypeWrapper>
305
+ {isPreOrderSetting && (
306
+ <PreorderTypeWrapper>
307
+ <OText
308
+ size={16}
309
+ style={{
310
+ fontWeight: '600',
311
+ lineHeight: 24,
312
+ marginBottom: 12
313
+ }}
314
+ >
315
+ {t('PREORDER_TYPE', 'Preorder type')}
316
+ </OText>
317
+ <SelectDropdown
318
+ defaultValueByIndex={selectedPreorderType}
319
+ data={preorderTypeList}
320
+ // disabled={orderState.loading}
321
+ onSelect={(selectedItem, index) => {
322
+ setSelectedPreorderType(index)
323
+ }}
324
+ buttonTextAfterSelection={(selectedItem, index) => {
325
+ return selectedItem.name
326
+ }}
327
+ rowTextForSelection={(item, index) => {
328
+ return item.name
329
+ }}
330
+ buttonStyle={styles.selectOption}
331
+ buttonTextStyle={{
332
+ color: theme.colors.disabled,
333
+ fontSize: 14,
334
+ textAlign: 'left',
335
+ marginHorizontal: 0
336
+ }}
337
+ dropdownStyle={{
338
+ borderRadius: 8,
339
+ borderColor: theme.colors.lightGray,
340
+ marginTop: Platform.OS === 'ios' ? 12 : -top
341
+ }}
342
+ rowStyle={{
343
+ borderBottomColor: theme.colors.backgroundGray100,
344
+ backgroundColor: theme.colors.backgroundGray100,
345
+ height: 40,
346
+ flexDirection: 'column',
347
+ alignItems: 'flex-start',
348
+ paddingTop: 8,
349
+ paddingHorizontal: 14
350
+ }}
351
+ rowTextStyle={{
352
+ color: theme.colors.disabled,
353
+ fontSize: 14,
354
+ marginHorizontal: 0
355
+ }}
356
+ renderDropdownIcon={() => dropDownIcon()}
357
+ dropdownOverlayColor='transparent'
358
+ />
359
+ </PreorderTypeWrapper>
360
+ )}
356
361
  {selectedPreorderType === 1 && (
357
362
  <MenuWrapper>
358
363
  <OText
@@ -372,78 +377,94 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
372
377
  />
373
378
  </MenuWrapper>
374
379
  )}
375
- <OrderTimeWrapper>
380
+ {isPreOrderSetting && showOrderTime && (
381
+ <OrderTimeWrapper>
382
+ <OText
383
+ size={16}
384
+ style={{
385
+ fontWeight: '600',
386
+ lineHeight: 24
387
+ }}
388
+ >
389
+ {t('ORDER_TIME', 'Order time')}
390
+ </OText>
391
+ <View style={{ flex: 1 }}>
392
+ {selectDate && datesWhitelist[0]?.start !== null && (
393
+ <CalendarStrip
394
+ scrollable
395
+ style={styles.calendar}
396
+ calendarHeaderContainerStyle={styles.calendarHeaderContainer}
397
+ calendarHeaderStyle={styles.calendarHeader}
398
+ dateNumberStyle={styles.dateNumber}
399
+ dateNameStyle={styles.dateName}
400
+ iconContainer={{ flex: 0.1 }}
401
+ highlightDateNameStyle={styles.highlightDateName}
402
+ highlightDateNumberStyle={styles.highlightDateNumber}
403
+ dayContainerStyle={{ height: '100%' }}
404
+ highlightDateContainerStyle={{ height: '100%' }}
405
+ calendarHeaderFormat='MMMM, YYYY'
406
+ iconStyle={{ borderWidth: 1 }}
407
+ selectedDate={selectDate}
408
+ datesWhitelist={datesWhitelist}
409
+ disabledDateNameStyle={styles.disabledDateName}
410
+ disabledDateNumberStyle={styles.disabledDateNumber}
411
+ disabledDateOpacity={0.6}
412
+ onDateSelected={(date) => onSelectDate(date)}
413
+ leftSelector={<LeftSelector />}
414
+ rightSelector={<RightSelector />}
415
+ />
416
+ )}
417
+ </View>
418
+ <TimeListWrapper nestedScrollEnabled={true}>
419
+ {(isEnabled && timeList?.length > 0) ? (
420
+ <TimeContentWrapper>
421
+ {timeList.map((time: any, i: number) => (
422
+ <TouchableOpacity key={i} onPress={() => handleChangeTime(time.value)}>
423
+ <TimeItem active={timeSelected === time.value}>
424
+ <OText
425
+ size={14}
426
+ color={timeSelected === time.value ? theme.colors.primary : theme.colors.textNormal}
427
+ style={{
428
+ lineHeight: 24
429
+ }}
430
+ >{time.text}</OText>
431
+ </TimeItem>
432
+ </TouchableOpacity>
433
+ ))}
434
+ {timeList.length % 3 === 2 && (
435
+ <TimeItem style={{ backgroundColor: 'transparent' }} />
436
+ )}
437
+ </TimeContentWrapper>
438
+ ) : (
439
+ <OText
440
+ size={16}
441
+ style={{
442
+ fontWeight: '600',
443
+ lineHeight: 24,
444
+ marginBottom: 12,
445
+ textAlign: 'center'
446
+ }}
447
+ >
448
+ {t('ERROR_ADD_PRODUCT_BUSINESS_CLOSED', 'The business is closed at the moment')}
449
+ </OText>
450
+ )}
451
+ </TimeListWrapper>
452
+ </OrderTimeWrapper>
453
+ )}
454
+ {!isPreOrderSetting && (
376
455
  <OText
377
456
  size={16}
378
457
  style={{
379
458
  fontWeight: '600',
380
- lineHeight: 24
459
+ lineHeight: 24,
460
+ marginTop: 30,
461
+ marginBottom: 12,
462
+ textAlign: 'center'
381
463
  }}
382
- >
383
- {t('ORDER_TIME', 'Order time')}
464
+ >
465
+ {t('ERROR_ADD_PRODUCT_BUSINESS_CLOSED', 'The business is closed at the moment')}
384
466
  </OText>
385
- <View style={{ flex: 1 }}>
386
- {selectDate && datesWhitelist[0]?.start !== null && (
387
- <CalendarStrip
388
- scrollable
389
- style={styles.calendar}
390
- calendarHeaderContainerStyle={styles.calendarHeaderContainer}
391
- calendarHeaderStyle={styles.calendarHeader}
392
- dateNumberStyle={styles.dateNumber}
393
- dateNameStyle={styles.dateName}
394
- iconContainer={{ flex: 0.1 }}
395
- highlightDateNameStyle={styles.highlightDateName}
396
- highlightDateNumberStyle={styles.highlightDateNumber}
397
- dayContainerStyle={{ height: '100%' }}
398
- highlightDateContainerStyle={{ height: '100%' }}
399
- calendarHeaderFormat='MMMM, YYYY'
400
- iconStyle={{ borderWidth: 1 }}
401
- selectedDate={selectDate}
402
- datesWhitelist={datesWhitelist}
403
- disabledDateNameStyle={styles.disabledDateName}
404
- disabledDateNumberStyle={styles.disabledDateNumber}
405
- disabledDateOpacity={0.6}
406
- onDateSelected={(date) => onSelectDate(date)}
407
- leftSelector={<LeftSelector />}
408
- rightSelector={<RightSelector />}
409
- />
410
- )}
411
- </View>
412
- <TimeListWrapper nestedScrollEnabled={true}>
413
- {(isEnabled && timeList?.length > 0) ? (
414
- <TimeContentWrapper>
415
- {timeList.map((time: any, i: number) => (
416
- <TouchableOpacity key={i} onPress={() => handleChangeTime(time.value)}>
417
- <TimeItem active={timeSelected === time.value}>
418
- <OText
419
- size={14}
420
- color={timeSelected === time.value ? theme.colors.primary : theme.colors.textNormal}
421
- style={{
422
- lineHeight: 24
423
- }}
424
- >{time.text}</OText>
425
- </TimeItem>
426
- </TouchableOpacity>
427
- ))}
428
- {timeList.length % 3 === 2 && (
429
- <TimeItem style={{ backgroundColor: 'transparent' }} />
430
- )}
431
- </TimeContentWrapper>
432
- ) : (
433
- <OText
434
- size={16}
435
- style={{
436
- fontWeight: '600',
437
- lineHeight: 24,
438
- marginBottom: 12,
439
- textAlign: 'center'
440
- }}
441
- >
442
- {t('ERROR_ADD_PRODUCT_BUSINESS_CLOSED', 'The business is closed at the moment')}
443
- </OText>
444
- )}
445
- </TimeListWrapper>
446
- </OrderTimeWrapper>
467
+ )}
447
468
  <OButton
448
469
  text={t('GO_TO_MENU', 'Go to menu')}
449
470
  textStyle={{ color: 'white' }}
@@ -44,11 +44,11 @@ const BusinessProductsCategoriesUI = (props: any) => {
44
44
  borderTopStartRadius: 4,
45
45
  borderTopEndRadius: 4,
46
46
  backgroundColor: theme.colors.textPrimary,
47
- },
48
- tabDeactived: {
47
+ },
48
+ tabDeactived: {
49
49
  marginTop: 10,
50
50
  height: 4
51
- }
51
+ }
52
52
  });
53
53
 
54
54
  const handleCategoryScroll = (category: any) => {
@@ -111,8 +111,10 @@ const BusinessProductsCategoriesUI = (props: any) => {
111
111
  categories.length &&
112
112
  categories.map((category: any) => (
113
113
  <Tab
114
- key={category.name}
115
- onPress={() => handleCategoryScroll(category)}
114
+ key={category.id}
115
+ onPress={() => requestAnimationFrame(() => {
116
+ handleCategoryScroll(category)
117
+ })}
116
118
  style={[
117
119
  category.id === 'featured' && !featured && styles.featuredStyle,
118
120
  {
@@ -44,7 +44,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
44
44
  }
45
45
 
46
46
  return (
47
- <ProductsContainer>
47
+ <ProductsContainer renderToHardwareTextureAndroid={categoryState.loading || isBusinessLoading}>
48
48
  {category.id &&
49
49
  categoryState.products?.sort((a: any, b: any) => a.rank - b.rank).map((product: any) => (
50
50
  <SingleProductCard
@@ -101,7 +101,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
101
101
  >
102
102
  <View style={bpStyles.catIcon}>
103
103
  <OIcon
104
- url={optimizeImage(category.image, 'h_100,c_limit')}
104
+ url={optimizeImage(category.image, 'h_250,c_limit')}
105
105
  width={41}
106
106
  height={41}
107
107
  style={{ borderRadius: 7.6 }}
@@ -237,7 +237,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
237
237
  };
238
238
 
239
239
  const bpStyles = StyleSheet.create({
240
- catWrap: { flexDirection: 'row', alignItems: 'center', height: 41, marginBottom: 19 },
240
+ catWrap: { flexDirection: 'row', alignItems: 'center', marginBottom: 19 },
241
241
  catIcon: {
242
242
  borderRadius: 7.6,
243
243
  shadowColor: '#000000',
@@ -8,7 +8,8 @@ import {
8
8
  useSession,
9
9
  useUtils,
10
10
  ToastType,
11
- useToast
11
+ useToast,
12
+ useConfig
12
13
  } from 'ordering-components/native'
13
14
  import { OButton, OIcon, OModal, OText } from '../shared'
14
15
  import { BusinessBasicInformation } from '../BusinessBasicInformation'
@@ -52,7 +53,8 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
52
53
  const [orderState] = useOrder()
53
54
  const [{ parsePrice }] = useUtils()
54
55
  const [, { showToast }] = useToast()
55
-
56
+ const [{ configs }] = useConfig()
57
+ const isPreOrder = configs?.preorder_status_enabled?.value === '1'
56
58
  const styles = StyleSheet.create({
57
59
  mainContainer: {
58
60
  flex: 1,
@@ -70,6 +72,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
70
72
  borderWidth: 0,
71
73
  backgroundColor: theme.colors.clear,
72
74
  shadowColor: theme.colors.clear,
75
+ padding: 40,
73
76
  },
74
77
  searchIcon: {
75
78
  borderWidth: 0,
@@ -96,24 +99,11 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
96
99
  }
97
100
 
98
101
  const onProductClick = (product: any) => {
99
- const cartProduct = currentCart?.products?.find((cproduct: any) => cproduct?.id === product?.id)
100
- if (cartProduct) {
101
- onRedirect('ProductDetails', {
102
- businessId: business.id,
103
- isCartProduct: true,
104
- productCart: cartProduct,
105
- businessSlug: business?.slug,
106
- categoryId: cartProduct?.category_id,
107
- productId: cartProduct?.id,
108
- })
109
- } else {
110
- onRedirect('ProductDetails', {
111
- product: product,
112
- businessSlug: business.slug,
113
- businessId: business.id,
114
- })
115
- }
116
-
102
+ onRedirect('ProductDetails', {
103
+ product: product,
104
+ businessSlug: business.slug,
105
+ businessId: business.id,
106
+ })
117
107
  }
118
108
 
119
109
  const handleCancel = () => {
@@ -167,8 +157,8 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
167
157
 
168
158
  const handleTouchDrag = useCallback(() => {
169
159
  setCategoryClicked(false);
170
- }, []);
171
-
160
+ }, []);
161
+
172
162
  const handleBackNavigation = () => {
173
163
  navigation?.canGoBack() ? navigation.goBack() : navigation.navigate('BottomTab')
174
164
  }
@@ -231,6 +221,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
231
221
  openBusinessInformation={openBusinessInformation}
232
222
  header={header}
233
223
  logo={logo}
224
+ isPreOrder={isPreOrder}
234
225
  />
235
226
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
236
227
  {!loading && business?.id && (
@@ -248,7 +239,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
248
239
  selectedCategoryId={selectedCategoryId}
249
240
  lazyLoadProductsRecommended={business?.lazy_load_products_recommended}
250
241
  setSelectedCategoryId={setSelectedCategoryId}
251
- setCategoryClicked={setCategoryClicked}
242
+ setCategoryClicked={setCategoryClicked}
252
243
  />
253
244
  )}
254
245
  </>
@@ -307,16 +298,18 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
307
298
  {!loading && auth && currentCart?.products?.length > 0 && categoryState.products.length !== 0 && (
308
299
  <FloatingButton
309
300
  btnText={
310
- currentCart?.subtotal >= currentCart?.minimum
311
- ? t('VIEW_ORDER', 'View Order')
312
- : `${t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:')} ${parsePrice(currentCart?.minimum)}`
301
+ openUpselling
302
+ ? t('LOADING', 'Loading')
303
+ : currentCart?.subtotal >= currentCart?.minimum
304
+ ? t('VIEW_ORDER', 'View Order')
305
+ : `${t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:')} ${parsePrice(currentCart?.minimum)}`
313
306
  }
314
- isSecondaryBtn={currentCart?.subtotal < currentCart?.minimum}
307
+ isSecondaryBtn={currentCart?.subtotal < currentCart?.minimum || openUpselling}
315
308
  btnLeftValueShow={currentCart?.subtotal >= currentCart?.minimum && currentCart?.products?.length > 0}
316
309
  btnRightValueShow={currentCart?.subtotal >= currentCart?.minimum && currentCart?.products?.length > 0}
317
310
  btnLeftValue={currentCart?.products?.length}
318
311
  btnRightValue={parsePrice(currentCart?.total)}
319
- disabled={currentCart?.subtotal < currentCart?.minimum}
312
+ disabled={currentCart?.subtotal < currentCart?.minimum || openUpselling}
320
313
  handleClick={() => setOpenUpselling(true)}
321
314
  />
322
315
  )}
@@ -326,13 +319,13 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
326
319
  business={currentCart?.business}
327
320
  cartProducts={currentCart?.products}
328
321
  cart={currentCart}
329
- setOpenUpselling={setOpenUpselling}
322
+ setOpenUpselling={setOpenUpselling}
330
323
  handleUpsellingPage={handleUpsellingPage}
331
324
  handleCloseUpsellingPage={handleCloseUpsellingPage}
332
325
  openUpselling={openUpselling}
333
326
  canOpenUpselling={canOpenUpselling}
334
327
  setCanOpenUpselling={setCanOpenUpselling}
335
- onRedirect={onRedirect}
328
+ onRedirect={onRedirect}
336
329
  />
337
330
  )}
338
331
  </SafeAreaView>
@@ -237,9 +237,10 @@ const BusinessReviewsUI = (props: BusinessReviewsParams) => {
237
237
  ))}
238
238
  </>
239
239
  )}
240
- {!reviewsList.loading && reviewsList?.reviews.length === 0 && (
241
- <OText>{t('REVIEWS_NOT_FOUND', 'Reviews Not Found')}</OText>
242
- )}
240
+ {reviewsList?.reviews
241
+ .filter((review: any) => searchReview !== '' ? review.comment?.toLowerCase()?.includes(searchReview?.toLowerCase()) : true).length === 0 && (
242
+ <OText>{t('REVIEWS_NOT_FOUND', 'Reviews Not Found')}</OText>
243
+ )}
243
244
  </BusinessReviewContent>
244
245
  </BusinessReviewsContainer>
245
246
  );
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect } from 'react';
1
+ import React, { useState } from 'react';
2
2
  import {
3
3
  StyleSheet,
4
4
  FlatList,
@@ -24,24 +24,13 @@ import { BusinessTypeFilterParams } from '../../types';
24
24
  const windowWidth = Dimensions.get('window').width;
25
25
 
26
26
  export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
27
- const {
28
- typesState,
29
- currentTypeSelected,
30
- handleChangeBusinessType,
31
- setBusinessTypes
32
- } = props;
27
+ const { typesState, currentTypeSelected, handleChangeBusinessType } = props;
33
28
 
34
29
  const [, t] = useLanguage();
35
30
 
36
31
  const theme = useTheme();
37
32
  const [isOpenAllCategories, setIsOpenAllCategories] = useState(false)
38
33
 
39
- useEffect(() => {
40
- if(typesState?.types?.length > 0){
41
- setBusinessTypes && setBusinessTypes(typesState?.types)
42
- }
43
- }, [typesState])
44
-
45
34
  const renderTypes = ({ item }: any) => {
46
35
  return (
47
36
  <TouchableOpacity