ordering-ui-react-native 0.16.55 → 0.16.56-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 (200) hide show
  1. package/package.json +6 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/index.tsx +61 -63
  4. package/src/components/ActiveOrders/styles.tsx +8 -14
  5. package/src/components/BusinessInformation/index.tsx +33 -4
  6. package/src/components/BusinessInformation/styles.tsx +2 -2
  7. package/src/components/BusinessProductsList/index.tsx +10 -10
  8. package/src/components/BusinessesListing/index.tsx +1 -1
  9. package/src/components/Checkout/index.tsx +2 -1
  10. package/src/components/LanguageSelector/index.tsx +21 -16
  11. package/src/components/Messages/index.tsx +2 -2
  12. package/src/components/NotificationSetting/index.tsx +85 -0
  13. package/src/components/OrdersOption/index.tsx +54 -56
  14. package/src/components/PaymentOptions/index.tsx +298 -345
  15. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  16. package/src/components/SingleProductReview/index.tsx +7 -4
  17. package/src/components/StripeElementsForm/index.tsx +25 -16
  18. package/src/components/VerifyPhone/styles.tsx +1 -2
  19. package/src/components/shared/OBottomPopup.tsx +6 -2
  20. package/src/components/shared/OToast.tsx +4 -4
  21. package/src/index.tsx +2 -0
  22. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  23. package/src/utils/index.tsx +2 -1
  24. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
  25. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  26. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  27. package/themes/business/src/components/Chat/index.tsx +40 -32
  28. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  29. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  30. package/themes/business/src/components/MapView/index.tsx +12 -1
  31. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  32. package/themes/business/src/components/NewOrderNotification/index.tsx +26 -41
  33. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +40 -30
  34. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
  35. package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
  36. package/themes/business/src/components/OrdersOption/index.tsx +76 -77
  37. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  38. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  39. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  40. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  41. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  42. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  43. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  44. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  45. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  46. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  47. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  48. package/themes/business/src/components/PreviousOrders/index.tsx +440 -245
  49. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  50. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  51. package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
  52. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  53. package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
  54. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  55. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  56. package/themes/business/src/components/shared/OLink.tsx +24 -12
  57. package/themes/business/src/components/shared/OText.tsx +3 -2
  58. package/themes/business/src/types/index.tsx +25 -11
  59. package/themes/business/src/utils/index.tsx +10 -0
  60. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  61. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  62. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  63. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  64. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  65. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  66. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  67. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  68. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  69. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  70. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  71. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  72. package/themes/kiosk/src/types/index.d.ts +2 -0
  73. package/themes/original/index.tsx +8 -0
  74. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  75. package/themes/original/src/components/AddressForm/index.tsx +153 -137
  76. package/themes/original/src/components/AddressList/index.tsx +1 -1
  77. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  78. package/themes/original/src/components/BusinessBasicInformation/index.tsx +53 -37
  79. package/themes/original/src/components/BusinessController/index.tsx +112 -48
  80. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  81. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  82. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  83. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  84. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  85. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  86. package/themes/original/src/components/BusinessListingSearch/index.tsx +80 -138
  87. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  88. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  89. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  90. package/themes/original/src/components/BusinessProductsList/index.tsx +59 -61
  91. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  92. package/themes/original/src/components/BusinessProductsListing/index.tsx +177 -81
  93. package/themes/original/src/components/BusinessProductsListing/styles.tsx +14 -12
  94. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  95. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +112 -107
  97. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  98. package/themes/original/src/components/BusinessesListing/index.tsx +17 -10
  99. package/themes/original/src/components/Cart/index.tsx +82 -15
  100. package/themes/original/src/components/Cart/styles.tsx +4 -0
  101. package/themes/original/src/components/CartContent/index.tsx +27 -17
  102. package/themes/original/src/components/CartContent/styles.tsx +1 -1
  103. package/themes/original/src/components/Checkout/index.tsx +115 -118
  104. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  105. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  106. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  107. package/themes/original/src/components/DriverTips/index.tsx +4 -4
  108. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  109. package/themes/original/src/components/FavoriteList/index.tsx +69 -45
  110. package/themes/original/src/components/FloatingButton/index.tsx +0 -1
  111. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  112. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  113. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  114. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  115. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
  116. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
  117. package/themes/original/src/components/HelpGuide/index.tsx +9 -8
  118. package/themes/original/src/components/HelpOrder/index.tsx +9 -8
  119. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  120. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  121. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  122. package/themes/original/src/components/LoginForm/index.tsx +98 -41
  123. package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
  124. package/themes/original/src/components/Messages/index.tsx +35 -20
  125. package/themes/original/src/components/MomentOption/index.tsx +8 -6
  126. package/themes/original/src/components/MultiCart/index.tsx +63 -0
  127. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  128. package/themes/original/src/components/MultiCheckout/index.tsx +10 -2
  129. package/themes/original/src/components/MultiOrdersDetails/index.tsx +34 -16
  130. package/themes/original/src/components/MyOrders/index.tsx +89 -25
  131. package/themes/original/src/components/NavBar/index.tsx +11 -5
  132. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  133. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  134. package/themes/original/src/components/Notifications/index.tsx +148 -0
  135. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  136. package/themes/original/src/components/OrderDetails/index.tsx +132 -18
  137. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  138. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  139. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  140. package/themes/original/src/components/OrderProgress/index.tsx +77 -66
  141. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  142. package/themes/original/src/components/OrderSummary/index.tsx +2 -35
  143. package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
  144. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  145. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
  146. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  147. package/themes/original/src/components/OrdersOption/index.tsx +95 -55
  148. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  149. package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
  150. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  151. package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
  152. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  153. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  154. package/themes/original/src/components/ProductForm/index.tsx +367 -384
  155. package/themes/original/src/components/ProductForm/styles.tsx +7 -12
  156. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  157. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  158. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  159. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
  160. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  161. package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
  162. package/themes/original/src/components/Promotions/index.tsx +232 -219
  163. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  164. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  165. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  166. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  167. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  168. package/themes/original/src/components/ReviewTrigger/index.tsx +28 -10
  169. package/themes/original/src/components/ReviewTrigger/styles.tsx +10 -3
  170. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  171. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  172. package/themes/original/src/components/ServiceForm/index.tsx +330 -266
  173. package/themes/original/src/components/SignupForm/index.tsx +134 -89
  174. package/themes/original/src/components/SingleOrderCard/index.tsx +219 -129
  175. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  176. package/themes/original/src/components/SingleProductCard/index.tsx +116 -72
  177. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -9
  178. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  179. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  180. package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
  181. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -5
  182. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  183. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  184. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  185. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  186. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  187. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  188. package/themes/original/src/components/Wallets/index.tsx +176 -164
  189. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  190. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  191. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  192. package/themes/original/src/components/shared/OBottomPopup.tsx +32 -21
  193. package/themes/original/src/components/shared/OButton.tsx +8 -3
  194. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  195. package/themes/original/src/components/shared/OInput.tsx +10 -1
  196. package/themes/original/src/layouts/Container.tsx +13 -9
  197. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  198. package/themes/original/src/types/index.tsx +63 -8
  199. package/themes/original/src/utils/index.tsx +103 -58
  200. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -3,7 +3,7 @@ import { useLanguage, BusinessSearchList, useOrder, useUtils, showToast, ToastTy
3
3
  import { ScrollView, StyleSheet, TouchableOpacity, Platform, View, Dimensions } from 'react-native'
4
4
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
5
5
  import { useTheme } from 'styled-components/native'
6
- import { OButton, OIcon, OModal, OText } from '../shared'
6
+ import { OButton, OModal, OText } from '../shared'
7
7
  import { SearchBar } from '../SearchBar';
8
8
  import { BusinessController } from '../BusinessController'
9
9
  import { NotFoundSource } from '../NotFoundSource'
@@ -19,14 +19,14 @@ import {
19
19
  Metadata,
20
20
  SingleBusinessContainer,
21
21
  LoadMoreBusinessContainer,
22
- ProgressContentWrapper,
23
- ProgressBar,
24
22
  TagsContainer,
25
23
  SortContainer,
26
24
  BrandContainer,
27
25
  BrandItem,
28
26
  PriceFilterWrapper,
29
- OptionTitle
27
+ OptionTitle,
28
+ BContainer,
29
+ WrapperButtons
30
30
  } from './styles'
31
31
  import FastImage from 'react-native-fast-image'
32
32
  import { convertHoursToMinutes } from '../../utils'
@@ -34,8 +34,8 @@ import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
34
34
  import { BusinessSearchParams } from '../../types'
35
35
  import { MyOrders } from '../MyOrders'
36
36
  import { useIsFocused } from '@react-navigation/native';
37
-
38
-
37
+ import { MaxSectionItem } from './MaxSectionItem'
38
+ import { BusinessControllerSkeletons } from './BusinessControllerSkeletons'
39
39
  export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
40
40
  const {
41
41
  navigation,
@@ -52,7 +52,8 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
52
52
  brandList,
53
53
  onNavigationRedirect,
54
54
  handleUpdateBusinessList,
55
- handleUpdateProducts
55
+ handleUpdateProducts,
56
+ brandId
56
57
  } = props
57
58
 
58
59
  const screenHeight = Dimensions.get('window').height;
@@ -75,6 +76,8 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
75
76
  { text: t('PICKUP_TIME', 'Pickup time'), value: 'pickup_time' }
76
77
  ]
77
78
 
79
+ const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
80
+
78
81
  const priceList = [
79
82
  { level: '1', content: '$' },
80
83
  { level: '2', content: '$$' },
@@ -96,15 +99,11 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
96
99
  width: '100%'
97
100
  },
98
101
  searchInput: {
99
- fontSize: 10,
102
+ fontSize: 12,
100
103
  },
101
104
  productsContainer: {
102
105
  marginTop: 20
103
106
  },
104
- maxContainer: {
105
- flexDirection: 'row',
106
- justifyContent: 'space-between'
107
- },
108
107
  businessTypesContainer: {
109
108
  width: '100%',
110
109
  flexDirection: 'row',
@@ -139,7 +138,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
139
138
  borderWidth: 0
140
139
  },
141
140
  applyButton: {
142
- paddingHorizontal: 40,
141
+ paddingHorizontal: 10,
143
142
  width: '100%',
144
143
  marginTop: 20
145
144
  }
@@ -150,10 +149,14 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
150
149
  }
151
150
 
152
151
  const handleCloseFilters = () => {
153
- setFilters({ business_types: [], orderBy: 'default', franchise_ids: [], price_level: null })
152
+ clearFilters()
154
153
  setOpenFilters(false)
155
154
  }
156
155
 
156
+ const clearFilters = () => {
157
+ setFilters({ business_types: [], orderBy: 'default', franchise_ids: [], price_level: null })
158
+ }
159
+
157
160
  const handleChangeActiveBusinessType = (type: any) => {
158
161
  if (type?.id === null) {
159
162
  handleChangeFilters('business_types', [])
@@ -220,123 +223,25 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
220
223
  handleSearchbusinessAndProducts(true)
221
224
  }, [])
222
225
 
223
-
226
+
224
227
  useEffect(() => {
225
228
  handleChangeTermValue('')
226
229
  }, [isFocused])
227
230
 
228
- const MaxSectionItem = ({ title, options, filter }: any) => {
229
- const parseValue = (option: number) => {
230
- return filter === 'max_distance'
231
- ? `${option / 1000} ${t('KM', 'Km')}`
232
- : filter === 'max_eta'
233
- ? `${option} ${t('MIN', 'min')}`
234
- : parsePrice(option)
235
- }
236
- return (
237
- <View style={{ marginBottom: 20 }}>
238
- <OText weight='bold' mBottom={10} size={16}>
239
- {title}
240
- </OText>
241
- <ProgressContentWrapper>
242
- <ProgressBar style={{ width: `${((options.indexOf(filters?.[filter]) / 3) * 100) ?? 100}%` }} />
243
- </ProgressContentWrapper>
244
- <View style={styles.maxContainer}>
245
- {options.map((option: any, i: number) => (
246
- <TouchableOpacity
247
- onPress={() => handleChangeFilters(filter, option)}
248
- key={option}
249
- >
250
- <OText
251
- size={12}
252
- weight={filters?.[filter] === option || (option === 'default' && (filters?.[filter] === 'default' || !filters?.[filter])) ? 'bold' : '500'}
253
- >
254
- {option === 'default' ? `${parseValue(options[i - 1])}+` : parseValue(option)}
255
- </OText>
256
- </TouchableOpacity>
257
- ))}
258
- </View>
259
- </View>
260
- )
261
- }
262
-
263
- const BusinessControllerSkeletons = () => {
264
- return (
265
- <>
266
- {[
267
- ...Array(
268
- paginationProps.nextPageItems
269
- ? paginationProps.nextPageItems
270
- : 3,
271
- ).keys(),
272
- ].map((item, i) => (
273
- <Placeholder
274
- Animation={Fade}
275
- key={i}
276
- style={{ width: 320, marginRight: 20, marginTop: 20 }}>
277
- <View style={{ width: 320 }}>
278
- <PlaceholderLine
279
- height={155}
280
- style={{ marginBottom: 20, borderRadius: 25 }}
281
- />
282
- <View style={{ paddingHorizontal: 10 }}>
283
- <View
284
- style={{
285
- flexDirection: 'row',
286
- justifyContent: 'space-between',
287
- }}>
288
- <PlaceholderLine
289
- height={25}
290
- width={40}
291
- style={{ marginBottom: 10 }}
292
- />
293
- <PlaceholderLine
294
- height={25}
295
- width={20}
296
- style={{ marginBottom: 10 }}
297
- />
298
- </View>
299
- <PlaceholderLine
300
- height={20}
301
- width={30}
302
- style={{ marginBottom: 10 }}
303
- />
304
- <PlaceholderLine
305
- height={20}
306
- width={80}
307
- style={{ marginBottom: 0 }}
308
- />
309
- </View>
310
- </View>
311
- </Placeholder>
312
- ))}
313
- </>
314
- )
315
- }
316
-
317
231
  return (
318
- <ScrollView style={styles.container}>
319
- <WrapHeader style={{ paddingTop: top + 20, marginVertical: 2 }}>
320
- <OText
321
- size={20}
322
- mBottom={15}
323
- weight='bold'
324
- style={{ marginTop: 10 }}
325
- >
326
- {t('SEARCH', 'Search')}
327
- </OText>
328
- </WrapHeader>
232
+ <BContainer
233
+ style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}
234
+ >
329
235
  <SearchWrapper>
330
236
  <SearchBar
331
- autoFocus
332
237
  lazyLoad
238
+ {...(isChewLayout && { height: 55 })}
333
239
  inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
334
240
  placeholder={`${t('SEARCH_BUSINESSES', 'Search Businesses')} / ${t('TYPE_AT_LEAST_3_CHARACTERS', 'type at least 3 characters')}`}
335
241
  onSearch={(val: string) => handleChangeTermValue(val)}
336
242
  value={termValue}
337
243
  iconCustomRight={<AntDesignIcon name='filter' size={16} style={{ bottom: 2 }} onPress={() => handleOpenfilters()} />}
338
244
  />
339
-
340
245
  </SearchWrapper>
341
246
  {
342
247
  noResults && (
@@ -347,12 +252,20 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
347
252
  </View>
348
253
  )
349
254
  }
350
- {businessesSearchList.businesses?.length > 0 && (
255
+ {businessesSearchList.businesses?.length > 0 && termValue?.length === 0 && (
351
256
  <MyOrders
352
257
  hideOrders
353
258
  businessesSearchList={businessesSearchList}
354
259
  onNavigationRedirect={onNavigationRedirect}
355
260
  BusinessControllerSkeletons={BusinessControllerSkeletons}
261
+ businessPaginationProps={paginationProps}
262
+ franchiseId={brandId}
263
+ hideBackBtn
264
+ titleStyle={{
265
+ paddingHorizontal: 0,
266
+ marginTop: 0,
267
+ marginLeft: 0
268
+ }}
356
269
  />
357
270
  )}
358
271
 
@@ -361,18 +274,26 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
361
274
  {t('BUSINESSES', 'Businesses')}
362
275
  </OText>
363
276
  </OptionTitle>
364
- <ScrollView horizontal>
277
+ <ScrollView horizontal showsHorizontalScrollIndicator={false}>
365
278
  {businessesSearchList.businesses?.length > 0 && businessesSearchList.businesses.map((business: any, i: number) => (
366
- <BusinessController
279
+ <View
367
280
  key={business.id}
368
- business={business}
369
- isBusinessOpen={business.open}
370
- handleCustomClick={() => onBusinessClick(business)}
371
- handleUpdateBusinessList={handleUpdateBusinessList}
372
- orderType={orderState?.options?.type}
373
- style={{ width: screenWidth - 80, marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0 }}
374
- />
281
+ style={{
282
+ width: screenWidth - 120,
283
+ marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0
284
+ }}
285
+ >
286
+ <BusinessController
287
+ business={business}
288
+ isBusinessOpen={business.open}
289
+ enableIntersection={false}
290
+ handleCustomClick={() => onBusinessClick(business)}
291
+ handleUpdateBusinessList={handleUpdateBusinessList}
292
+ orderType={orderState?.options?.type}
293
+ />
294
+ </View>
375
295
  ))}
296
+ {console.log(screenWidth)}
376
297
  {!businessesSearchList.loading && paginationProps?.totalPages && paginationProps?.currentPage < paginationProps?.totalPages && (
377
298
  <LoadMoreBusinessContainer>
378
299
  <OButton
@@ -385,7 +306,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
385
306
  </LoadMoreBusinessContainer>
386
307
  )}
387
308
  {businessesSearchList.loading && (
388
- <BusinessControllerSkeletons />
309
+ <BusinessControllerSkeletons paginationProps={paginationProps} />
389
310
  )}
390
311
  </ScrollView>
391
312
  <ProductsList>
@@ -432,17 +353,18 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
432
353
  style={{ borderRadius: 50, paddingLeft: 5, paddingRight: 5, height: 20 }}
433
354
  />
434
355
  </SingleBusinessContainer>
435
- <ScrollView horizontal style={styles.productsContainer}>
356
+ <ScrollView horizontal style={styles.productsContainer} contentContainerStyle={{ flexGrow: 1 }}>
436
357
  {business?.categories?.map((category: any) => category?.products?.map((product: any, i: number) => (
437
358
  <SingleProductCard
438
359
  key={product?.id}
439
360
  isSoldOut={(product.inventoried && !product.quantity)}
440
361
  product={product}
362
+ enableIntersection={false}
441
363
  businessId={business?.id}
442
364
  onProductClick={(product: any) => onProductClick(business, category?.id, product?.id)}
443
365
  productAddedToCartLength={0}
444
366
  handleUpdateProducts={(productId: number, changes: any) => handleUpdateProducts(productId, category?.id, business?.id, changes)}
445
- style={{ width: screenWidth - 80, marginRight: i === category?.products?.length - 1 ? 0 : 20 }}
367
+ style={{ width: screenWidth - 80, maxWidth: screenWidth - 80, marginRight: 20 }}
446
368
  />
447
369
  )))}
448
370
 
@@ -468,7 +390,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
468
390
  </View>
469
391
  </Placeholder>
470
392
  <Placeholder style={{ paddingHorizontal: 5, bottom: 10 }} Animation={Fade}>
471
- <View style={{ flexDirection: 'row-reverse' }}>
393
+ <View style={{ flexDirection: 'row-reverse', overflow: 'hidden' }}>
472
394
  <PlaceholderLine
473
395
  width={24}
474
396
  height={70}
@@ -585,22 +507,28 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
585
507
  </PriceFilterWrapper>
586
508
  {orderState?.options?.type === 1 && (
587
509
  <MaxSectionItem
510
+ filters={filters}
588
511
  title={t('MAX_DELIVERY_FEE', 'Max delivery fee')}
589
512
  options={maxDeliveryFeeOptions}
590
513
  filter='max_delivery_price'
514
+ handleChangeFilters={handleChangeFilters}
591
515
  />
592
516
  )}
593
517
  {[1, 2].includes(orderState?.options?.type) && (
594
518
  <MaxSectionItem
519
+ filters={filters}
595
520
  title={orderState?.options?.type === 1 ? t('MAX_DELIVERY_TIME', 'Max delivery time') : t('MAX_PICKUP_TIME', 'Max pickup time')}
596
521
  options={maxTimeOptions}
597
522
  filter='max_eta'
523
+ handleChangeFilters={handleChangeFilters}
598
524
  />
599
525
  )}
600
526
  <MaxSectionItem
527
+ filters={filters}
601
528
  title={t('MAX_DISTANCE', 'Max distance')}
602
529
  options={maxDistanceOptions}
603
530
  filter='max_distance'
531
+ handleChangeFilters={handleChangeFilters}
604
532
  />
605
533
  {businessTypes?.length > 0 && (
606
534
  <TagsContainer>
@@ -620,14 +548,28 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
620
548
  </TagsContainer>
621
549
  )}
622
550
  </ScrollView>
623
- <OButton
624
- text={t('APPLY', 'Apply')}
625
- parentStyle={styles.applyButton}
626
- textStyle={{ color: '#fff' }}
627
- onClick={() => handleApplyFilters()}
628
- />
551
+ <WrapperButtons>
552
+ <View style={{ width: '50%' }}>
553
+ <OButton
554
+ text={t('APPLY', 'Apply')}
555
+ parentStyle={styles.applyButton}
556
+ textStyle={{ color: '#fff' }}
557
+ onClick={() => handleApplyFilters()}
558
+ />
559
+ </View>
560
+ <View style={{ width: '50%' }}>
561
+ <OButton
562
+ text={t('CLEAR_FILTERS', 'Clear')}
563
+ bgColor={theme.colors.white}
564
+ borderColor={theme.colors.primary}
565
+ parentStyle={styles.applyButton}
566
+ textStyle={{ color: theme.colors.primary }}
567
+ onClick={() => clearFilters()}
568
+ />
569
+ </View>
570
+ </WrapperButtons>
629
571
  </OModal>
630
- </ScrollView>
572
+ </BContainer>
631
573
  )
632
574
  }
633
575
 
@@ -1,5 +1,9 @@
1
1
  import styled, { css } from 'styled-components/native'
2
2
 
3
+ export const BContainer = styled.View`
4
+ padding: 20px 40px;
5
+ `
6
+
3
7
  export const WrapHeader = styled.View`
4
8
  width: 100%;
5
9
  padding-vertical: 20px;
@@ -55,18 +59,6 @@ export const LoadMoreBusinessContainer = styled.View`
55
59
  margin-left: 20px;
56
60
  `
57
61
 
58
- export const ProgressBar = styled.View`
59
- height: 4px;
60
- background: ${(props: any) => props.theme.colors.textNormal};
61
- `
62
-
63
- export const ProgressContentWrapper = styled.View`
64
- height: 4px;
65
- background: #F8F9FA;
66
- margin-bottom: 10px;
67
- flex: 1;
68
- `
69
-
70
62
  export const TagsContainer = styled.View`
71
63
  padding-bottom: 10px;
72
64
  `
@@ -94,3 +86,9 @@ export const OptionTitle = styled.View`
94
86
  margin-left: ${() => props.isBusinessesSearchList ? '0' : '40px'};
95
87
  `}
96
88
  `
89
+
90
+ export const WrapperButtons = styled.View`
91
+ flex-direction: row;
92
+ width: 100%;
93
+ justify-content: space-between;
94
+ `
@@ -0,0 +1,87 @@
1
+ import React from 'react'
2
+ import { useTheme } from 'styled-components/native'
3
+ import { StyleSheet } from 'react-native'
4
+ import { SubCategoriesContainer, ContainerButton } from './styles'
5
+ import { OButton } from '../../shared'
6
+ import { useLanguage } from 'ordering-components/native'
7
+
8
+ function SubcategoriesComponentPropsAreEqual(prev: any, next: any) {
9
+ return prev.subcategoriesSelected === next.subcategoriesSelected &&
10
+ prev.category === next.category
11
+ }
12
+
13
+ interface SubcategoriesComponentParams {
14
+ subcategoriesSelected?: any,
15
+ category?: any,
16
+ onClickSubcategory: any
17
+ }
18
+
19
+ const SubcategoriesComponent = (props : SubcategoriesComponentParams) => {
20
+ const {
21
+ subcategoriesSelected,
22
+ category,
23
+ onClickSubcategory
24
+ } = props
25
+
26
+ const theme = useTheme()
27
+ const [, t] = useLanguage()
28
+ const allsubcategorySelected = !subcategoriesSelected?.some((subcategory: any) => category?.id === subcategory?.parent_category_id)
29
+
30
+ const bpStyles = StyleSheet.create({
31
+ catWrap: { flexDirection: 'row', alignItems: 'center', marginBottom: 19 },
32
+ catIcon: {
33
+ borderRadius: 7.6,
34
+ shadowColor: '#000000',
35
+ shadowOpacity: 0.1,
36
+ shadowOffset: { width: 0, height: 0 },
37
+ shadowRadius: 1,
38
+ marginEnd: 13,
39
+ },
40
+ categoryButtonStyle: {
41
+ borderWidth: 0,
42
+ marginLeft: 5,
43
+ marginRight: 5,
44
+ marginBottom: 10,
45
+ height: 35,
46
+ paddingLeft: 3,
47
+ paddingRight: 3,
48
+ }
49
+ });
50
+
51
+
52
+ return (
53
+ <SubCategoriesContainer>
54
+ <ContainerButton
55
+ isSelected={allsubcategorySelected}
56
+ >
57
+ <OButton
58
+ onClick={() => onClickSubcategory(null, category)}
59
+ bgColor={allsubcategorySelected ? theme.colors.primary : theme.colors.backgroundGray}
60
+ text={`${t('ALL', 'All')} ${allsubcategorySelected ? 'X' : ''}`}
61
+ style={bpStyles.categoryButtonStyle}
62
+ textStyle={{ color: allsubcategorySelected ? theme.colors.white : theme.colors.textNormal, fontSize: 12 }}
63
+ />
64
+ </ContainerButton>
65
+ {category?.subcategories?.map((subcategory: any) => {
66
+ const isSubcategorySelected = subcategoriesSelected?.find((_subcategory: any) => _subcategory?.id === subcategory?.id)
67
+ return (
68
+ <ContainerButton
69
+ key={subcategory?.id}
70
+ isSelected={isSubcategorySelected}
71
+ >
72
+ <OButton
73
+ onClick={() => onClickSubcategory(subcategory, category)}
74
+ bgColor={isSubcategorySelected ? theme.colors.primary : theme.colors.backgroundGray}
75
+ text={`${subcategory?.name} ${isSubcategorySelected ? 'X' : ''}`}
76
+ style={bpStyles.categoryButtonStyle}
77
+ textStyle={{ color: isSubcategorySelected ? theme.colors.white : theme.colors.textNormal, fontSize: 12 }}
78
+ />
79
+ </ContainerButton>
80
+ )
81
+ }
82
+ )}
83
+ </SubCategoriesContainer>
84
+ )
85
+ }
86
+
87
+ export const SubcategoriesComponentMemoized = React.memo(SubcategoriesComponent, SubcategoriesComponentPropsAreEqual)
@@ -0,0 +1,12 @@
1
+ import styled from "styled-components/native";
2
+
3
+ export const SubCategoriesContainer = styled.View`
4
+ flex-direction: row;
5
+ flex-wrap: wrap;
6
+ margin-bottom: 10px;
7
+ `
8
+
9
+ export const ContainerButton = styled.View`
10
+ `
11
+
12
+ export const HeaderWrapper = styled.View``