ordering-ui-react-native 0.21.49 → 0.21.50-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 (204) hide show
  1. package/package.json +8 -8
  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/src/utils/index.tsx +2 -2
  9. package/themes/business/index.tsx +6 -0
  10. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +4 -3
  11. package/themes/business/src/components/BusinessController/index.tsx +19 -17
  12. package/themes/business/src/components/BusinessProductList/AccordionDropdown.tsx +63 -0
  13. package/themes/business/src/components/BusinessProductList/IterateCategories.tsx +108 -0
  14. package/themes/business/src/components/BusinessProductList/ProductList.tsx +196 -0
  15. package/themes/business/src/components/BusinessProductList/index.tsx +196 -0
  16. package/themes/business/src/components/BusinessProductList/styles.tsx +10 -0
  17. package/themes/business/src/components/DriverMap/index.tsx +36 -23
  18. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  19. package/themes/business/src/components/Home/index.tsx +5 -1
  20. package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
  21. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  22. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  23. package/themes/business/src/components/MapView/index.tsx +30 -15
  24. package/themes/business/src/components/NewOrderNotification/index.tsx +66 -26
  25. package/themes/business/src/components/OrderDetails/Business.tsx +52 -2
  26. package/themes/business/src/components/OrderDetails/Delivery.tsx +42 -23
  27. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +68 -61
  28. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +40 -20
  29. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  30. package/themes/business/src/components/OrderSummary/index.tsx +240 -76
  31. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  32. package/themes/business/src/components/OrdersOption/index.tsx +265 -136
  33. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  34. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +37 -40
  35. package/themes/business/src/components/PreviousOrders/OrderList.tsx +1 -1
  36. package/themes/business/src/components/PreviousOrders/index.tsx +5 -3
  37. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  38. package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
  39. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  40. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  41. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
  42. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  43. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  44. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  45. package/themes/business/src/components/Sessions/index.tsx +187 -0
  46. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  47. package/themes/business/src/components/StoresList/index.tsx +5 -3
  48. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  49. package/themes/business/src/components/UserProfileForm/index.tsx +106 -54
  50. package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
  51. package/themes/business/src/components/shared/OInput.tsx +2 -0
  52. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  53. package/themes/business/src/hooks/useLocation.tsx +5 -4
  54. package/themes/business/src/types/index.tsx +23 -5
  55. package/themes/business/src/utils/index.tsx +5 -0
  56. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  57. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  58. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  59. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  60. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  61. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  62. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  63. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  64. package/themes/original/index.tsx +6 -2
  65. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  66. package/themes/original/src/components/AddressForm/index.tsx +41 -15
  67. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  68. package/themes/original/src/components/AddressList/index.tsx +18 -4
  69. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  70. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  71. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  72. package/themes/original/src/components/BusinessBasicInformation/index.tsx +7 -10
  73. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  74. package/themes/original/src/components/BusinessController/index.tsx +18 -10
  75. package/themes/original/src/components/BusinessController/styles.tsx +8 -7
  76. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  77. package/themes/original/src/components/BusinessItemAccordion/index.tsx +4 -3
  78. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  79. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  80. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  81. package/themes/original/src/components/BusinessListingSearch/index.tsx +47 -358
  82. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  83. package/themes/original/src/components/BusinessPreorder/index.tsx +4 -3
  84. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  85. package/themes/original/src/components/BusinessProductsList/index.tsx +1 -1
  86. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  87. package/themes/original/src/components/BusinessProductsListing/index.tsx +30 -18
  88. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  89. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  90. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  91. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  92. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +1 -1
  93. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +7 -7
  94. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +2 -2
  95. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  96. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  97. package/themes/original/src/components/Cart/index.tsx +30 -9
  98. package/themes/original/src/components/CartContent/index.tsx +96 -58
  99. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  100. package/themes/original/src/components/Checkout/index.tsx +144 -62
  101. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  102. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  103. package/themes/original/src/components/DatePicker/index.tsx +18 -2
  104. package/themes/original/src/components/Favorite/index.tsx +9 -9
  105. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  106. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  107. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
  108. package/themes/original/src/components/GPSButton/index.tsx +1 -1
  109. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  110. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  111. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  112. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  113. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  114. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  115. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  116. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  117. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  118. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  119. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  120. package/themes/original/src/components/Help/index.tsx +7 -0
  121. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
  122. package/themes/original/src/components/HelpGuide/index.tsx +5 -0
  123. package/themes/original/src/components/HelpOrder/index.tsx +5 -0
  124. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  125. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  126. package/themes/original/src/components/Home/index.tsx +3 -8
  127. package/themes/original/src/components/LoginForm/Otp/index.tsx +4 -16
  128. package/themes/original/src/components/LoginForm/index.tsx +9 -3
  129. package/themes/original/src/components/MessageListing/index.tsx +6 -0
  130. package/themes/original/src/components/Messages/index.tsx +8 -7
  131. package/themes/original/src/components/Messages/styles.tsx +1 -1
  132. package/themes/original/src/components/MomentOption/index.tsx +19 -4
  133. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  134. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  135. package/themes/original/src/components/MultiCheckout/index.tsx +126 -61
  136. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  137. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -15
  138. package/themes/original/src/components/MyOrders/index.tsx +28 -28
  139. package/themes/original/src/components/NavBar/index.tsx +5 -0
  140. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  141. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  142. package/themes/original/src/components/Notifications/index.tsx +9 -8
  143. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  144. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +1 -1
  145. package/themes/original/src/components/OrderDetails/index.tsx +701 -662
  146. package/themes/original/src/components/OrderDetails/styles.tsx +24 -8
  147. package/themes/original/src/components/OrderProgress/index.tsx +22 -3
  148. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  149. package/themes/original/src/components/OrderSummary/index.tsx +3 -1
  150. package/themes/original/src/components/OrderTypeSelector/index.tsx +10 -6
  151. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  152. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  153. package/themes/original/src/components/OrdersOption/index.tsx +3 -5
  154. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  155. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  156. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  157. package/themes/original/src/components/PaymentOptions/index.tsx +47 -4
  158. package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
  159. package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
  160. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  161. package/themes/original/src/components/ProductForm/index.tsx +170 -252
  162. package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -44
  163. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  164. package/themes/original/src/components/ProductOptionSubOption/index.tsx +112 -91
  165. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  166. package/themes/original/src/components/Promotions/index.tsx +13 -11
  167. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  168. package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
  169. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  170. package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
  171. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  172. package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
  173. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  174. package/themes/original/src/components/ServiceForm/index.tsx +1 -1
  175. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  176. package/themes/original/src/components/Sessions/index.tsx +5 -0
  177. package/themes/original/src/components/SignupForm/index.tsx +67 -59
  178. package/themes/original/src/components/SingleOrderCard/index.tsx +3 -2
  179. package/themes/original/src/components/SingleProductCard/index.tsx +4 -3
  180. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  181. package/themes/original/src/components/StripeCardsList/index.tsx +12 -35
  182. package/themes/original/src/components/StripeElementsForm/index.tsx +79 -59
  183. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  184. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  185. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +91 -0
  186. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  187. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  188. package/themes/original/src/components/UserFormDetails/index.tsx +100 -86
  189. package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
  190. package/themes/original/src/components/UserProfile/index.tsx +3 -2
  191. package/themes/original/src/components/UserProfileForm/index.tsx +5 -0
  192. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  193. package/themes/original/src/components/Wallets/index.tsx +7 -4
  194. package/themes/original/src/components/Wallets/styles.tsx +2 -1
  195. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  196. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  197. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  198. package/themes/original/src/components/shared/OButton.tsx +5 -5
  199. package/themes/original/src/components/shared/OInput.tsx +1 -4
  200. package/themes/original/src/components/shared/OModal.tsx +12 -14
  201. package/themes/original/src/layouts/Container.tsx +5 -3
  202. package/themes/original/src/types/index.tsx +6 -1
  203. package/themes/original/src/utils/index.tsx +12 -1
  204. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,36 +1,25 @@
1
1
  import React, { useEffect, useState } from 'react'
2
2
  import { useLanguage, BusinessSearchList, useOrder, useUtils, useEvent, showToast, ToastType } from 'ordering-components/native'
3
- import { ScrollView, StyleSheet, TouchableOpacity, View, Dimensions } from 'react-native'
4
- import { useSafeAreaInsets } from 'react-native-safe-area-context'
3
+ import { ScrollView, StyleSheet, Dimensions, FlatList } from 'react-native'
5
4
  import { useTheme } from 'styled-components/native'
6
- import { HeaderTitle, OButton, OModal, OText } from '../shared'
7
- import { SearchBar } from '../SearchBar';
8
- import { NotFoundSource } from '../NotFoundSource'
5
+ import { OButton, OText } from '../shared'
6
+
9
7
  import { SingleProductCard } from '../SingleProductCard'
10
- import AntDesignIcon from 'react-native-vector-icons/AntDesign'
11
8
  import {
12
- SearchWrapper,
13
- ProductsList,
14
9
  SingleBusinessSearch,
15
10
  BusinessInfo,
16
11
  BusinessInfoItem,
17
12
  Metadata,
18
13
  SingleBusinessContainer,
19
- TagsContainer,
20
- SortContainer,
21
- BrandContainer,
22
- BrandItem,
23
- PriceFilterWrapper,
24
14
  BContainer,
25
- WrapperButtons
26
15
  } from './styles'
27
16
  import FastImage from 'react-native-fast-image'
28
17
  import { convertHoursToMinutes } from '../../utils'
29
- import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
30
18
  import { BusinessSearchParams } from '../../types'
31
19
  import { useIsFocused } from '@react-navigation/native';
32
- import { MaxSectionItem } from './MaxSectionItem'
33
- import { IOScrollView } from 'react-native-intersection-observer'
20
+
21
+ import { BusinessSearchHeader } from './BusinessSearchHeader'
22
+ import { BusinessSearchFooter } from './BusinessSearchFooter'
34
23
 
35
24
  const PIXELS_TO_SCROLL = 1000
36
25
 
@@ -51,94 +40,20 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
51
40
  handleUpdateProducts
52
41
  } = props
53
42
 
54
- const screenHeight = Dimensions.get('window').height;
55
43
  const screenWidth = Dimensions.get('window').width;
56
44
  const theme = useTheme()
57
45
  const [orderState] = useOrder()
58
46
  const [events] = useEvent()
59
- const { top } = useSafeAreaInsets();
60
47
  const [, t] = useLanguage()
61
48
  const [{ parsePrice, parseDistance, optimizeImage }] = useUtils();
62
49
 
63
50
  const [openFilters, setOpenFilters] = useState(false)
64
- const noResults = (!businessesSearchList.loading && !businessesSearchList.lengthError && businessesSearchList?.businesses?.length === 0)
65
- const maxDeliveryFeeOptions = [15, 25, 35, 'default']
66
- // const maxProductPriceOptions = [5, 10, 15, 'default']
67
- const maxDistanceOptions = [1000, 2000, 5000, 'default']
68
- const maxTimeOptions = [5, 15, 30, 'default']
69
- const sortItems = [
70
- { text: t('PICKED_FOR_YOU', 'Picked for you (default)'), value: 'distance' },
71
- { text: t('DELIVERY_TIME', 'Delivery time'), value: 'delivery_time' },
72
- { text: t('PICKUP_TIME', 'Pickup time'), value: 'pickup_time' }
73
- ]
74
-
75
- const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
76
- const hideBrowse = theme?.bar_menu?.components?.browse?.hidden
77
-
78
- const priceList = [
79
- { level: '1', content: '$' },
80
- { level: '2', content: '$$' },
81
- { level: '3', content: '$$$' },
82
- { level: '4', content: '$$$$' },
83
- { level: '5', content: '$$$$$' }
84
- ]
85
51
 
86
52
  const isFocused = useIsFocused();
87
53
 
88
54
  const styles = StyleSheet.create({
89
- container: {
90
- paddingHorizontal: 40,
91
- width: '100%'
92
- },
93
- filterContainer: {
94
- maxHeight: screenHeight - 150,
95
- paddingHorizontal: 40,
96
- width: '100%'
97
- },
98
- searchInput: {
99
- fontSize: 12,
100
- height: 44
101
- },
102
55
  productsContainer: {
103
56
  marginTop: 20
104
- },
105
- businessTypesContainer: {
106
- width: '100%',
107
- flexDirection: 'row',
108
- flexWrap: 'wrap',
109
- justifyContent: 'center'
110
- },
111
- priceContainer: {
112
- width: '100%',
113
- flexDirection: 'row',
114
- flexWrap: 'wrap',
115
- justifyContent: 'space-between'
116
- },
117
- categoryStyle: {
118
- marginRight: 10,
119
- marginTop: 10,
120
- borderRadius: 50,
121
- paddingHorizontal: 10,
122
- paddingVertical: 4,
123
- paddingLeft: 0,
124
- paddingRight: 0,
125
- height: 28,
126
- borderWidth: 0
127
- },
128
- priceItem: {
129
- marginRight: 10,
130
- marginTop: 10,
131
- borderRadius: 50,
132
- paddingVertical: 4,
133
- paddingLeft: 5,
134
- paddingRight: 5,
135
- height: 27,
136
- borderWidth: 0
137
- },
138
- applyButton: {
139
- paddingHorizontal: 10,
140
- width: '100%',
141
- marginTop: 20
142
57
  }
143
58
  });
144
59
 
@@ -250,71 +165,37 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
250
165
  }, [isFocused])
251
166
 
252
167
  return (
253
- <IOScrollView
254
- onScroll={(e: any) => handleScroll(e)}
255
- showsVerticalScrollIndicator={false}
256
- >
257
- <View style={{
258
- width: '100%',
259
- display: 'flex',
260
- flexDirection: 'row',
261
- alignItems: 'center',
262
- paddingHorizontal: hideBrowse && !isChewLayout ? 40 : 20,
263
- }}>
264
- {hideBrowse && !isChewLayout && (
265
- <OButton
266
- imgLeftStyle={{ width: 18 }}
267
- imgRightSrc={null}
268
- style={{
269
- borderWidth: 0,
270
- width: 26,
271
- height: 26,
272
- backgroundColor: '#FFF',
273
- borderColor: '#FFF',
274
- shadowColor: '#FFF',
275
- paddingLeft: 0,
276
- paddingRight: 0,
277
- marginTop: 50,
278
- }}
279
- onClick={() => props.navigation.goBack()}
280
- icon={AntDesignIcon}
281
- iconProps={{
282
- name: 'arrowleft',
283
- size: 26
284
- }}
285
- />
286
- )}
287
- <HeaderTitle ph={20} text={t('SEARCH', 'Search')} />
288
- <AntDesignIcon name='filter' size={18} style={{ marginLeft: 'auto', marginTop: 55, paddingHorizontal: 20 }} onPress={() => handleOpenfilters()} />
289
- </View>
290
- <BContainer
291
- style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}
292
- >
293
- <SearchWrapper>
294
- <SearchBar
295
- lazyLoad
296
- {...(isChewLayout && { height: 55 })}
297
- inputStyle={{ ...styles.searchInput }}
298
- placeholder={t('SEARCH_BUSINESSES', 'Search Businesses')}
299
- onSearch={(val: string) => onChangeTermValue(val)}
300
- value={termValue}
301
- />
302
- </SearchWrapper>
303
- <OText size={12} lineHeight={20} color={theme.colors.textThird} mLeft={5}>
304
- {t('TYPE_AT_LEAST_2_CHARACTERS', 'Type at least 2 characters')}
305
- </OText>
306
- {
307
- noResults && (
308
- <View>
309
- <NotFoundSource
310
- content={t('NOT_FOUND_BUSINESSES', 'No businesses to delivery / pick up at this address, please change filters or change address.')}
311
- />
312
- </View>
313
- )
314
- }
315
- <ProductsList>
316
- {businessesSearchList.businesses?.filter((business: any) => business?.categories?.length > 0).map((business: any) => (
317
- <SingleBusinessSearch key={`card-${business?.id}`}>
168
+ <>
169
+ <FlatList
170
+ data={businessesSearchList.businesses?.filter((business: any) => business?.categories?.length > 0)}
171
+ ListFooterComponent={<BusinessSearchFooter
172
+ businessesSearchList={businessesSearchList}
173
+ handleCloseFilters={handleCloseFilters}
174
+ handleChangeFilters={handleChangeFilters}
175
+ brandList={brandList}
176
+ filters={filters}
177
+ handleChangeBrandFilter={handleChangeBrandFilter}
178
+ handleChangePriceRange={handleChangePriceRange}
179
+ businessTypes={businessTypes}
180
+ handleApplyFilters={handleApplyFilters}
181
+ clearFilters={clearFilters}
182
+ handleChangeActiveBusinessType={handleChangeActiveBusinessType}
183
+ openFilters={openFilters}
184
+ />}
185
+ ListHeaderComponent={<BusinessSearchHeader
186
+ businessesSearchList={businessesSearchList}
187
+ onChangeTermValue={onChangeTermValue}
188
+ termValue={termValue}
189
+ handleOpenfilters={handleOpenfilters}
190
+ />}
191
+ onScroll={(e: any) => handleScroll(e)}
192
+ showsVerticalScrollIndicator={false}
193
+ keyExtractor={(business: any, index: number) => `card-${business?.id}-${index}`}
194
+ renderItem={({ item: business }: any) => (
195
+ <BContainer
196
+ style={{ paddingHorizontal: 20, paddingTop: 0, paddingBottom: 0 }}
197
+ >
198
+ <SingleBusinessSearch>
318
199
  <SingleBusinessContainer>
319
200
  <BusinessInfo>
320
201
  {(business?.logo || theme.images?.dummies?.businessLogo) && (
@@ -380,210 +261,18 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
380
261
  }}
381
262
  />
382
263
  )))}
383
-
384
264
  </ScrollView>
385
265
  </SingleBusinessSearch>
386
- ))}
387
- {businessesSearchList?.loading && (
388
- <>
389
- {[...Array(3).keys()].map(
390
- (item, i) => (
391
- <View key={`skeleton:${i}`} style={{ width: '100%', marginTop: 20 }}>
392
- <Placeholder key={i} style={{ paddingHorizontal: 5 }} Animation={Fade}>
393
- <View style={{ flexDirection: 'row' }}>
394
- <PlaceholderLine
395
- width={24}
396
- height={70}
397
- style={{ marginRight: 10, marginBottom: 10 }}
398
- />
399
- <Placeholder style={{ paddingVertical: 10 }}>
400
- <PlaceholderLine width={20} style={{ marginBottom: 25 }} />
401
- <PlaceholderLine width={60} />
402
- </Placeholder>
403
- </View>
404
- </Placeholder>
405
- <Placeholder style={{ paddingHorizontal: 5, bottom: 10 }} Animation={Fade}>
406
- <View style={{ flexDirection: 'row-reverse', overflow: 'hidden' }}>
407
- <PlaceholderLine
408
- width={24}
409
- height={70}
410
- style={{ marginRight: 10, marginBottom: 5 }}
411
- />
412
- <Placeholder style={{ paddingVertical: 10 }}>
413
- <PlaceholderLine width={60} height={10} />
414
- <PlaceholderLine width={50} height={10} />
415
- <PlaceholderLine width={70} height={10} />
416
- </Placeholder>
417
- </View>
418
- </Placeholder>
419
- </View>
420
- ),
421
- )}
422
- </>
423
- )}
424
- </ProductsList>
425
- <OModal
426
- open={openFilters}
427
- onCancel={() => handleCloseFilters()}
428
- onClose={() => handleCloseFilters()}
429
- >
430
- <ScrollView style={styles.filterContainer}>
431
- <OText
432
- size={20}
433
- mBottom={15}
434
- style={{ marginTop: 10 }}
435
- >
436
- {t('FILTER', 'Filter')}
437
- </OText>
438
- <SortContainer>
439
- <OText weight='bold' mBottom={7} size={16}>
440
- {t('SORT', 'Sort')}
441
- </OText>
442
- {sortItems?.filter(item => !(orderState?.options?.type === 1 && item?.value === 'pickup_time') && !(orderState?.options?.type === 2 && item?.value === 'delivery_time'))?.map(item => (
443
- <TouchableOpacity
444
- key={item?.value}
445
- onPress={() => handleChangeFilters('orderBy', item?.value)}
446
- style={{ marginBottom: 7 }}
447
- >
448
- <OText
449
- weight={filters?.orderBy?.includes(item?.value) ? 'bold' : '500'}
450
- mBottom={filters?.orderBy?.includes(item?.value) ? 5 : 0}
451
- >
452
- {item?.text} {(filters?.orderBy?.includes(item?.value)) && <>{filters?.orderBy?.includes('-') ? <AntDesignIcon name='caretup' /> : <AntDesignIcon name='caretdown' />}</>}
453
- </OText>
454
- </TouchableOpacity>
455
- ))}
456
- </SortContainer>
457
- <BrandContainer>
458
- <OText
459
- size={16}
460
- weight='bold'
461
- lineHeight={24}
462
- style={{ marginBottom: 10 }}
463
- >
464
- {t('BRANDS', 'Brands')}
465
- </OText>
466
- {!brandList?.loading && !brandList?.error && brandList?.brands?.length > 0 && (
467
- <ScrollView
468
- style={{ maxHeight: 300, marginBottom: 10 }}
469
- showsVerticalScrollIndicator={true}
470
- nestedScrollEnabled={true}
471
- >
472
- {brandList?.brands.map((brand: any, i: number) => brand?.enabled && (
473
- <BrandItem
474
- key={i}
475
- onPress={() => handleChangeBrandFilter(brand?.id)}
476
- >
477
- <OText
478
- size={14}
479
- weight={'400'}
480
- lineHeight={24}
481
- >
482
- {brand?.name}
483
- </OText>
484
- {filters?.franchise_ids?.includes(brand?.id) && (
485
- <AntDesignIcon
486
- name='check'
487
- color={theme.colors.success500}
488
- size={16}
489
- />
490
- )}
491
- </BrandItem>
492
- ))}
493
- </ScrollView>
494
- )}
495
- {!brandList?.loading && ((brandList?.brands?.filter((brand: any) => brand?.enabled))?.length === 0) && (
496
- <OText size={14} weight='400'>{t('NO_RESULTS_FOUND', 'Sorry, no results found')}</OText>
497
- )}
498
- </BrandContainer>
499
- <PriceFilterWrapper>
500
- <OText
501
- size={16}
502
- weight='bold'
503
- lineHeight={24}
504
- style={{ marginBottom: 5 }}
505
- >
506
- {t('PRICE_RANGE', 'Price range')}
507
- </OText>
508
- <View style={styles.priceContainer}>
509
- {priceList.map((price: any, i: number) => (
510
- <OButton
511
- key={i}
512
- bgColor={(filters?.price_level === price?.level) ? theme.colors.primary : theme.colors.backgroundGray200}
513
- onClick={() => handleChangePriceRange(price?.level)}
514
- text={`${price.content} ${(filters?.price_level === price?.level) ? ' X' : ''}`}
515
- style={styles.priceItem}
516
- textStyle={{ fontSize: 10, color: (filters?.price_level === price?.level) ? theme.colors.backgroundLight : theme.colors.textNormal }}
517
- />
518
- ))}
519
- </View>
520
- </PriceFilterWrapper>
521
- {orderState?.options?.type === 1 && (
522
- <MaxSectionItem
523
- filters={filters}
524
- title={t('MAX_DELIVERY_FEE', 'Max delivery fee')}
525
- options={maxDeliveryFeeOptions}
526
- filter='max_delivery_price'
527
- handleChangeFilters={handleChangeFilters}
528
- />
529
- )}
530
- {[1, 2].includes(orderState?.options?.type) && (
531
- <MaxSectionItem
532
- filters={filters}
533
- title={orderState?.options?.type === 1 ? t('MAX_DELIVERY_TIME', 'Max delivery time') : t('MAX_PICKUP_TIME', 'Max pickup time')}
534
- options={maxTimeOptions}
535
- filter='max_eta'
536
- handleChangeFilters={handleChangeFilters}
537
- />
538
- )}
539
- <MaxSectionItem
540
- filters={filters}
541
- title={t('MAX_DISTANCE', 'Max distance')}
542
- options={maxDistanceOptions}
543
- filter='max_distance'
544
- handleChangeFilters={handleChangeFilters}
545
- />
546
- {businessTypes?.length > 0 && (
547
- <TagsContainer>
548
- <OText weight='bold' mBottom={7} size={16}>{t('BUSINESS_CATEGORIES', 'Business categories')}</OText>
549
- <View style={styles.businessTypesContainer}>
550
- {businessTypes.map((type: any, i: number) => type.enabled && (
551
- <OButton
552
- key={type?.id}
553
- bgColor={(filters?.business_types?.includes(type?.id) || (type?.id === null && filters?.business_types?.length === 0)) ? theme.colors.primary : theme.colors.backgroundGray200}
554
- onClick={() => handleChangeActiveBusinessType(type)}
555
- text={`${t(`BUSINESS_TYPE_${type.name.replace(/\s/g, '_').toUpperCase()}`, type.name)} ${filters?.business_types?.includes(type?.id) ? 'X' : ''}`}
556
- style={styles.categoryStyle}
557
- textStyle={{ fontSize: 10, color: (filters?.business_types?.includes(type?.id) || (type?.id === null && filters?.business_types?.length === 0)) ? '#fff' : theme.colors.textNormal }}
558
- />
559
- ))}
560
- </View>
561
- </TagsContainer>
562
- )}
563
- </ScrollView>
564
- <WrapperButtons>
565
- <View style={{ width: '50%' }}>
566
- <OButton
567
- text={t('APPLY', 'Apply')}
568
- parentStyle={styles.applyButton}
569
- textStyle={{ color: '#fff' }}
570
- onClick={() => handleApplyFilters()}
571
- />
572
- </View>
573
- <View style={{ width: '50%' }}>
574
- <OButton
575
- text={t('CLEAR_FILTERS', 'Clear')}
576
- bgColor={theme.colors.white}
577
- borderColor={theme.colors.primary}
578
- parentStyle={styles.applyButton}
579
- textStyle={{ color: theme.colors.primary }}
580
- onClick={() => clearFilters()}
581
- />
582
- </View>
583
- </WrapperButtons>
584
- </OModal>
585
- </BContainer>
586
- </IOScrollView>
266
+ </BContainer>
267
+ )}
268
+ />
269
+ {/* <IOScrollView
270
+ onScroll={(e: any) => handleScroll(e)}
271
+ showsVerticalScrollIndicator={false}
272
+ >
273
+
274
+ </IOScrollView> */}
275
+ </>
587
276
  )
588
277
  }
589
278
 
@@ -1,7 +1,7 @@
1
1
  import styled, { css } from 'styled-components/native'
2
2
 
3
3
  export const BContainer = styled.View`
4
- padding: 20px 40px;
4
+ padding: 20px;
5
5
  `
6
6
 
7
7
  export const SearchWrapper = styled.View`
@@ -64,7 +64,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
64
64
  container: {
65
65
  height: windowHeight,
66
66
  paddingVertical: 30,
67
- paddingHorizontal: 40
67
+ paddingHorizontal: 20
68
68
  },
69
69
  businessLogo: {
70
70
  backgroundColor: 'white',
@@ -319,11 +319,10 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
319
319
 
320
320
  return (
321
321
  <>
322
- <PreOrderContainer contentContainerStyle={{ paddingVertical: 32, paddingHorizontal: 40 }}>
322
+ <PreOrderContainer contentContainerStyle={{ paddingVertical: 32, paddingHorizontal: 20 }}>
323
323
  <TouchableOpacity onPress={() => goToBack && goToBack()} style={{ marginBottom: 12 }}>
324
324
  <IconAntDesign
325
325
  name='close'
326
- color={theme.colors.textThird}
327
326
  size={24}
328
327
  style={{ marginLeft: -4 }}
329
328
  />
@@ -529,6 +528,8 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
529
528
  <OButton
530
529
  text={t('GO_TO_MENU', 'Go to menu')}
531
530
  textStyle={{ color: 'white' }}
531
+ bgColor={theme.colors.primary}
532
+ borderColor={theme.colors.primary}
532
533
  style={{ borderRadius: 7.6, marginBottom: 20, marginTop: 30 }}
533
534
  onClick={() => handleClickBusiness()}
534
535
  isDisabled={isAsap || !(dateSelected && timeSelected)}
@@ -92,7 +92,7 @@ const BusinessProductsCategoriesUI = (props: any) => {
92
92
  ref={tabsRef}
93
93
  horizontal
94
94
  style={{ ...styles.container, borderBottomWidth: loading ? 0 : 1 }}
95
- contentContainerStyle={{ paddingHorizontal: 40 }}
95
+ contentContainerStyle={{ paddingHorizontal: 20 }}
96
96
  showsHorizontalScrollIndicator={false}
97
97
  onScroll={(e: any) => setScrollOffsetX(e.nativeEvent.contentOffset.x)}
98
98
  scrollEventThrottle={16}
@@ -237,7 +237,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
237
237
  {products.sort((a: any, b: any) => a.rank - b.rank).map((product: any, i: any) => (
238
238
  <SingleProductCard
239
239
  key={`${product?.id}_${i}`}
240
- enableIntersection={!isFiltMode}
240
+ // enableIntersection={!isFiltMode}
241
241
  isSoldOut={product.inventoried && !product.quantity}
242
242
  businessId={businessId}
243
243
  product={product}
@@ -18,15 +18,12 @@ export const RibbonBox = styled.View`
18
18
  background-color: ${(props: any) => props.theme.colors.primary};
19
19
  padding: 2px 8px;
20
20
  max-width: 180px;
21
-
22
21
  ${(props: any) => props.bgColor && css`
23
22
  background-color: ${props.bgColor};
24
23
  `}
25
-
26
24
  ${(props: any) => props.isRoundRect && css`
27
25
  border-radius: 7.6px;
28
26
  `}
29
-
30
27
  ${(props: any) => props.isCapsule && css`
31
28
  border-radius: 50px;
32
29
  `}
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from 'react'
2
- import { View, TouchableOpacity, StyleSheet, SafeAreaView, Dimensions, Platform, KeyboardAvoidingViewBase, KeyboardAvoidingView, Keyboard, KeyboardEvent, BackHandler } from 'react-native'
2
+ import { View, TouchableOpacity, StyleSheet, SafeAreaView, Dimensions, Platform, KeyboardAvoidingViewBase, KeyboardAvoidingView, Keyboard, KeyboardEvent, BackHandler, ScrollView } from 'react-native'
3
3
  import { IOScrollView } from 'react-native-intersection-observer'
4
4
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
5
5
  import { useTheme } from 'styled-components/native';
@@ -114,7 +114,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
114
114
  },
115
115
  searchIcon: {
116
116
  borderWidth: 0,
117
- padding: 15,
117
+ padding: 10,
118
118
  justifyContent: 'center',
119
119
  shadowColor: theme.colors.clear,
120
120
  },
@@ -148,7 +148,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
148
148
  const openCarts = (Object.values(orderState?.carts)?.filter((cart: any) => cart?.products && cart?.products?.length && cart?.status !== 2 && cart?.valid_schedule && cart?.valid_products && cart?.valid_address && cart?.valid_maximum && cart?.valid_minimum && !cart?.wallets) || null) || []
149
149
  const currentCart: any = Object.values(orderState.carts).find((cart: any) => cart?.business?.slug === business?.slug) ?? {}
150
150
  const isOpenFiltProducts = isOpenSearchBar && !!searchValue
151
- const filtProductsHeight = Platform.OS === 'ios' ? 165 : 100
151
+ const filtProductsHeight = Platform.OS === 'ios' ? 65 : 30
152
152
  const viewOrderButtonVisible = !loading && auth && currentCart?.products?.length > 0 && categoryState.products.length !== 0
153
153
 
154
154
  const onRedirect = (route: string, params?: any) => {
@@ -190,12 +190,17 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
190
190
  setOpenService(true)
191
191
  return
192
192
  }
193
- onRedirect('ProductDetails', {
194
- product: product,
195
- businessSlug: business.slug,
196
- businessId: business.id || product?.category?.business_id,
197
- productAddedToCartLength
198
- })
193
+ if (product?.enabled) {
194
+ onRedirect('ProductDetails', {
195
+ product: product,
196
+ businessSlug: business.slug,
197
+ businessId: business.id || product?.category?.business_id,
198
+ productAddedToCartLength,
199
+ isRedirect: false
200
+ })
201
+ } else {
202
+ showToast(ToastType.Error, t('PRODUCT_NOT_FOUND', 'Product not found'))
203
+ }
199
204
  }
200
205
  events.emit('product_clicked', product)
201
206
  }
@@ -376,6 +381,14 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
376
381
  setViewedCategory(_viewedCategory)
377
382
  events.emit('product_list_viewed', _viewedCategory)
378
383
  }
384
+ } else {
385
+ if (business.categories) {
386
+ const categoryAll: any = {}
387
+ categoryAll.business_id = business.id
388
+ categoryAll.id = null
389
+ categoryAll.name = 'All'
390
+ events.emit('product_list_viewed', categoryAll)
391
+ }
379
392
  }
380
393
  }, [business?.lazy_load_products_recommended, selectedCategoryId, categorySelected?.id, viewedCategory])
381
394
 
@@ -490,8 +503,8 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
490
503
  {business?.categories?.length > 0 && isOpenFiltProducts && (
491
504
  <FiltProductsContainer
492
505
  style={{
493
- height: Dimensions.get('window').height - filtProductsHeight - keyboardHeight - (keyboardHeight > 0 && viewOrderButtonVisible ? 55 : 0),
494
- top: Platform.OS === 'ios' ? (searchBarHeight - 10) + insets.top : searchBarHeight,
506
+ height: Dimensions.get('window').height - filtProductsHeight - keyboardHeight - (keyboardHeight > 0 && viewOrderButtonVisible ? 10 : 0),
507
+ top: Platform.OS === 'ios' ? viewOrderButtonVisible ? (searchBarHeight - 10) + insets.top + 10 : (searchBarHeight - 10) + insets.top : searchBarHeight,
495
508
  }}
496
509
  contentContainerStyle={{ flexGrow: 1 }}
497
510
  >
@@ -529,10 +542,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
529
542
  </View>
530
543
  </FiltProductsContainer>
531
544
  )}
532
- {isOpenFiltProducts && (
533
- <BackgroundGray isIos={Platform.OS === 'ios'} />
534
- )}
535
- <IOScrollView
545
+ <ScrollView
536
546
  stickyHeaderIndices={[business?.professionals?.length > 0 ? 4 : 3]}
537
547
  style={{
538
548
  ...styles.mainContainer,
@@ -600,7 +610,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
600
610
  <>
601
611
  <WrapContent
602
612
  onLayout={(event: any) => setProductListLayout(event.nativeEvent.layout)}
603
- style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}
613
+ style={{ paddingHorizontal: 20 }}
604
614
  >
605
615
  <BusinessProductsList
606
616
  categories={[
@@ -657,7 +667,10 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
657
667
  </WrapContent>
658
668
  </>
659
669
  )}
660
- </IOScrollView>
670
+ {isOpenFiltProducts && (
671
+ <BackgroundGray isIos={Platform.OS === 'ios'} />
672
+ )}
673
+ </ScrollView>
661
674
  {viewOrderButtonVisible && (
662
675
  <View style={{ marginBottom: 0 }}>
663
676
  <FloatingButton
@@ -714,7 +727,6 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
714
727
  professionalList={business?.professionals}
715
728
  professionalSelected={professionalSelected}
716
729
  handleChangeProfessional={handleChangeProfessionalSelected}
717
- handleChangeProfessional={handleChangeProfessionalSelected}
718
730
  handleUpdateProfessionals={handleUpdateProfessionals}
719
731
  onSave={() => setOpenService(false)}
720
732
  onClose={() => setOpenService(false)}
@@ -50,7 +50,7 @@ export const BackgroundGray = styled.View`
50
50
  `
51
51
 
52
52
  export const ProfessionalFilterWrapper = styled.View`
53
- padding-left: 40px;
53
+ padding-left: 20px;
54
54
  margin-bottom: 35px;
55
55
  `
56
56
 
@@ -63,6 +63,6 @@ export const NearBusiness = styled.View`
63
63
  export const TopActions = styled.TouchableOpacity`
64
64
  height: 60px;
65
65
  justify-content: center;
66
- padding-horizontal: 30px;
66
+ padding-horizontal: 20px;
67
67
  width: 100px;
68
68
  `;