ordering-ui-react-native 0.15.59 → 0.15.61-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 (207) hide show
  1. package/package.json +6 -3
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/AddressForm/index.tsx +18 -2
  4. package/src/components/BusinessController/index.tsx +16 -8
  5. package/src/components/BusinessInformation/index.tsx +14 -0
  6. package/src/components/BusinessTypeFilter/index.tsx +1 -2
  7. package/src/components/BusinessesListing/index.tsx +1 -1
  8. package/src/components/Checkout/index.tsx +23 -2
  9. package/src/components/DriverTips/index.tsx +11 -6
  10. package/src/components/LanguageSelector/index.tsx +7 -2
  11. package/src/components/LoginForm/index.tsx +120 -30
  12. package/src/components/LoginForm/styles.tsx +6 -0
  13. package/src/components/OrderDetails/index.tsx +7 -21
  14. package/src/components/PaymentOptions/index.tsx +67 -50
  15. package/src/components/PaymentOptionsWebView/index.tsx +120 -121
  16. package/src/components/ReviewDriver/index.tsx +1 -1
  17. package/src/components/ReviewOrder/index.tsx +2 -1
  18. package/src/components/ReviewProducts/index.tsx +11 -0
  19. package/src/components/SignupForm/index.tsx +145 -61
  20. package/src/components/SingleProductCard/index.tsx +16 -4
  21. package/src/components/SingleProductReview/index.tsx +1 -1
  22. package/src/components/StripeMethodForm/index.tsx +1 -2
  23. package/src/components/UpsellingProducts/index.tsx +1 -1
  24. package/src/components/UserProfileForm/index.tsx +63 -6
  25. package/src/components/UserProfileForm/styles.tsx +8 -0
  26. package/src/components/VerifyPhone/styles.tsx +1 -2
  27. package/src/components/shared/OModal.tsx +1 -1
  28. package/src/hooks/useCountdownTimer.tsx +26 -0
  29. package/src/navigators/CheckoutNavigator.tsx +6 -0
  30. package/src/navigators/HomeNavigator.tsx +12 -0
  31. package/src/pages/BusinessesListing.tsx +7 -6
  32. package/src/pages/MultiCheckout.tsx +31 -0
  33. package/src/pages/MultiOrdersDetails.tsx +27 -0
  34. package/src/pages/OrderDetails.tsx +1 -1
  35. package/src/pages/ReviewDriver.tsx +2 -2
  36. package/src/pages/ReviewOrder.tsx +2 -2
  37. package/src/pages/Sessions.tsx +22 -0
  38. package/src/theme.json +0 -1
  39. package/src/types/index.tsx +18 -11
  40. package/src/utils/index.tsx +68 -1
  41. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +103 -15
  42. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -0
  43. package/themes/business/src/components/Chat/index.tsx +42 -90
  44. package/themes/business/src/components/DriverMap/index.tsx +6 -5
  45. package/themes/business/src/components/LoginForm/index.tsx +89 -2
  46. package/themes/business/src/components/LoginForm/styles.tsx +6 -0
  47. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  48. package/themes/business/src/components/NewOrderNotification/index.tsx +26 -13
  49. package/themes/business/src/components/OrderDetails/Business.tsx +2 -2
  50. package/themes/business/src/components/OrderDetails/Delivery.tsx +28 -11
  51. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +14 -7
  52. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +6 -0
  53. package/themes/business/src/components/OrdersListManager/index.tsx +1 -1
  54. package/themes/business/src/components/OrdersOption/index.tsx +8 -4
  55. package/themes/business/src/components/PreviousOrders/index.tsx +7 -7
  56. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  57. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  58. package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
  59. package/themes/business/src/components/shared/OModal.tsx +1 -1
  60. package/themes/business/src/types/index.tsx +8 -2
  61. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  62. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  63. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  64. package/themes/kiosk/src/components/BusinessMenu/index.tsx +39 -28
  65. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -3
  66. package/themes/kiosk/src/components/Cart/index.tsx +11 -12
  67. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +9 -2
  68. package/themes/kiosk/src/components/CartContent/index.tsx +0 -11
  69. package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
  70. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +107 -62
  71. package/themes/kiosk/src/components/Checkout/index.tsx +40 -22
  72. package/themes/kiosk/src/components/CustomerName/index.tsx +0 -6
  73. package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
  74. package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
  75. package/themes/kiosk/src/components/NavBar/index.tsx +29 -20
  76. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  77. package/themes/kiosk/src/components/OrderDetails/index.tsx +32 -27
  78. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +9 -11
  79. package/themes/kiosk/src/components/PaymentOptions/index.tsx +56 -54
  80. package/themes/kiosk/src/components/ProductForm/index.tsx +7 -8
  81. package/themes/kiosk/src/components/ProductItemAccordion/index.tsx +2 -2
  82. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -1
  83. package/themes/kiosk/src/components/ProductOptionSubOption/index.tsx +3 -1
  84. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +16 -5
  85. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  86. package/themes/kiosk/src/types/index.d.ts +1 -0
  87. package/themes/original/index.tsx +30 -8
  88. package/themes/original/src/components/ActiveOrders/index.tsx +15 -132
  89. package/themes/original/src/components/ActiveOrders/styles.tsx +0 -54
  90. package/themes/original/src/components/AddressForm/index.tsx +7 -6
  91. package/themes/original/src/components/AddressList/index.tsx +30 -18
  92. package/themes/original/src/components/AppleLogin/index.tsx +9 -13
  93. package/themes/original/src/components/BusinessBasicInformation/index.tsx +137 -46
  94. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +4 -0
  95. package/themes/original/src/components/BusinessController/index.tsx +29 -11
  96. package/themes/original/src/components/BusinessController/styles.tsx +5 -0
  97. package/themes/original/src/components/BusinessItemAccordion/index.tsx +8 -5
  98. package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
  99. package/themes/original/src/components/BusinessListingSearch/index.tsx +205 -61
  100. package/themes/original/src/components/BusinessListingSearch/styles.tsx +22 -2
  101. package/themes/original/src/components/BusinessPreorder/index.tsx +1 -1
  102. package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -2
  103. package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
  104. package/themes/original/src/components/BusinessProductsList/index.tsx +51 -53
  105. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  106. package/themes/original/src/components/BusinessProductsListing/index.tsx +301 -170
  107. package/themes/original/src/components/BusinessProductsListing/styles.tsx +27 -0
  108. package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
  109. package/themes/original/src/components/BusinessTypeFilter/index.tsx +106 -39
  110. package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
  111. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +557 -0
  112. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +107 -0
  113. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +519 -0
  114. package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Original/styles.tsx} +11 -3
  115. package/themes/original/src/components/BusinessesListing/index.tsx +97 -457
  116. package/themes/original/src/components/Cart/index.tsx +61 -42
  117. package/themes/original/src/components/Checkout/index.tsx +88 -38
  118. package/themes/original/src/components/DriverTips/index.tsx +17 -12
  119. package/themes/original/src/components/Favorite/index.tsx +92 -0
  120. package/themes/original/src/components/Favorite/styles.tsx +22 -0
  121. package/themes/original/src/components/FavoriteList/index.tsx +298 -0
  122. package/themes/original/src/components/FavoriteList/styles.tsx +5 -0
  123. package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
  124. package/themes/original/src/components/GPSButton/index.tsx +15 -8
  125. package/themes/original/src/components/GoogleMap/index.tsx +11 -11
  126. package/themes/original/src/components/Help/index.tsx +21 -4
  127. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +18 -1
  128. package/themes/original/src/components/LastOrders/index.tsx +12 -1
  129. package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -0
  130. package/themes/original/src/components/LoginForm/Otp/styles.tsx +7 -0
  131. package/themes/original/src/components/LoginForm/index.tsx +332 -164
  132. package/themes/original/src/components/LoginForm/styles.tsx +1 -3
  133. package/themes/original/src/components/MessageListing/index.tsx +10 -1
  134. package/themes/original/src/components/Messages/index.tsx +1 -1
  135. package/themes/original/src/components/MomentOption/index.tsx +10 -1
  136. package/themes/original/src/components/MomentOption/styles.tsx +1 -1
  137. package/themes/original/src/components/MomentSelector/index.tsx +197 -0
  138. package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
  139. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
  140. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
  141. package/themes/original/src/components/MultiCheckout/index.tsx +298 -0
  142. package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
  143. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
  144. package/themes/original/src/components/MultiOrdersDetails/index.tsx +258 -0
  145. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
  146. package/themes/original/src/components/MyOrders/index.tsx +120 -32
  147. package/themes/original/src/components/MyOrders/styles.tsx +8 -1
  148. package/themes/original/src/components/NavBar/index.tsx +4 -4
  149. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +167 -0
  150. package/themes/original/src/components/OrderDetails/index.tsx +151 -65
  151. package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
  152. package/themes/original/src/components/OrderSummary/index.tsx +3 -3
  153. package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -2
  154. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +153 -0
  155. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
  156. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +53 -0
  157. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
  158. package/themes/original/src/components/OrdersOption/index.tsx +130 -38
  159. package/themes/original/src/components/OrdersOption/styles.tsx +4 -1
  160. package/themes/original/src/components/PaymentOptionCash/index.tsx +2 -2
  161. package/themes/original/src/components/PaymentOptionWallet/index.tsx +17 -23
  162. package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
  163. package/themes/original/src/components/PaymentOptions/index.tsx +58 -37
  164. package/themes/original/src/components/PhoneInputNumber/index.tsx +5 -11
  165. package/themes/original/src/components/PreviousOrders/index.tsx +18 -147
  166. package/themes/original/src/components/ProductForm/index.tsx +70 -62
  167. package/themes/original/src/components/ProductForm/styles.tsx +0 -1
  168. package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
  169. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -12
  170. package/themes/original/src/components/ProfessionalFilter/index.tsx +128 -0
  171. package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
  172. package/themes/original/src/components/ProfessionalProfile/index.tsx +298 -0
  173. package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
  174. package/themes/original/src/components/Promotions/index.tsx +151 -133
  175. package/themes/original/src/components/Promotions/styles.tsx +3 -23
  176. package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
  177. package/themes/original/src/components/ReviewOrder/index.tsx +1 -1
  178. package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
  179. package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
  180. package/themes/original/src/components/SearchBar/index.tsx +10 -4
  181. package/themes/original/src/components/ServiceForm/index.tsx +579 -0
  182. package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
  183. package/themes/original/src/components/Sessions/index.tsx +160 -0
  184. package/themes/original/src/components/Sessions/styles.tsx +15 -0
  185. package/themes/original/src/components/SignupForm/index.tsx +237 -126
  186. package/themes/original/src/components/SingleOrderCard/index.tsx +282 -0
  187. package/themes/original/src/components/SingleOrderCard/styles.tsx +54 -0
  188. package/themes/original/src/components/SingleProductCard/index.tsx +59 -17
  189. package/themes/original/src/components/StripeElementsForm/index.tsx +16 -8
  190. package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
  191. package/themes/original/src/components/UpsellingProducts/index.tsx +86 -74
  192. package/themes/original/src/components/UserDetails/index.tsx +15 -81
  193. package/themes/original/src/components/UserFormDetails/index.tsx +98 -66
  194. package/themes/original/src/components/UserProfile/index.tsx +52 -5
  195. package/themes/original/src/components/UserProfileForm/index.tsx +20 -18
  196. package/themes/original/src/components/UserVerification/index.tsx +178 -192
  197. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  198. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  199. package/themes/original/src/components/Wallets/index.tsx +76 -9
  200. package/themes/original/src/components/Wallets/styles.tsx +21 -0
  201. package/themes/original/src/components/shared/OBottomPopup.tsx +44 -13
  202. package/themes/original/src/components/shared/OModal.tsx +4 -2
  203. package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
  204. package/themes/original/src/types/index.tsx +186 -35
  205. package/themes/original/src/utils/index.tsx +96 -2
  206. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +1 -1
  207. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react'
2
2
  import { useLanguage, BusinessSearchList, useOrder, useUtils } from 'ordering-components/native'
3
- import { ScrollView, StyleSheet, TouchableOpacity, Platform, View } from 'react-native'
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
6
  import { OButton, OIcon, OModal, OText } from '../shared'
@@ -22,15 +22,21 @@ import {
22
22
  ProgressContentWrapper,
23
23
  ProgressBar,
24
24
  TagsContainer,
25
- SortContainer
25
+ SortContainer,
26
+ BrandContainer,
27
+ BrandItem,
28
+ PriceFilterWrapper,
29
+ OptionTitle
26
30
  } from './styles'
27
31
  import FastImage from 'react-native-fast-image'
28
32
  import { convertHoursToMinutes } from '../../utils'
29
33
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
30
34
  import { BusinessSearchParams } from '../../types'
35
+ import { MyOrders } from '../MyOrders'
36
+ import { useIsFocused } from '@react-navigation/native';
31
37
 
32
- export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
33
38
 
39
+ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
34
40
  const {
35
41
  navigation,
36
42
  businessesSearchList,
@@ -42,9 +48,15 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
42
48
  handleChangeFilters,
43
49
  filters,
44
50
  businessTypes,
45
- setFilters
51
+ setFilters,
52
+ brandList,
53
+ onNavigationRedirect,
54
+ handleUpdateBusinessList,
55
+ handleUpdateProducts
46
56
  } = props
47
57
 
58
+ const screenHeight = Dimensions.get('window').height;
59
+ const screenWidth = Dimensions.get('window').width;
48
60
  const theme = useTheme()
49
61
  const [orderState] = useOrder()
50
62
  const { top } = useSafeAreaInsets();
@@ -63,11 +75,26 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
63
75
  { text: t('PICKUP_TIME', 'Pickup time'), value: 'pickup_time' }
64
76
  ]
65
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
+
86
+ const isFocused = useIsFocused();
87
+
66
88
  const styles = StyleSheet.create({
67
89
  container: {
68
90
  paddingHorizontal: 40,
69
91
  width: '100%'
70
92
  },
93
+ filterContainer: {
94
+ maxHeight: screenHeight - 150,
95
+ paddingHorizontal: 40,
96
+ width: '100%'
97
+ },
71
98
  searchInput: {
72
99
  fontSize: 10,
73
100
  },
@@ -84,6 +111,12 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
84
111
  flexWrap: 'wrap',
85
112
  justifyContent: 'center'
86
113
  },
114
+ priceContainer: {
115
+ width: '100%',
116
+ flexDirection: 'row',
117
+ flexWrap: 'wrap',
118
+ justifyContent: 'space-between'
119
+ },
87
120
  categoryStyle: {
88
121
  marginRight: 10,
89
122
  marginTop: 10,
@@ -95,6 +128,16 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
95
128
  height: 28,
96
129
  borderWidth: 0
97
130
  },
131
+ priceItem: {
132
+ marginRight: 10,
133
+ marginTop: 10,
134
+ borderRadius: 50,
135
+ paddingVertical: 4,
136
+ paddingLeft: 5,
137
+ paddingRight: 5,
138
+ height: 27,
139
+ borderWidth: 0
140
+ },
98
141
  applyButton: {
99
142
  paddingHorizontal: 40,
100
143
  width: '100%',
@@ -107,7 +150,7 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
107
150
  }
108
151
 
109
152
  const handleCloseFilters = () => {
110
- setFilters({ business_types: [], orderBy: 'default' })
153
+ setFilters({ business_types: [], orderBy: 'default', franchise_ids: [], price_level: null })
111
154
  setOpenFilters(false)
112
155
  }
113
156
 
@@ -126,6 +169,18 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
126
169
  }
127
170
  }
128
171
 
172
+ const handleChangeBrandFilter = (brandId: number) => {
173
+ let franchiseIds = [...filters?.franchise_ids]
174
+ if (filters?.franchise_ids?.includes(brandId)) franchiseIds = filters?.franchise_ids?.filter((item: any) => item !== brandId)
175
+ else franchiseIds.push(brandId)
176
+ handleChangeFilters && handleChangeFilters('franchise_ids', franchiseIds)
177
+ }
178
+
179
+ const handleChangePriceRange = (value: string) => {
180
+ if (value === filters?.price_level) handleChangeFilters('price_level', null)
181
+ else handleChangeFilters('price_level', value)
182
+ }
183
+
129
184
  const handleApplyFilters = () => {
130
185
  handleSearchbusinessAndProducts(true)
131
186
  setOpenFilters(false)
@@ -141,6 +196,11 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
141
196
  handleSearchbusinessAndProducts(true)
142
197
  }, [])
143
198
 
199
+
200
+ useEffect(() => {
201
+ handleChangeTermValue('')
202
+ }, [isFocused])
203
+
144
204
  const MaxSectionItem = ({ title, options, filter }: any) => {
145
205
  const parseValue = (option: number) => {
146
206
  return filter === 'max_distance'
@@ -176,12 +236,63 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
176
236
  )
177
237
  }
178
238
 
239
+ const BusinessControllerSkeletons = () => {
240
+ return (
241
+ <>
242
+ {[
243
+ ...Array(
244
+ paginationProps.nextPageItems
245
+ ? paginationProps.nextPageItems
246
+ : 3,
247
+ ).keys(),
248
+ ].map((item, i) => (
249
+ <Placeholder
250
+ Animation={Fade}
251
+ key={i}
252
+ style={{ width: 320, marginRight: 20, marginTop: 20 }}>
253
+ <View style={{ width: 320 }}>
254
+ <PlaceholderLine
255
+ height={155}
256
+ style={{ marginBottom: 20, borderRadius: 25 }}
257
+ />
258
+ <View style={{ paddingHorizontal: 10 }}>
259
+ <View
260
+ style={{
261
+ flexDirection: 'row',
262
+ justifyContent: 'space-between',
263
+ }}>
264
+ <PlaceholderLine
265
+ height={25}
266
+ width={40}
267
+ style={{ marginBottom: 10 }}
268
+ />
269
+ <PlaceholderLine
270
+ height={25}
271
+ width={20}
272
+ style={{ marginBottom: 10 }}
273
+ />
274
+ </View>
275
+ <PlaceholderLine
276
+ height={20}
277
+ width={30}
278
+ style={{ marginBottom: 10 }}
279
+ />
280
+ <PlaceholderLine
281
+ height={20}
282
+ width={80}
283
+ style={{ marginBottom: 0 }}
284
+ />
285
+ </View>
286
+ </View>
287
+ </Placeholder>
288
+ ))}
289
+ </>
290
+ )
291
+ }
292
+
179
293
  return (
180
294
  <ScrollView style={styles.container}>
181
295
  <WrapHeader style={{ paddingTop: top + 20, marginVertical: 2 }}>
182
- <TouchableOpacity onPress={() => navigation?.canGoBack() && navigation.goBack()} style={{ position: 'absolute', paddingVertical: 20 }}>
183
- <OIcon src={theme.images.general.arrow_left} width={20} />
184
- </TouchableOpacity>
185
296
  <OText
186
297
  size={20}
187
298
  mBottom={15}
@@ -193,6 +304,7 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
193
304
  </WrapHeader>
194
305
  <SearchWrapper>
195
306
  <SearchBar
307
+ autoFocus
196
308
  lazyLoad
197
309
  inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
198
310
  placeholder={`${t('SEARCH_BUSINESSES', 'Search Businesses')} / ${t('TYPE_AT_LEAST_3_CHARACTERS', 'type at least 3 characters')}`}
@@ -211,6 +323,20 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
211
323
  </View>
212
324
  )
213
325
  }
326
+ {businessesSearchList.businesses?.length > 0 && (
327
+ <MyOrders
328
+ hideOrders
329
+ businessesSearchList={businessesSearchList}
330
+ onNavigationRedirect={onNavigationRedirect}
331
+ BusinessControllerSkeletons={BusinessControllerSkeletons}
332
+ />
333
+ )}
334
+
335
+ <OptionTitle isBusinessesSearchList={!!businessesSearchList}>
336
+ <OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={10}>
337
+ {t('BUSINESSES', 'Businesses')}
338
+ </OText>
339
+ </OptionTitle>
214
340
  <ScrollView horizontal>
215
341
  {businessesSearchList.businesses?.length > 0 && businessesSearchList.businesses.map((business: any, i: number) => (
216
342
  <BusinessController
@@ -218,8 +344,9 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
218
344
  business={business}
219
345
  isBusinessOpen={business.open}
220
346
  handleCustomClick={() => onBusinessClick(business)}
347
+ handleUpdateBusinessList={handleUpdateBusinessList}
221
348
  orderType={orderState?.options?.type}
222
- style={{ width: 320, marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0 }}
349
+ style={{ width: screenWidth - 80, marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0 }}
223
350
  />
224
351
  ))}
225
352
  {!businessesSearchList.loading && paginationProps?.totalPages && paginationProps?.currentPage < paginationProps?.totalPages && (
@@ -234,55 +361,7 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
234
361
  </LoadMoreBusinessContainer>
235
362
  )}
236
363
  {businessesSearchList.loading && (
237
- <>
238
- {[
239
- ...Array(
240
- paginationProps.nextPageItems
241
- ? paginationProps.nextPageItems
242
- : 3,
243
- ).keys(),
244
- ].map((item, i) => (
245
- <Placeholder
246
- Animation={Fade}
247
- key={i}
248
- style={{ width: 320, marginRight: 20, marginTop: 20 }}>
249
- <View style={{ width: 320 }}>
250
- <PlaceholderLine
251
- height={155}
252
- style={{ marginBottom: 20, borderRadius: 25 }}
253
- />
254
- <View style={{ paddingHorizontal: 10 }}>
255
- <View
256
- style={{
257
- flexDirection: 'row',
258
- justifyContent: 'space-between',
259
- }}>
260
- <PlaceholderLine
261
- height={25}
262
- width={40}
263
- style={{ marginBottom: 10 }}
264
- />
265
- <PlaceholderLine
266
- height={25}
267
- width={20}
268
- style={{ marginBottom: 10 }}
269
- />
270
- </View>
271
- <PlaceholderLine
272
- height={20}
273
- width={30}
274
- style={{ marginBottom: 10 }}
275
- />
276
- <PlaceholderLine
277
- height={20}
278
- width={80}
279
- style={{ marginBottom: 0 }}
280
- />
281
- </View>
282
- </View>
283
- </Placeholder>
284
- ))}
285
- </>
364
+ <BusinessControllerSkeletons />
286
365
  )}
287
366
  </ScrollView>
288
367
  <ProductsList>
@@ -338,7 +417,8 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
338
417
  businessId={business?.id}
339
418
  onProductClick={() => { }}
340
419
  productAddedToCartLength={0}
341
- style={{ width: 320, marginRight: i === category?.products?.length - 1 ? 0 : 20 }}
420
+ handleUpdateProducts={(productId: number, changes: any) => handleUpdateProducts(productId, category?.id, business?.id, changes)}
421
+ style={{ width: screenWidth - 80, marginRight: i === category?.products?.length - 1 ? 0 : 20 }}
342
422
  />
343
423
  )))}
344
424
 
@@ -388,7 +468,7 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
388
468
  onCancel={() => handleCloseFilters()}
389
469
  onClose={() => handleCloseFilters()}
390
470
  >
391
- <ScrollView style={styles.container}>
471
+ <ScrollView style={styles.filterContainer}>
392
472
  <OText
393
473
  size={20}
394
474
  mBottom={15}
@@ -406,7 +486,7 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
406
486
  onPress={() => handleChangeFilters('orderBy', item?.value)}
407
487
  style={{ marginBottom: 7 }}
408
488
  >
409
- <OText
489
+ <OText
410
490
  weight={filters?.orderBy?.includes(item?.value) ? 'bold' : '500'}
411
491
  mBottom={filters?.orderBy?.includes(item?.value) ? 5 : 0}
412
492
  >
@@ -415,6 +495,70 @@ export const BusinessListingSearchUI = (props : BusinessSearchParams) => {
415
495
  </TouchableOpacity>
416
496
  ))}
417
497
  </SortContainer>
498
+ <BrandContainer>
499
+ <OText
500
+ size={16}
501
+ weight='bold'
502
+ lineHeight={24}
503
+ style={{ marginBottom: 10 }}
504
+ >
505
+ {t('BRANDS', 'Brands')}
506
+ </OText>
507
+ {!brandList?.loading && !brandList?.error && brandList?.brands?.length > 0 && (
508
+ <ScrollView
509
+ style={{ maxHeight: 300, marginBottom: 10 }}
510
+ showsVerticalScrollIndicator={true}
511
+ nestedScrollEnabled={true}
512
+ >
513
+ {brandList?.brands.map((brand: any, i: number) => brand?.enabled && (
514
+ <BrandItem
515
+ key={i}
516
+ onPress={() => handleChangeBrandFilter(brand?.id)}
517
+ >
518
+ <OText
519
+ size={14}
520
+ weight={'400'}
521
+ lineHeight={24}
522
+ >
523
+ {brand?.name}
524
+ </OText>
525
+ {filters?.franchise_ids?.includes(brand?.id) && (
526
+ <AntDesignIcon
527
+ name='check'
528
+ color={theme.colors.success500}
529
+ size={16}
530
+ />
531
+ )}
532
+ </BrandItem>
533
+ ))}
534
+ </ScrollView>
535
+ )}
536
+ {!brandList?.loading && ((brandList?.brands?.filter((brand: any) => brand?.enabled))?.length === 0) && (
537
+ <OText size={14} weight='400'>{t('NO_RESULTS_FOUND', 'Sorry, no results found')}</OText>
538
+ )}
539
+ </BrandContainer>
540
+ <PriceFilterWrapper>
541
+ <OText
542
+ size={16}
543
+ weight='bold'
544
+ lineHeight={24}
545
+ style={{ marginBottom: 5 }}
546
+ >
547
+ {t('PRICE_RANGE', 'Price range')}
548
+ </OText>
549
+ <View style={styles.priceContainer}>
550
+ {priceList.map((price: any, i: number) => (
551
+ <OButton
552
+ key={i}
553
+ bgColor={(filters?.price_level === price?.level) ? theme.colors.primary : theme.colors.backgroundGray200}
554
+ onClick={() => handleChangePriceRange(price?.level)}
555
+ text={`${price.content} ${(filters?.price_level === price?.level) ? ' X' : ''}`}
556
+ style={styles.priceItem}
557
+ textStyle={{ fontSize: 10, color: (filters?.price_level === price?.level) ? theme.colors.backgroundLight : theme.colors.textNormal }}
558
+ />
559
+ ))}
560
+ </View>
561
+ </PriceFilterWrapper>
418
562
  {orderState?.options?.type === 1 && (
419
563
  <MaxSectionItem
420
564
  title={t('MAX_DELIVERY_FEE', 'Max delivery fee')}
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components/native'
1
+ import styled, { css } from 'styled-components/native'
2
2
 
3
3
  export const WrapHeader = styled.View`
4
4
  width: 100%;
@@ -68,9 +68,29 @@ export const ProgressContentWrapper = styled.View`
68
68
  `
69
69
 
70
70
  export const TagsContainer = styled.View`
71
-
71
+ padding-bottom: 10px;
72
72
  `
73
73
 
74
74
  export const SortContainer = styled.View`
75
75
  margin-bottom: 10px;
76
76
  `
77
+
78
+ export const BrandContainer = styled.View``
79
+
80
+ export const BrandItem = styled.TouchableOpacity`
81
+ flex-direction: row;
82
+ justify-content: space-between;
83
+ margin-bottom: 4px;
84
+ align-items: center;
85
+ `
86
+
87
+ export const PriceFilterWrapper = styled.View`
88
+ margin-bottom: 20px;
89
+ `
90
+
91
+ export const OptionTitle = styled.View`
92
+ margin-top: 24px;
93
+ ${(props: any) => props.titleContent && css`
94
+ margin-left: ${() => props.isBusinessesSearchList ? '0' : '40px'};
95
+ `}
96
+ `
@@ -144,7 +144,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
144
144
 
145
145
  const validateSelectedDate = (curdate: any, menu: any) => {
146
146
  const day = moment(curdate).format('d')
147
- setIsEnabled(menu?.schedule[day]?.enabled || false)
147
+ setIsEnabled(menu?.schedule?.[day]?.enabled || false)
148
148
  }
149
149
 
150
150
  const getTimes = (curdate: any, menu: any) => {
@@ -57,12 +57,12 @@ const BusinessProductsCategoriesUI = (props: any) => {
57
57
 
58
58
  if (!lazyLoadProductsRecommended) {
59
59
  if (category?.id) {
60
- scrollViewRef.current.scrollTo({
60
+ scrollViewRef?.current?.scrollTo && scrollViewRef.current.scrollTo({
61
61
  y: categoriesLayout[`cat_${category?.id}`]?.y + productListLayout?.y - 70,
62
62
  animated: true
63
63
  })
64
64
  } else {
65
- scrollViewRef.current.scrollTo({
65
+ scrollViewRef?.current?.scrollTo && scrollViewRef.current.scrollTo({
66
66
  y: productListLayout?.y - 70,
67
67
  animated: true
68
68
  })
@@ -0,0 +1,44 @@
1
+ import React from 'react'
2
+ import { OModal, OText, OIcon } from '../../shared'
3
+ import { ScrollView } from 'react-native'
4
+ import { useUtils } from 'ordering-components/native'
5
+
6
+ interface CategoryDescriptionParams {
7
+ openDescription?: {name: string, image: string, description: string} | null,
8
+ setOpenDescription: any;
9
+ }
10
+
11
+ function categoryDescriptionPropsAreEqual(prev : any, next : any) {
12
+ return prev.openDescription === next.openDescription
13
+ }
14
+
15
+ const CategoryDescription = (props : CategoryDescriptionParams) => {
16
+ const [{ optimizeImage }] = useUtils()
17
+ return (
18
+ <OModal
19
+ open={!!props.openDescription}
20
+ onClose={() => props.setOpenDescription(null)}
21
+ styleContainerCloseButton={{
22
+ marginLeft: -37,
23
+ width: 55,
24
+ height: 55,
25
+ marginTop: 2
26
+ }}
27
+ >
28
+ <OText size={20} style={{ paddingLeft: 70, paddingRight: 20, bottom: 25 }}>{props.openDescription?.name}</OText>
29
+ <ScrollView style={{ padding: 20 }}>
30
+ {!!props.openDescription?.image && (
31
+ <OIcon
32
+ url={optimizeImage(props.openDescription?.image, 'h_100,c_limit')}
33
+ width={240}
34
+ height={240}
35
+ style={{ borderRadius: 7.6 }}
36
+ />
37
+ )}
38
+ <OText mBottom={60}>{props.openDescription?.description}</OText>
39
+ </ScrollView>
40
+ </OModal>
41
+ )
42
+ }
43
+
44
+ export const CategoryDescriptionMemoized = React.memo(CategoryDescription,categoryDescriptionPropsAreEqual)