ordering-ui-react-native 0.18.55 → 0.18.56-crash-driver-1

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 (266) hide show
  1. package/package.json +6 -4
  2. package/src/components/BusinessInformation/index.tsx +10 -9
  3. package/src/components/PaymentOptionsWebView/index.tsx +30 -8
  4. package/src/components/PhoneInputNumber/index.tsx +6 -2
  5. package/src/components/StripeMethodForm/index.tsx +60 -55
  6. package/src/components/shared/OToast.tsx +3 -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 +15 -8
  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/Chat/index.tsx +48 -19
  18. package/themes/business/src/components/DriverMap/index.tsx +36 -23
  19. package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
  20. package/themes/business/src/components/FloatingButton/index.tsx +34 -31
  21. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  22. package/themes/business/src/components/Home/index.tsx +5 -1
  23. package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
  24. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  25. package/themes/business/src/components/LoginForm/index.tsx +2 -2
  26. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  27. package/themes/business/src/components/MapView/index.tsx +28 -17
  28. package/themes/business/src/components/MessagesOption/index.tsx +22 -94
  29. package/themes/business/src/components/NewOrderNotification/index.tsx +162 -106
  30. package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
  31. package/themes/business/src/components/OrderDetails/Business.tsx +53 -3
  32. package/themes/business/src/components/OrderDetails/Delivery.tsx +209 -13
  33. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +107 -75
  34. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +79 -41
  35. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  36. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +7 -2
  37. package/themes/business/src/components/OrderMessage/index.tsx +1 -1
  38. package/themes/business/src/components/OrderSummary/index.tsx +245 -82
  39. package/themes/business/src/components/OrdersListManager/index.tsx +7 -2
  40. package/themes/business/src/components/OrdersListManager/utils.tsx +1 -1
  41. package/themes/business/src/components/OrdersOption/index.tsx +125 -48
  42. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  43. package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
  44. package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
  45. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +43 -41
  46. package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
  47. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
  48. package/themes/business/src/components/PreviousOrders/index.tsx +195 -221
  49. package/themes/business/src/components/PreviousOrders/styles.tsx +10 -0
  50. package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
  51. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  52. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  53. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
  54. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  55. package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
  56. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  57. package/themes/business/src/components/Sessions/index.tsx +187 -0
  58. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  59. package/themes/business/src/components/StoresList/index.tsx +4 -3
  60. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  61. package/themes/business/src/components/UserProfileForm/index.tsx +103 -53
  62. package/themes/business/src/components/WebsocketStatus/index.tsx +171 -0
  63. package/themes/business/src/components/WebsocketStatus/styles.tsx +28 -0
  64. package/themes/business/src/components/shared/OInput.tsx +2 -0
  65. package/themes/business/src/hooks/useLocation.tsx +5 -4
  66. package/themes/business/src/types/index.tsx +21 -1
  67. package/themes/business/src/utils/index.tsx +5 -0
  68. package/themes/kiosk/src/components/Checkout/index.tsx +5 -3
  69. package/themes/kiosk/src/components/CustomerName/index.tsx +1 -1
  70. package/themes/kiosk/src/components/Intro/index.tsx +16 -1
  71. package/themes/kiosk/src/components/LoginForm/index.tsx +131 -101
  72. package/themes/kiosk/src/components/PaymentOptions/index.tsx +57 -121
  73. package/themes/original/index.tsx +11 -3
  74. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  75. package/themes/original/src/components/AddressForm/index.tsx +41 -20
  76. package/themes/original/src/components/AddressForm/styles.tsx +1 -1
  77. package/themes/original/src/components/AddressList/index.tsx +22 -11
  78. package/themes/original/src/components/AddressList/styles.tsx +4 -4
  79. package/themes/original/src/components/AnalyticsSegment/index.tsx +10 -7
  80. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  81. package/themes/original/src/components/BusinessBasicInformation/index.tsx +8 -11
  82. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -1
  83. package/themes/original/src/components/BusinessController/index.tsx +40 -43
  84. package/themes/original/src/components/BusinessController/styles.tsx +12 -12
  85. package/themes/original/src/components/BusinessInformation/index.tsx +45 -17
  86. package/themes/original/src/components/BusinessInformation/styles.tsx +2 -2
  87. package/themes/original/src/components/BusinessItemAccordion/index.tsx +11 -7
  88. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +317 -0
  89. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +96 -0
  90. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +1 -1
  91. package/themes/original/src/components/BusinessListingSearch/index.tsx +57 -361
  92. package/themes/original/src/components/BusinessListingSearch/styles.tsx +1 -1
  93. package/themes/original/src/components/BusinessPreorder/index.tsx +9 -7
  94. package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -3
  95. package/themes/original/src/components/BusinessProductsList/index.tsx +5 -4
  96. package/themes/original/src/components/BusinessProductsListing/index.tsx +67 -28
  97. package/themes/original/src/components/BusinessProductsListing/styles.tsx +3 -4
  98. package/themes/original/src/components/BusinessReviews/index.tsx +1 -1
  99. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  100. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +5 -5
  101. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
  102. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
  103. package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
  104. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +30 -404
  105. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +2 -2
  106. package/themes/original/src/components/Cart/index.tsx +51 -40
  107. package/themes/original/src/components/CartContent/index.tsx +98 -54
  108. package/themes/original/src/components/CartStoresListing/styles.tsx +2 -2
  109. package/themes/original/src/components/Checkout/index.tsx +308 -75
  110. package/themes/original/src/components/Checkout/styles.tsx +17 -0
  111. package/themes/original/src/components/CitiesControl/styles.tsx +1 -1
  112. package/themes/original/src/components/DatePicker/index.tsx +33 -0
  113. package/themes/original/src/components/DatePicker/styles.tsx +20 -0
  114. package/themes/original/src/components/DriverTips/index.tsx +6 -3
  115. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  116. package/themes/original/src/components/Favorite/index.tsx +8 -4
  117. package/themes/original/src/components/Favorite/styles.tsx +0 -2
  118. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  119. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -0
  120. package/themes/original/src/components/GPSButton/index.tsx +7 -5
  121. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  122. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  123. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
  124. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
  125. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +1 -1
  126. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +84 -8
  127. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +1 -1
  128. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +2 -2
  129. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +1 -1
  130. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  131. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  132. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +83 -0
  133. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  134. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  135. package/themes/original/src/components/GoogleMap/index.tsx +52 -5
  136. package/themes/original/src/components/Help/index.tsx +7 -0
  137. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +5 -0
  138. package/themes/original/src/components/HelpGuide/index.tsx +5 -0
  139. package/themes/original/src/components/HelpOrder/index.tsx +5 -0
  140. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  141. package/themes/original/src/components/HighestRatedBusinesses/styles.tsx +1 -1
  142. package/themes/original/src/components/Home/index.tsx +3 -2
  143. package/themes/original/src/components/LastOrder/index.tsx +2 -1
  144. package/themes/original/src/components/LastOrders/index.tsx +2 -1
  145. package/themes/original/src/components/LoginForm/Otp/index.tsx +79 -25
  146. package/themes/original/src/components/LoginForm/index.tsx +38 -14
  147. package/themes/original/src/components/MessageListing/index.tsx +6 -0
  148. package/themes/original/src/components/Messages/index.tsx +9 -3
  149. package/themes/original/src/components/Messages/styles.tsx +1 -1
  150. package/themes/original/src/components/MomentOption/index.tsx +20 -5
  151. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  152. package/themes/original/src/components/MultiCart/index.tsx +1 -1
  153. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +48 -15
  154. package/themes/original/src/components/MultiCheckout/index.tsx +295 -56
  155. package/themes/original/src/components/MultiCheckout/styles.tsx +20 -1
  156. package/themes/original/src/components/MultiOrdersDetails/index.tsx +21 -16
  157. package/themes/original/src/components/MyOrders/index.tsx +37 -39
  158. package/themes/original/src/components/NavBar/index.tsx +15 -14
  159. package/themes/original/src/components/NetworkError/index.tsx +2 -3
  160. package/themes/original/src/components/NetworkError/styles.tsx +2 -2
  161. package/themes/original/src/components/Notifications/index.tsx +9 -8
  162. package/themes/original/src/components/Notifications/styles.tsx +0 -1
  163. package/themes/original/src/components/OrderDetails/OrderEta.tsx +21 -6
  164. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +14 -5
  165. package/themes/original/src/components/OrderDetails/index.tsx +718 -667
  166. package/themes/original/src/components/OrderDetails/styles.tsx +24 -7
  167. package/themes/original/src/components/OrderProgress/index.tsx +50 -14
  168. package/themes/original/src/components/OrderProgress/styles.tsx +1 -1
  169. package/themes/original/src/components/OrderSummary/index.tsx +26 -34
  170. package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -0
  171. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +1 -1
  172. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +1 -1
  173. package/themes/original/src/components/OrdersOption/index.tsx +14 -6
  174. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  175. package/themes/original/src/components/PageBanner/index.tsx +3 -0
  176. package/themes/original/src/components/PaymentOptionCard/index.tsx +182 -0
  177. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
  178. package/themes/original/src/components/PaymentOptions/index.tsx +118 -37
  179. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -1
  180. package/themes/original/src/components/PreviousOrders/index.tsx +2 -0
  181. package/themes/original/src/components/ProductForm/ActionButton.tsx +122 -0
  182. package/themes/original/src/components/ProductForm/ExtraOptions.tsx +56 -0
  183. package/themes/original/src/components/ProductForm/index.tsx +193 -267
  184. package/themes/original/src/components/ProductForm/styles.tsx +1 -1
  185. package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -42
  186. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  187. package/themes/original/src/components/ProductOptionSubOption/index.tsx +120 -79
  188. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
  189. package/themes/original/src/components/ProfessionalProfile/styles.tsx +3 -3
  190. package/themes/original/src/components/Promotions/index.tsx +13 -11
  191. package/themes/original/src/components/Promotions/styles.tsx +0 -2
  192. package/themes/original/src/components/ReviewDriver/index.tsx +5 -0
  193. package/themes/original/src/components/ReviewDriver/styles.tsx +1 -1
  194. package/themes/original/src/components/ReviewOrder/index.tsx +5 -0
  195. package/themes/original/src/components/ReviewOrder/styles.tsx +1 -1
  196. package/themes/original/src/components/ReviewProducts/index.tsx +5 -0
  197. package/themes/original/src/components/ReviewProducts/styles.tsx +1 -1
  198. package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
  199. package/themes/original/src/components/ServiceForm/index.tsx +2 -2
  200. package/themes/original/src/components/ServiceForm/styles.tsx +4 -4
  201. package/themes/original/src/components/Sessions/index.tsx +5 -0
  202. package/themes/original/src/components/SignupForm/index.tsx +76 -60
  203. package/themes/original/src/components/SingleOrderCard/index.tsx +6 -5
  204. package/themes/original/src/components/SingleProductCard/index.tsx +5 -4
  205. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -5
  206. package/themes/original/src/components/StripeCardsList/index.tsx +26 -8
  207. package/themes/original/src/components/StripeElementsForm/index.tsx +80 -62
  208. package/themes/original/src/components/StripeElementsForm/naked.tsx +59 -1
  209. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +170 -0
  210. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +91 -0
  211. package/themes/original/src/components/UpsellingProducts/index.tsx +15 -199
  212. package/themes/original/src/components/UpsellingProducts/styles.tsx +19 -0
  213. package/themes/original/src/components/UserFormDetails/index.tsx +128 -79
  214. package/themes/original/src/components/UserFormDetails/styles.tsx +8 -1
  215. package/themes/original/src/components/UserProfile/index.tsx +5 -4
  216. package/themes/original/src/components/UserProfileForm/index.tsx +35 -36
  217. package/themes/original/src/components/UserVerification/index.tsx +55 -50
  218. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  219. package/themes/original/src/components/WalletTransactions/styles.tsx +1 -0
  220. package/themes/original/src/components/Wallets/index.tsx +35 -49
  221. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  222. package/themes/original/src/components/WebsocketStatus/index.tsx +172 -0
  223. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  224. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  225. package/themes/original/src/components/shared/OButton.tsx +5 -5
  226. package/themes/original/src/components/shared/OInput.tsx +7 -4
  227. package/themes/original/src/components/shared/OModal.tsx +12 -14
  228. package/themes/original/src/layouts/Container.tsx +5 -3
  229. package/themes/original/src/types/index.tsx +13 -2
  230. package/themes/original/src/utils/index.tsx +124 -22
  231. package/src/navigators/BottomNavigator.tsx +0 -117
  232. package/src/navigators/CheckoutNavigator.tsx +0 -66
  233. package/src/navigators/HomeNavigator.tsx +0 -202
  234. package/src/navigators/NavigationRef.tsx +0 -7
  235. package/src/navigators/RootNavigator.tsx +0 -269
  236. package/src/pages/Account.tsx +0 -34
  237. package/src/pages/AddressForm.tsx +0 -62
  238. package/src/pages/AddressList.tsx +0 -24
  239. package/src/pages/BusinessProductsList.tsx +0 -81
  240. package/src/pages/BusinessesListing.tsx +0 -43
  241. package/src/pages/CartList.tsx +0 -49
  242. package/src/pages/Checkout.tsx +0 -101
  243. package/src/pages/ForgotPassword.tsx +0 -24
  244. package/src/pages/Help.tsx +0 -23
  245. package/src/pages/HelpAccountAndPayment.tsx +0 -23
  246. package/src/pages/HelpGuide.tsx +0 -23
  247. package/src/pages/HelpOrder.tsx +0 -23
  248. package/src/pages/Home.tsx +0 -36
  249. package/src/pages/IntroductoryTutorial.tsx +0 -170
  250. package/src/pages/Login.tsx +0 -47
  251. package/src/pages/MomentOption.tsx +0 -30
  252. package/src/pages/MultiCheckout.tsx +0 -31
  253. package/src/pages/MultiOrdersDetails.tsx +0 -27
  254. package/src/pages/MyOrders.tsx +0 -40
  255. package/src/pages/NetworkError.tsx +0 -24
  256. package/src/pages/NotFound.tsx +0 -22
  257. package/src/pages/OrderDetails.tsx +0 -25
  258. package/src/pages/ProductDetails.tsx +0 -55
  259. package/src/pages/Profile.tsx +0 -36
  260. package/src/pages/ReviewDriver.tsx +0 -30
  261. package/src/pages/ReviewOrder.tsx +0 -32
  262. package/src/pages/ReviewProducts.tsx +0 -30
  263. package/src/pages/Sessions.tsx +0 -22
  264. package/src/pages/Signup.tsx +0 -53
  265. package/src/pages/SpinnerLoader.tsx +0 -10
  266. package/src/pages/Splash.tsx +0 -21
@@ -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
 
@@ -47,97 +36,24 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
47
36
  businessTypes,
48
37
  setFilters,
49
38
  brandList,
39
+ paginationProps,
50
40
  handleUpdateProducts
51
41
  } = props
52
42
 
53
- const screenHeight = Dimensions.get('window').height;
54
43
  const screenWidth = Dimensions.get('window').width;
55
44
  const theme = useTheme()
56
45
  const [orderState] = useOrder()
57
46
  const [events] = useEvent()
58
- const { top } = useSafeAreaInsets();
59
47
  const [, t] = useLanguage()
60
48
  const [{ parsePrice, parseDistance, optimizeImage }] = useUtils();
61
49
 
62
50
  const [openFilters, setOpenFilters] = useState(false)
63
- const noResults = (!businessesSearchList.loading && !businessesSearchList.lengthError && businessesSearchList?.businesses?.length === 0)
64
- const maxDeliveryFeeOptions = [15, 25, 35, 'default']
65
- // const maxProductPriceOptions = [5, 10, 15, 'default']
66
- const maxDistanceOptions = [1000, 2000, 5000, 'default']
67
- const maxTimeOptions = [5, 15, 30, 'default']
68
- const sortItems = [
69
- { text: t('PICKED_FOR_YOU', 'Picked for you (default)'), value: 'distance' },
70
- { text: t('DELIVERY_TIME', 'Delivery time'), value: 'delivery_time' },
71
- { text: t('PICKUP_TIME', 'Pickup time'), value: 'pickup_time' }
72
- ]
73
-
74
- const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
75
- const hideBrowse = theme?.bar_menu?.components?.browse?.hidden
76
-
77
- const priceList = [
78
- { level: '1', content: '$' },
79
- { level: '2', content: '$$' },
80
- { level: '3', content: '$$$' },
81
- { level: '4', content: '$$$$' },
82
- { level: '5', content: '$$$$$' }
83
- ]
84
51
 
85
52
  const isFocused = useIsFocused();
86
53
 
87
54
  const styles = StyleSheet.create({
88
- container: {
89
- paddingHorizontal: 40,
90
- width: '100%'
91
- },
92
- filterContainer: {
93
- maxHeight: screenHeight - 150,
94
- paddingHorizontal: 40,
95
- width: '100%'
96
- },
97
- searchInput: {
98
- fontSize: 12,
99
- height: 44
100
- },
101
55
  productsContainer: {
102
56
  marginTop: 20
103
- },
104
- businessTypesContainer: {
105
- width: '100%',
106
- flexDirection: 'row',
107
- flexWrap: 'wrap',
108
- justifyContent: 'center'
109
- },
110
- priceContainer: {
111
- width: '100%',
112
- flexDirection: 'row',
113
- flexWrap: 'wrap',
114
- justifyContent: 'space-between'
115
- },
116
- categoryStyle: {
117
- marginRight: 10,
118
- marginTop: 10,
119
- borderRadius: 50,
120
- paddingHorizontal: 10,
121
- paddingVertical: 4,
122
- paddingLeft: 0,
123
- paddingRight: 0,
124
- height: 28,
125
- borderWidth: 0
126
- },
127
- priceItem: {
128
- marginRight: 10,
129
- marginTop: 10,
130
- borderRadius: 50,
131
- paddingVertical: 4,
132
- paddingLeft: 5,
133
- paddingRight: 5,
134
- height: 27,
135
- borderWidth: 0
136
- },
137
- applyButton: {
138
- paddingHorizontal: 10,
139
- width: '100%',
140
- marginTop: 20
141
57
  }
142
58
  });
143
59
 
@@ -249,71 +165,37 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
249
165
  }, [isFocused])
250
166
 
251
167
  return (
252
- <IOScrollView
253
- onScroll={(e: any) => handleScroll(e)}
254
- showsVerticalScrollIndicator={false}
255
- >
256
- <View style={{
257
- width: '100%',
258
- display: 'flex',
259
- flexDirection: 'row',
260
- alignItems: 'center',
261
- paddingHorizontal: hideBrowse && !isChewLayout ? 40 : 20,
262
- }}>
263
- {hideBrowse && !isChewLayout && (
264
- <OButton
265
- imgLeftStyle={{ width: 18 }}
266
- imgRightSrc={null}
267
- style={{
268
- borderWidth: 0,
269
- width: 26,
270
- height: 26,
271
- backgroundColor: '#FFF',
272
- borderColor: '#FFF',
273
- shadowColor: '#FFF',
274
- paddingLeft: 0,
275
- paddingRight: 0,
276
- marginTop: 50,
277
- }}
278
- onClick={() => props.navigation.goBack()}
279
- icon={AntDesignIcon}
280
- iconProps={{
281
- name: 'arrowleft',
282
- size: 26
283
- }}
284
- />
285
- )}
286
- <HeaderTitle ph={20} text={t('SEARCH', 'Search')} />
287
- <AntDesignIcon name='filter' size={18} style={{ marginLeft: 'auto', marginTop: 55, paddingHorizontal: 20 }} onPress={() => handleOpenfilters()} />
288
- </View>
289
- <BContainer
290
- style={{ paddingHorizontal: isChewLayout ? 20 : 40 }}
291
- >
292
- <SearchWrapper>
293
- <SearchBar
294
- lazyLoad
295
- {...(isChewLayout && { height: 55 })}
296
- inputStyle={{ ...styles.searchInput }}
297
- placeholder={t('SEARCH_BUSINESSES', 'Search Businesses')}
298
- onSearch={(val: string) => onChangeTermValue(val)}
299
- value={termValue}
300
- />
301
- </SearchWrapper>
302
- <OText size={12} lineHeight={20} color={theme.colors.textThird} mLeft={5}>
303
- {t('TYPE_AT_LEAST_2_CHARACTERS', 'Type at least 2 characters')}
304
- </OText>
305
- {
306
- noResults && (
307
- <View>
308
- <NotFoundSource
309
- content={t('NOT_FOUND_BUSINESSES', 'No businesses to delivery / pick up at this address, please change filters or change address.')}
310
- />
311
- </View>
312
- )
313
- }
314
- <ProductsList>
315
- {businessesSearchList.businesses?.filter((business: any) => business?.categories?.length > 0).map((business: any) => (
316
- <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>
317
199
  <SingleBusinessContainer>
318
200
  <BusinessInfo>
319
201
  {(business?.logo || theme.images?.dummies?.businessLogo) && (
@@ -350,9 +232,15 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
350
232
  onClick={() => onBusinessClick(business)}
351
233
  textStyle={{ color: theme.colors.primary, fontSize: 10 }}
352
234
  text={t('GO_TO_STORE', 'Go to store')}
353
- bgColor='#F5F9FF'
354
- borderColor='#fff'
355
- style={{ borderRadius: 50, paddingLeft: 5, paddingRight: 5, height: 20 }}
235
+ style={{
236
+ borderRadius: 23,
237
+ paddingLeft: 10,
238
+ paddingRight: 10,
239
+ height: 23,
240
+ shadowOpacity: 0,
241
+ backgroundColor: theme.colors.primaryContrast,
242
+ borderWidth: 0
243
+ }}
356
244
  />
357
245
  </SingleBusinessContainer>
358
246
  <ScrollView horizontal style={styles.productsContainer} contentContainerStyle={{ flexGrow: 1 }}>
@@ -373,210 +261,18 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
373
261
  }}
374
262
  />
375
263
  )))}
376
-
377
264
  </ScrollView>
378
265
  </SingleBusinessSearch>
379
- ))}
380
- {businessesSearchList?.loading && (
381
- <>
382
- {[...Array(3).keys()].map(
383
- (item, i) => (
384
- <View key={`skeleton:${i}`} style={{ width: '100%', marginTop: 20 }}>
385
- <Placeholder key={i} style={{ paddingHorizontal: 5 }} Animation={Fade}>
386
- <View style={{ flexDirection: 'row' }}>
387
- <PlaceholderLine
388
- width={24}
389
- height={70}
390
- style={{ marginRight: 10, marginBottom: 10 }}
391
- />
392
- <Placeholder style={{ paddingVertical: 10 }}>
393
- <PlaceholderLine width={20} style={{ marginBottom: 25 }} />
394
- <PlaceholderLine width={60} />
395
- </Placeholder>
396
- </View>
397
- </Placeholder>
398
- <Placeholder style={{ paddingHorizontal: 5, bottom: 10 }} Animation={Fade}>
399
- <View style={{ flexDirection: 'row-reverse', overflow: 'hidden' }}>
400
- <PlaceholderLine
401
- width={24}
402
- height={70}
403
- style={{ marginRight: 10, marginBottom: 5 }}
404
- />
405
- <Placeholder style={{ paddingVertical: 10 }}>
406
- <PlaceholderLine width={60} height={10} />
407
- <PlaceholderLine width={50} height={10} />
408
- <PlaceholderLine width={70} height={10} />
409
- </Placeholder>
410
- </View>
411
- </Placeholder>
412
- </View>
413
- ),
414
- )}
415
- </>
416
- )}
417
- </ProductsList>
418
- <OModal
419
- open={openFilters}
420
- onCancel={() => handleCloseFilters()}
421
- onClose={() => handleCloseFilters()}
422
- >
423
- <ScrollView style={styles.filterContainer}>
424
- <OText
425
- size={20}
426
- mBottom={15}
427
- style={{ marginTop: 10 }}
428
- >
429
- {t('FILTER', 'Filter')}
430
- </OText>
431
- <SortContainer>
432
- <OText weight='bold' mBottom={7} size={16}>
433
- {t('SORT', 'Sort')}
434
- </OText>
435
- {sortItems?.filter(item => !(orderState?.options?.type === 1 && item?.value === 'pickup_time') && !(orderState?.options?.type === 2 && item?.value === 'delivery_time'))?.map(item => (
436
- <TouchableOpacity
437
- key={item?.value}
438
- onPress={() => handleChangeFilters('orderBy', item?.value)}
439
- style={{ marginBottom: 7 }}
440
- >
441
- <OText
442
- weight={filters?.orderBy?.includes(item?.value) ? 'bold' : '500'}
443
- mBottom={filters?.orderBy?.includes(item?.value) ? 5 : 0}
444
- >
445
- {item?.text} {(filters?.orderBy?.includes(item?.value)) && <>{filters?.orderBy?.includes('-') ? <AntDesignIcon name='caretup' /> : <AntDesignIcon name='caretdown' />}</>}
446
- </OText>
447
- </TouchableOpacity>
448
- ))}
449
- </SortContainer>
450
- <BrandContainer>
451
- <OText
452
- size={16}
453
- weight='bold'
454
- lineHeight={24}
455
- style={{ marginBottom: 10 }}
456
- >
457
- {t('BRANDS', 'Brands')}
458
- </OText>
459
- {!brandList?.loading && !brandList?.error && brandList?.brands?.length > 0 && (
460
- <ScrollView
461
- style={{ maxHeight: 300, marginBottom: 10 }}
462
- showsVerticalScrollIndicator={true}
463
- nestedScrollEnabled={true}
464
- >
465
- {brandList?.brands.map((brand: any, i: number) => brand?.enabled && (
466
- <BrandItem
467
- key={i}
468
- onPress={() => handleChangeBrandFilter(brand?.id)}
469
- >
470
- <OText
471
- size={14}
472
- weight={'400'}
473
- lineHeight={24}
474
- >
475
- {brand?.name}
476
- </OText>
477
- {filters?.franchise_ids?.includes(brand?.id) && (
478
- <AntDesignIcon
479
- name='check'
480
- color={theme.colors.success500}
481
- size={16}
482
- />
483
- )}
484
- </BrandItem>
485
- ))}
486
- </ScrollView>
487
- )}
488
- {!brandList?.loading && ((brandList?.brands?.filter((brand: any) => brand?.enabled))?.length === 0) && (
489
- <OText size={14} weight='400'>{t('NO_RESULTS_FOUND', 'Sorry, no results found')}</OText>
490
- )}
491
- </BrandContainer>
492
- <PriceFilterWrapper>
493
- <OText
494
- size={16}
495
- weight='bold'
496
- lineHeight={24}
497
- style={{ marginBottom: 5 }}
498
- >
499
- {t('PRICE_RANGE', 'Price range')}
500
- </OText>
501
- <View style={styles.priceContainer}>
502
- {priceList.map((price: any, i: number) => (
503
- <OButton
504
- key={i}
505
- bgColor={(filters?.price_level === price?.level) ? theme.colors.primary : theme.colors.backgroundGray200}
506
- onClick={() => handleChangePriceRange(price?.level)}
507
- text={`${price.content} ${(filters?.price_level === price?.level) ? ' X' : ''}`}
508
- style={styles.priceItem}
509
- textStyle={{ fontSize: 10, color: (filters?.price_level === price?.level) ? theme.colors.backgroundLight : theme.colors.textNormal }}
510
- />
511
- ))}
512
- </View>
513
- </PriceFilterWrapper>
514
- {orderState?.options?.type === 1 && (
515
- <MaxSectionItem
516
- filters={filters}
517
- title={t('MAX_DELIVERY_FEE', 'Max delivery fee')}
518
- options={maxDeliveryFeeOptions}
519
- filter='max_delivery_price'
520
- handleChangeFilters={handleChangeFilters}
521
- />
522
- )}
523
- {[1, 2].includes(orderState?.options?.type) && (
524
- <MaxSectionItem
525
- filters={filters}
526
- title={orderState?.options?.type === 1 ? t('MAX_DELIVERY_TIME', 'Max delivery time') : t('MAX_PICKUP_TIME', 'Max pickup time')}
527
- options={maxTimeOptions}
528
- filter='max_eta'
529
- handleChangeFilters={handleChangeFilters}
530
- />
531
- )}
532
- <MaxSectionItem
533
- filters={filters}
534
- title={t('MAX_DISTANCE', 'Max distance')}
535
- options={maxDistanceOptions}
536
- filter='max_distance'
537
- handleChangeFilters={handleChangeFilters}
538
- />
539
- {businessTypes?.length > 0 && (
540
- <TagsContainer>
541
- <OText weight='bold' mBottom={7} size={16}>{t('BUSINESS_CATEGORIES', 'Business categories')}</OText>
542
- <View style={styles.businessTypesContainer}>
543
- {businessTypes.map((type: any, i: number) => type.enabled && (
544
- <OButton
545
- key={type?.id}
546
- bgColor={(filters?.business_types?.includes(type?.id) || (type?.id === null && filters?.business_types?.length === 0)) ? theme.colors.primary : theme.colors.backgroundGray200}
547
- onClick={() => handleChangeActiveBusinessType(type)}
548
- text={`${t(`BUSINESS_TYPE_${type.name.replace(/\s/g, '_').toUpperCase()}`, type.name)} ${filters?.business_types?.includes(type?.id) ? 'X' : ''}`}
549
- style={styles.categoryStyle}
550
- textStyle={{ fontSize: 10, color: (filters?.business_types?.includes(type?.id) || (type?.id === null && filters?.business_types?.length === 0)) ? '#fff' : theme.colors.textNormal }}
551
- />
552
- ))}
553
- </View>
554
- </TagsContainer>
555
- )}
556
- </ScrollView>
557
- <WrapperButtons>
558
- <View style={{ width: '50%' }}>
559
- <OButton
560
- text={t('APPLY', 'Apply')}
561
- parentStyle={styles.applyButton}
562
- textStyle={{ color: '#fff' }}
563
- onClick={() => handleApplyFilters()}
564
- />
565
- </View>
566
- <View style={{ width: '50%' }}>
567
- <OButton
568
- text={t('CLEAR_FILTERS', 'Clear')}
569
- bgColor={theme.colors.white}
570
- borderColor={theme.colors.primary}
571
- parentStyle={styles.applyButton}
572
- textStyle={{ color: theme.colors.primary }}
573
- onClick={() => clearFilters()}
574
- />
575
- </View>
576
- </WrapperButtons>
577
- </OModal>
578
- </BContainer>
579
- </IOScrollView>
266
+ </BContainer>
267
+ )}
268
+ />
269
+ {/* <IOScrollView
270
+ onScroll={(e: any) => handleScroll(e)}
271
+ showsVerticalScrollIndicator={false}
272
+ >
273
+
274
+ </IOScrollView> */}
275
+ </>
580
276
  )
581
277
  }
582
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`
@@ -1,4 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
+ import { useFocusEffect } from '@react-navigation/native'
2
3
  import { TouchableOpacity, StyleSheet, View, Dimensions, Platform } from 'react-native'
3
4
  import { useLanguage, useUtils, useConfig, useOrder, MomentOption } from 'ordering-components/native'
4
5
  import { OButton, OIcon, OText } from '../shared'
@@ -55,7 +56,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
55
56
  const [datesWhitelist, setDateWhitelist] = useState<any>([{ start: null, end: null }])
56
57
  const [isEnabled, setIsEnabled] = useState(false)
57
58
  const { top } = useSafeAreaInsets()
58
- const is12hours = configs?.dates_moment_format?.value?.includes('hh:mm')
59
+ const is12hours = configs?.general_hour_format?.value?.includes('hh:mm')
59
60
 
60
61
  const showOrderTime = (selectedPreorderType === 1 && Object.keys(menu)?.length > 0) || selectedPreorderType === 0
61
62
  const isPreOrderSetting = configs?.preorder_status_enabled?.value === '1'
@@ -63,7 +64,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
63
64
  container: {
64
65
  height: windowHeight,
65
66
  paddingVertical: 30,
66
- paddingHorizontal: 40
67
+ paddingHorizontal: 20
67
68
  },
68
69
  businessLogo: {
69
70
  backgroundColor: 'white',
@@ -310,17 +311,18 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
310
311
  }
311
312
  }, [dateSelected])
312
313
 
313
- useEffect(() => {
314
- handleAsap && handleAsap()
315
- }, [])
314
+ useFocusEffect(
315
+ React.useCallback(() => {
316
+ handleAsap && handleAsap()
317
+ }, [])
318
+ )
316
319
 
317
320
  return (
318
321
  <>
319
- <PreOrderContainer contentContainerStyle={{ paddingVertical: 32, paddingHorizontal: 40 }}>
322
+ <PreOrderContainer contentContainerStyle={{ paddingVertical: 32, paddingHorizontal: 20 }}>
320
323
  <TouchableOpacity onPress={() => goToBack && goToBack()} style={{ marginBottom: 12 }}>
321
324
  <IconAntDesign
322
325
  name='close'
323
- color={theme.colors.textThird}
324
326
  size={24}
325
327
  style={{ marginLeft: -4 }}
326
328
  />
@@ -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}
@@ -107,8 +107,7 @@ const BusinessProductsCategoriesUI = (props: any) => {
107
107
  </Placeholder>
108
108
  )}
109
109
  {!loading &&
110
- categories &&
111
- categories.length &&
110
+ categories?.length > 0 &&
112
111
  categories.map((category: any) => (
113
112
  <Tab
114
113
  key={category.id}
@@ -106,7 +106,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
106
106
  <SingleProductCard
107
107
  key={'prod_' + product.id + `_${i}`}
108
108
  isSoldOut={product.inventoried && !product.quantity}
109
- enableIntersection={!isFiltMode}
109
+ // enableIntersection={!isFiltMode}
110
110
  product={product}
111
111
  businessId={businessId}
112
112
  categoryState={categoryState}
@@ -135,7 +135,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
135
135
  key={'feat_' + product.id + `_${i}`}
136
136
  isSoldOut={product.inventoried && !product.quantity}
137
137
  product={product}
138
- enableIntersection={!isFiltMode}
138
+ // enableIntersection={!isFiltMode}
139
139
  businessId={businessId}
140
140
  categoryState={categoryState}
141
141
  onProductClick={onProductClick}
@@ -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}
@@ -309,10 +309,11 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
309
309
  ? t('SEARCH_REDIRECT', 'Go to Businesses')
310
310
  : t('CLEAR_FILTERS', 'Clear filters')
311
311
  }
312
- onClickButton={() =>
312
+ onClickButton={!businessSingleId ? () =>
313
313
  !searchValue
314
314
  ? handleSearchRedirect && handleSearchRedirect()
315
315
  : handleCancelSearch && handleCancelSearch()
316
+ : null
316
317
  }
317
318
  />
318
319
  </WrapperNotFound>