ordering-ui-react-native 0.21.55 → 0.21.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 (165) hide show
  1. package/package.json +8 -9
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/PaymentOptionsWebView/index.tsx +1 -0
  5. package/src/components/StripeMethodForm/index.tsx +6 -4
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/types/index.tsx +3 -1
  8. package/themes/business/index.tsx +4 -0
  9. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +4 -3
  10. package/themes/business/src/components/BusinessProductList/ProductList.tsx +2 -1
  11. package/themes/business/src/components/BusinessProductList/index.tsx +2 -1
  12. package/themes/business/src/components/DriverMap/index.tsx +36 -23
  13. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  14. package/themes/business/src/components/Home/index.tsx +5 -1
  15. package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
  16. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  17. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  18. package/themes/business/src/components/MapView/index.tsx +30 -15
  19. package/themes/business/src/components/NewOrderNotification/index.tsx +66 -26
  20. package/themes/business/src/components/OrderDetails/Business.tsx +52 -2
  21. package/themes/business/src/components/OrderDetails/Delivery.tsx +43 -24
  22. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +68 -61
  23. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +35 -21
  24. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  25. package/themes/business/src/components/OrderSummary/index.tsx +240 -76
  26. package/themes/business/src/components/OrdersOption/index.tsx +229 -112
  27. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  28. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +29 -19
  29. package/themes/business/src/components/PreviousOrders/index.tsx +5 -3
  30. package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
  31. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  32. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  33. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
  34. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  35. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  36. package/themes/business/src/components/SearchBar/index.tsx +2 -1
  37. package/themes/business/src/components/Sessions/index.tsx +187 -0
  38. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  39. package/themes/business/src/components/StoresList/index.tsx +4 -3
  40. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  41. package/themes/business/src/components/UserProfileForm/index.tsx +106 -54
  42. package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
  43. package/themes/business/src/components/shared/OInput.tsx +2 -0
  44. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  45. package/themes/business/src/hooks/useLocation.tsx +5 -4
  46. package/themes/business/src/types/index.tsx +22 -5
  47. package/themes/business/src/utils/index.tsx +5 -0
  48. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  49. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  50. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  51. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  52. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  53. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  54. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  55. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  56. package/themes/original/index.tsx +6 -2
  57. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  58. package/themes/original/src/components/AddressForm/index.tsx +32 -17
  59. package/themes/original/src/components/AddressList/index.tsx +8 -7
  60. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  61. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  62. package/themes/original/src/components/BusinessBasicInformation/index.tsx +6 -9
  63. package/themes/original/src/components/BusinessController/index.tsx +18 -10
  64. package/themes/original/src/components/BusinessController/styles.tsx +8 -7
  65. package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -7
  66. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +316 -0
  67. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +94 -0
  68. package/themes/original/src/components/BusinessListingSearch/index.tsx +48 -359
  69. package/themes/original/src/components/BusinessPreorder/index.tsx +20 -16
  70. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +5 -5
  71. package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
  72. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  73. package/themes/original/src/components/BusinessProductsListing/index.tsx +29 -14
  74. package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
  75. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  76. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
  77. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  78. package/themes/original/src/components/Cart/index.tsx +26 -9
  79. package/themes/original/src/components/CartContent/index.tsx +60 -45
  80. package/themes/original/src/components/Checkout/index.tsx +106 -64
  81. package/themes/original/src/components/CitiesControl/index.tsx +0 -3
  82. package/themes/original/src/components/CouponControl/index.tsx +1 -3
  83. package/themes/original/src/components/DatePicker/index.tsx +18 -2
  84. package/themes/original/src/components/DriverTips/index.tsx +1 -3
  85. package/themes/original/src/components/Favorite/index.tsx +1 -5
  86. package/themes/original/src/components/FavoriteList/index.tsx +0 -1
  87. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
  88. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  89. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  90. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
  91. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
  92. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
  93. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +9 -11
  94. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  95. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  96. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +82 -0
  97. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  98. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  99. package/themes/original/src/components/Help/index.tsx +2 -0
  100. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
  101. package/themes/original/src/components/Home/index.tsx +2 -10
  102. package/themes/original/src/components/LoginForm/Otp/index.tsx +4 -19
  103. package/themes/original/src/components/LoginForm/index.tsx +4 -7
  104. package/themes/original/src/components/MessageListing/index.tsx +1 -0
  105. package/themes/original/src/components/Messages/index.tsx +8 -7
  106. package/themes/original/src/components/MomentOption/index.tsx +13 -2
  107. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  108. package/themes/original/src/components/MultiCheckout/index.tsx +124 -63
  109. package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
  110. package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -14
  111. package/themes/original/src/components/MyOrders/index.tsx +21 -26
  112. package/themes/original/src/components/NavBar/index.tsx +4 -2
  113. package/themes/original/src/components/NetworkError/index.tsx +2 -8
  114. package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
  115. package/themes/original/src/components/Notifications/index.tsx +2 -4
  116. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +5 -7
  117. package/themes/original/src/components/OrderDetails/index.tsx +5 -7
  118. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  119. package/themes/original/src/components/OrderProgress/index.tsx +22 -3
  120. package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
  121. package/themes/original/src/components/OrdersOption/index.tsx +2 -4
  122. package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
  123. package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
  124. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  125. package/themes/original/src/components/PaymentOptions/index.tsx +47 -6
  126. package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
  127. package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
  128. package/themes/original/src/components/ProductForm/ActionButton.tsx +16 -19
  129. package/themes/original/src/components/ProductForm/index.tsx +123 -112
  130. package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -49
  131. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  132. package/themes/original/src/components/ProductOptionSubOption/index.tsx +112 -91
  133. package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
  134. package/themes/original/src/components/Promotions/index.tsx +6 -9
  135. package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
  136. package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
  137. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  138. package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
  139. package/themes/original/src/components/ServiceForm/index.tsx +52 -54
  140. package/themes/original/src/components/Sessions/index.tsx +3 -3
  141. package/themes/original/src/components/SignupForm/index.tsx +65 -67
  142. package/themes/original/src/components/SingleOrderCard/index.tsx +1 -2
  143. package/themes/original/src/components/SingleProductCard/index.tsx +5 -6
  144. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  145. package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
  146. package/themes/original/src/components/StripeCardsList/index.tsx +12 -36
  147. package/themes/original/src/components/StripeElementsForm/index.tsx +78 -59
  148. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  149. package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
  150. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
  151. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
  152. package/themes/original/src/components/UserFormDetails/index.tsx +88 -91
  153. package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
  154. package/themes/original/src/components/UserProfile/index.tsx +11 -2
  155. package/themes/original/src/components/Wallets/index.tsx +7 -4
  156. package/themes/original/src/components/Wallets/styles.tsx +1 -1
  157. package/themes/original/src/components/WebsocketStatus/index.tsx +169 -0
  158. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  159. package/themes/original/src/components/shared/OAlert.tsx +2 -1
  160. package/themes/original/src/components/shared/OButton.tsx +8 -7
  161. package/themes/original/src/components/shared/OInput.tsx +1 -4
  162. package/themes/original/src/layouts/Container.tsx +4 -2
  163. package/themes/original/src/types/index.tsx +5 -1
  164. package/themes/original/src/utils/index.tsx +12 -1
  165. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -0,0 +1,94 @@
1
+ import React, { useEffect, useState } from 'react'
2
+ import { useLanguage } from 'ordering-components/native'
3
+ import { View, Platform, StyleSheet, Dimensions } from 'react-native'
4
+ import { HeaderTitle, OButton, OText } from '../shared'
5
+ import { SearchBar } from '../SearchBar';
6
+ import { NotFoundSource } from '../NotFoundSource'
7
+ import AntDesignIcon from 'react-native-vector-icons/AntDesign'
8
+ import {
9
+ SearchWrapper,
10
+ BContainer,
11
+ } from './styles'
12
+ import { useTheme } from 'styled-components/native'
13
+
14
+ export const BusinessSearchHeader = (props: any) => {
15
+ const {
16
+ businessesSearchList,
17
+ onChangeTermValue,
18
+ termValue,
19
+ handleOpenfilters
20
+ } = props
21
+ const theme = useTheme()
22
+ const [, t] = useLanguage()
23
+ const noResults = (!businessesSearchList.loading && !businessesSearchList.lengthError && businessesSearchList?.businesses?.length === 0)
24
+ const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
25
+ const hideBrowse = theme?.bar_menu?.components?.browse?.hidden
26
+
27
+ const styles = StyleSheet.create({
28
+ searchInput: {
29
+ fontSize: 12,
30
+ height: 44
31
+ }
32
+ });
33
+
34
+ return (
35
+ <>
36
+ <View style={{
37
+ width: '100%',
38
+ display: 'flex',
39
+ flexDirection: 'row',
40
+ alignItems: 'center',
41
+ }}>
42
+ {hideBrowse && !isChewLayout && (
43
+ <OButton
44
+ imgLeftStyle={{ width: 18 }}
45
+ imgRightSrc={null}
46
+ style={{
47
+ borderWidth: 0,
48
+ width: 26,
49
+ height: 26,
50
+ paddingLeft: 0,
51
+ paddingRight: 0,
52
+ marginTop: 50,
53
+ }}
54
+ useArrow
55
+ onClick={() => props.navigation.goBack()}
56
+ icon={AntDesignIcon}
57
+ iconProps={{
58
+ name: 'arrowleft',
59
+ size: 26
60
+ }}
61
+ />
62
+ )}
63
+ <HeaderTitle ph={20} text={t('SEARCH', 'Search')} />
64
+ <AntDesignIcon name='filter' size={18} style={{ marginLeft: 'auto', marginTop: Platform.OS === 'ios' ? 35 : 55, paddingHorizontal: 20 }} onPress={() => handleOpenfilters()} />
65
+ </View>
66
+ <BContainer
67
+ style={{ paddingHorizontal: 20 }}
68
+ >
69
+ <SearchWrapper>
70
+ <SearchBar
71
+ lazyLoad
72
+ {...(isChewLayout && { height: 55 })}
73
+ inputStyle={{ ...styles.searchInput }}
74
+ placeholder={t('SEARCH_BUSINESSES', 'Search Businesses')}
75
+ onSearch={(val: string) => onChangeTermValue(val)}
76
+ value={termValue}
77
+ />
78
+ </SearchWrapper>
79
+ <OText size={12} lineHeight={20} color={theme.colors.textThird} mLeft={5}>
80
+ {t('TYPE_AT_LEAST_2_CHARACTERS', 'Type at least 2 characters')}
81
+ </OText>
82
+ {
83
+ noResults && (
84
+ <View>
85
+ <NotFoundSource
86
+ content={t('NOT_FOUND_BUSINESSES', 'No businesses to delivery / pick up at this address, please change filters or change address.')}
87
+ />
88
+ </View>
89
+ )
90
+ }
91
+ </BContainer>
92
+ </>
93
+ )
94
+ }
@@ -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, Platform } from 'react-native'
4
- import { useSafeAreaInsets } from 'react-native-safe-area-context'
3
+ import { ScrollView, StyleSheet, Dimensions, FlatList } from 'react-native'
5
4
  import { useTheme } from 'styled-components/native'
6
- import { HeaderTitle, OButton, OModal, OText } from '../shared'
7
- import { SearchBar } from '../SearchBar';
8
- import { NotFoundSource } from '../NotFoundSource'
5
+ import { OButton, OText } from '../shared'
6
+
9
7
  import { SingleProductCard } from '../SingleProductCard'
10
- import AntDesignIcon from 'react-native-vector-icons/AntDesign'
11
8
  import {
12
- SearchWrapper,
13
- ProductsList,
14
9
  SingleBusinessSearch,
15
10
  BusinessInfo,
16
11
  BusinessInfoItem,
17
12
  Metadata,
18
13
  SingleBusinessContainer,
19
- TagsContainer,
20
- SortContainer,
21
- BrandContainer,
22
- BrandItem,
23
- PriceFilterWrapper,
24
14
  BContainer,
25
- WrapperButtons
26
15
  } from './styles'
27
16
  import FastImage from 'react-native-fast-image'
28
17
  import { convertHoursToMinutes } from '../../utils'
29
- import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'
30
18
  import { BusinessSearchParams } from '../../types'
31
19
  import { useIsFocused } from '@react-navigation/native';
32
- import { MaxSectionItem } from './MaxSectionItem'
33
- import { IOScrollView } from 'react-native-intersection-observer'
20
+
21
+ import { BusinessSearchHeader } from './BusinessSearchHeader'
22
+ import { BusinessSearchFooter } from './BusinessSearchFooter'
34
23
 
35
24
  const PIXELS_TO_SCROLL = 1000
36
25
 
@@ -51,94 +40,20 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
51
40
  handleUpdateProducts
52
41
  } = props
53
42
 
54
- const screenHeight = Dimensions.get('window').height;
55
43
  const screenWidth = Dimensions.get('window').width;
56
44
  const theme = useTheme()
57
45
  const [orderState] = useOrder()
58
46
  const [events] = useEvent()
59
- const { top } = useSafeAreaInsets();
60
47
  const [, t] = useLanguage()
61
48
  const [{ parsePrice, parseDistance, optimizeImage }] = useUtils();
62
49
 
63
50
  const [openFilters, setOpenFilters] = useState(false)
64
- const noResults = (!businessesSearchList.loading && !businessesSearchList.lengthError && businessesSearchList?.businesses?.length === 0)
65
- const maxDeliveryFeeOptions = [15, 25, 35, 'default']
66
- // const maxProductPriceOptions = [5, 10, 15, 'default']
67
- const maxDistanceOptions = [1000, 2000, 5000, 'default']
68
- const maxTimeOptions = [5, 15, 30, 'default']
69
- const sortItems = [
70
- { text: t('PICKED_FOR_YOU', 'Picked for you (default)'), value: 'distance' },
71
- { text: t('DELIVERY_TIME', 'Delivery time'), value: 'delivery_time' },
72
- { text: t('PICKUP_TIME', 'Pickup time'), value: 'pickup_time' }
73
- ]
74
-
75
- const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
76
- const hideBrowse = theme?.bar_menu?.components?.browse?.hidden
77
-
78
- const priceList = [
79
- { level: '1', content: '$' },
80
- { level: '2', content: '$$' },
81
- { level: '3', content: '$$$' },
82
- { level: '4', content: '$$$$' },
83
- { level: '5', content: '$$$$$' }
84
- ]
85
51
 
86
52
  const isFocused = useIsFocused();
87
53
 
88
54
  const styles = StyleSheet.create({
89
- container: {
90
- paddingHorizontal: 40,
91
- width: '100%'
92
- },
93
- filterContainer: {
94
- maxHeight: screenHeight - 150,
95
- paddingHorizontal: 20,
96
- width: '100%'
97
- },
98
- searchInput: {
99
- fontSize: 12,
100
- height: 44
101
- },
102
55
  productsContainer: {
103
56
  marginTop: 20
104
- },
105
- businessTypesContainer: {
106
- width: '100%',
107
- flexDirection: 'row',
108
- flexWrap: 'wrap',
109
- justifyContent: 'center'
110
- },
111
- priceContainer: {
112
- width: '100%',
113
- flexDirection: 'row',
114
- flexWrap: 'wrap',
115
- justifyContent: 'space-between'
116
- },
117
- categoryStyle: {
118
- marginRight: 10,
119
- marginTop: 10,
120
- borderRadius: 50,
121
- paddingHorizontal: 10,
122
- paddingVertical: 4,
123
- paddingLeft: 0,
124
- paddingRight: 0,
125
- height: 28,
126
- borderWidth: 0
127
- },
128
- priceItem: {
129
- marginRight: 10,
130
- marginTop: 10,
131
- borderRadius: 50,
132
- paddingVertical: 4,
133
- paddingLeft: 5,
134
- paddingRight: 5,
135
- height: 27,
136
- borderWidth: 0
137
- },
138
- applyButton: {
139
- paddingHorizontal: 10,
140
- width: '100%',
141
- marginTop: 20
142
57
  }
143
58
  });
144
59
 
@@ -250,70 +165,37 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
250
165
  }, [isFocused])
251
166
 
252
167
  return (
253
- <IOScrollView
254
- onScroll={(e: any) => handleScroll(e)}
255
- showsVerticalScrollIndicator={false}
256
- >
257
- <View style={{
258
- width: '100%',
259
- display: 'flex',
260
- flexDirection: 'row',
261
- alignItems: 'center',
262
- }}>
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: Platform.OS === 'ios' ? 35 : 55, paddingHorizontal: 20 }} onPress={() => handleOpenfilters()} />
288
- </View>
289
- <BContainer
290
- style={{ paddingHorizontal: 20 }}
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) && (
@@ -348,7 +230,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
348
230
  </BusinessInfoItem>
349
231
  <OButton
350
232
  onClick={() => onBusinessClick(business)}
351
- textStyle={{ color: theme.colors.primary, fontSize: 10 }}
233
+ textStyle={{ fontSize: 10 }}
352
234
  text={t('GO_TO_STORE', 'Go to store')}
353
235
  style={{
354
236
  borderRadius: 23,
@@ -356,7 +238,6 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
356
238
  paddingRight: 10,
357
239
  height: 23,
358
240
  shadowOpacity: 0,
359
- backgroundColor: theme.colors.primaryContrast,
360
241
  borderWidth: 0
361
242
  }}
362
243
  />
@@ -379,210 +260,18 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
379
260
  }}
380
261
  />
381
262
  )))}
382
-
383
263
  </ScrollView>
384
264
  </SingleBusinessSearch>
385
- ))}
386
- {businessesSearchList?.loading && (
387
- <>
388
- {[...Array(3).keys()].map(
389
- (item, i) => (
390
- <View key={`skeleton:${i}`} style={{ width: '100%', marginTop: 20 }}>
391
- <Placeholder key={i} style={{ paddingHorizontal: 5 }} Animation={Fade}>
392
- <View style={{ flexDirection: 'row' }}>
393
- <PlaceholderLine
394
- width={24}
395
- height={70}
396
- style={{ marginRight: 10, marginBottom: 10 }}
397
- />
398
- <Placeholder style={{ paddingVertical: 10 }}>
399
- <PlaceholderLine width={20} style={{ marginBottom: 25 }} />
400
- <PlaceholderLine width={60} />
401
- </Placeholder>
402
- </View>
403
- </Placeholder>
404
- <Placeholder style={{ paddingHorizontal: 5, bottom: 10 }} Animation={Fade}>
405
- <View style={{ flexDirection: 'row-reverse', overflow: 'hidden' }}>
406
- <PlaceholderLine
407
- width={24}
408
- height={70}
409
- style={{ marginRight: 10, marginBottom: 5 }}
410
- />
411
- <Placeholder style={{ paddingVertical: 10 }}>
412
- <PlaceholderLine width={60} height={10} />
413
- <PlaceholderLine width={50} height={10} />
414
- <PlaceholderLine width={70} height={10} />
415
- </Placeholder>
416
- </View>
417
- </Placeholder>
418
- </View>
419
- ),
420
- )}
421
- </>
422
- )}
423
- </ProductsList>
424
- <OModal
425
- open={openFilters}
426
- onCancel={() => handleCloseFilters()}
427
- onClose={() => handleCloseFilters()}
428
- >
429
- <ScrollView style={styles.filterContainer}>
430
- <OText
431
- size={20}
432
- mBottom={15}
433
- style={{ marginTop: 10 }}
434
- >
435
- {t('FILTER', 'Filter')}
436
- </OText>
437
- <SortContainer>
438
- <OText weight='bold' mBottom={7} size={16}>
439
- {t('SORT', 'Sort')}
440
- </OText>
441
- {sortItems?.filter(item => !(orderState?.options?.type === 1 && item?.value === 'pickup_time') && !(orderState?.options?.type === 2 && item?.value === 'delivery_time'))?.map(item => (
442
- <TouchableOpacity
443
- key={item?.value}
444
- onPress={() => handleChangeFilters('orderBy', item?.value)}
445
- style={{ marginBottom: 7 }}
446
- >
447
- <OText
448
- weight={filters?.orderBy?.includes(item?.value) ? 'bold' : '500'}
449
- mBottom={filters?.orderBy?.includes(item?.value) ? 5 : 0}
450
- >
451
- {item?.text} {(filters?.orderBy?.includes(item?.value)) && <>{filters?.orderBy?.includes('-') ? <AntDesignIcon name='caretup' /> : <AntDesignIcon name='caretdown' />}</>}
452
- </OText>
453
- </TouchableOpacity>
454
- ))}
455
- </SortContainer>
456
- <BrandContainer>
457
- <OText
458
- size={16}
459
- weight='bold'
460
- lineHeight={24}
461
- style={{ marginBottom: 10 }}
462
- >
463
- {t('BRANDS', 'Brands')}
464
- </OText>
465
- {!brandList?.loading && !brandList?.error && brandList?.brands?.length > 0 && (
466
- <ScrollView
467
- style={{ maxHeight: 300, marginBottom: 10 }}
468
- showsVerticalScrollIndicator={true}
469
- nestedScrollEnabled={true}
470
- >
471
- {brandList?.brands.map((brand: any, i: number) => brand?.enabled && (
472
- <BrandItem
473
- key={i}
474
- onPress={() => handleChangeBrandFilter(brand?.id)}
475
- >
476
- <OText
477
- size={14}
478
- weight={'400'}
479
- lineHeight={24}
480
- >
481
- {brand?.name}
482
- </OText>
483
- {filters?.franchise_ids?.includes(brand?.id) && (
484
- <AntDesignIcon
485
- name='check'
486
- color={theme.colors.success500}
487
- size={16}
488
- />
489
- )}
490
- </BrandItem>
491
- ))}
492
- </ScrollView>
493
- )}
494
- {!brandList?.loading && ((brandList?.brands?.filter((brand: any) => brand?.enabled))?.length === 0) && (
495
- <OText size={14} weight='400'>{t('NO_RESULTS_FOUND', 'Sorry, no results found')}</OText>
496
- )}
497
- </BrandContainer>
498
- <PriceFilterWrapper>
499
- <OText
500
- size={16}
501
- weight='bold'
502
- lineHeight={24}
503
- style={{ marginBottom: 5 }}
504
- >
505
- {t('PRICE_RANGE', 'Price range')}
506
- </OText>
507
- <View style={styles.priceContainer}>
508
- {priceList.map((price: any, i: number) => (
509
- <OButton
510
- key={i}
511
- bgColor={(filters?.price_level === price?.level) ? theme.colors.primary : theme.colors.backgroundGray200}
512
- onClick={() => handleChangePriceRange(price?.level)}
513
- text={`${price.content} ${(filters?.price_level === price?.level) ? ' X' : ''}`}
514
- style={styles.priceItem}
515
- textStyle={{ fontSize: 10, color: (filters?.price_level === price?.level) ? theme.colors.backgroundLight : theme.colors.textNormal }}
516
- />
517
- ))}
518
- </View>
519
- </PriceFilterWrapper>
520
- {orderState?.options?.type === 1 && (
521
- <MaxSectionItem
522
- filters={filters}
523
- title={t('MAX_DELIVERY_FEE', 'Max delivery fee')}
524
- options={maxDeliveryFeeOptions}
525
- filter='max_delivery_price'
526
- handleChangeFilters={handleChangeFilters}
527
- />
528
- )}
529
- {[1, 2].includes(orderState?.options?.type) && (
530
- <MaxSectionItem
531
- filters={filters}
532
- title={orderState?.options?.type === 1 ? t('MAX_DELIVERY_TIME', 'Max delivery time') : t('MAX_PICKUP_TIME', 'Max pickup time')}
533
- options={maxTimeOptions}
534
- filter='max_eta'
535
- handleChangeFilters={handleChangeFilters}
536
- />
537
- )}
538
- <MaxSectionItem
539
- filters={filters}
540
- title={t('MAX_DISTANCE', 'Max distance')}
541
- options={maxDistanceOptions}
542
- filter='max_distance'
543
- handleChangeFilters={handleChangeFilters}
544
- />
545
- {businessTypes?.length > 0 && (
546
- <TagsContainer>
547
- <OText weight='bold' mBottom={7} size={16}>{t('BUSINESS_CATEGORIES', 'Business categories')}</OText>
548
- <View style={styles.businessTypesContainer}>
549
- {businessTypes.map((type: any, i: number) => type.enabled && (
550
- <OButton
551
- key={type?.id}
552
- bgColor={(filters?.business_types?.includes(type?.id) || (type?.id === null && filters?.business_types?.length === 0)) ? theme.colors.primary : theme.colors.backgroundGray200}
553
- onClick={() => handleChangeActiveBusinessType(type)}
554
- text={`${t(`BUSINESS_TYPE_${type.name.replace(/\s/g, '_').toUpperCase()}`, type.name)} ${filters?.business_types?.includes(type?.id) ? 'X' : ''}`}
555
- style={styles.categoryStyle}
556
- textStyle={{ fontSize: 10, color: (filters?.business_types?.includes(type?.id) || (type?.id === null && filters?.business_types?.length === 0)) ? '#fff' : theme.colors.textNormal }}
557
- />
558
- ))}
559
- </View>
560
- </TagsContainer>
561
- )}
562
- </ScrollView>
563
- <WrapperButtons>
564
- <View style={{ width: '50%' }}>
565
- <OButton
566
- text={t('APPLY', 'Apply')}
567
- parentStyle={styles.applyButton}
568
- textStyle={{ color: '#fff' }}
569
- onClick={() => handleApplyFilters()}
570
- />
571
- </View>
572
- <View style={{ width: '50%' }}>
573
- <OButton
574
- text={t('CLEAR_FILTERS', 'Clear')}
575
- bgColor={theme.colors.white}
576
- borderColor={theme.colors.primary}
577
- parentStyle={styles.applyButton}
578
- textStyle={{ color: theme.colors.primary }}
579
- onClick={() => clearFilters()}
580
- />
581
- </View>
582
- </WrapperButtons>
583
- </OModal>
584
- </BContainer>
585
- </IOScrollView>
265
+ </BContainer>
266
+ )}
267
+ />
268
+ {/* <IOScrollView
269
+ onScroll={(e: any) => handleScroll(e)}
270
+ showsVerticalScrollIndicator={false}
271
+ >
272
+
273
+ </IOScrollView> */}
274
+ </>
586
275
  )
587
276
  }
588
277
 
@@ -11,6 +11,8 @@ import { BusinessMenuList } from '../BusinessMenuList'
11
11
  import Spinner from 'react-native-loading-spinner-overlay'
12
12
  import { BusinessPreorderParams } from '../../types'
13
13
  import moment from 'moment'
14
+ import { setLocalMoment } from '../../utils';
15
+
14
16
  import SelectDropdown from 'react-native-select-dropdown'
15
17
  import {
16
18
  PreOrderContainer,
@@ -311,6 +313,10 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
311
313
  }
312
314
  }, [dateSelected])
313
315
 
316
+ useEffect(() => {
317
+ setLocalMoment(moment, t)
318
+ }, [])
319
+
314
320
  useFocusEffect(
315
321
  React.useCallback(() => {
316
322
  handleAsap && handleAsap()
@@ -323,7 +329,6 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
323
329
  <TouchableOpacity onPress={() => goToBack && goToBack()} style={{ marginBottom: 12 }}>
324
330
  <IconAntDesign
325
331
  name='close'
326
- color={theme.colors.textThird}
327
332
  size={24}
328
333
  style={{ marginLeft: -4 }}
329
334
  />
@@ -528,7 +533,6 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
528
533
  )}
529
534
  <OButton
530
535
  text={t('GO_TO_MENU', 'Go to menu')}
531
- textStyle={{ color: 'white' }}
532
536
  style={{ borderRadius: 7.6, marginBottom: 20, marginTop: 30 }}
533
537
  onClick={() => handleClickBusiness()}
534
538
  isDisabled={isAsap || !(dateSelected && timeSelected)}
@@ -554,21 +558,21 @@ export const BusinessPreorder = (props: any) => {
554
558
  currentDate.setMinutes(59)
555
559
 
556
560
  const cateringTypeString = orderState?.options?.type === 7
557
- ? 'catering_delivery'
558
- : orderState?.options?.type === 8
559
- ? 'catering_pickup'
560
- : null
561
+ ? 'catering_delivery'
562
+ : orderState?.options?.type === 8
563
+ ? 'catering_pickup'
564
+ : null
561
565
 
562
- const splitCateringValue = (configName : string) =>
563
- Object.values(props?.business?.configs || {})
564
- ?.find(config => config?.key === configName)
565
- ?.value?.split('|')
566
- ?.find(val => val.includes(cateringTypeString || ''))?.split(',')[1]
567
- const preorderSlotInterval = parseInt(splitCateringValue('preorder_slot_interval'))
568
- const preorderLeadTime = parseInt(splitCateringValue('preorder_lead_time'))
569
- const preorderTimeRange = parseInt(splitCateringValue('preorder_time_range'))
570
- const preorderMaximumDays = parseInt(splitCateringValue('preorder_maximum_days'))
571
- const preorderMinimumDays = parseInt(splitCateringValue('preorder_minimum_days'))
566
+ const splitCateringValue = (configName: string) =>
567
+ Object.values(props?.business?.configs || {})
568
+ ?.find(config => config?.key === configName)
569
+ ?.value?.split('|')
570
+ ?.find(val => val.includes(cateringTypeString || ''))?.split(',')[1]
571
+ const preorderSlotInterval = parseInt(splitCateringValue('preorder_slot_interval'))
572
+ const preorderLeadTime = parseInt(splitCateringValue('preorder_lead_time'))
573
+ const preorderTimeRange = parseInt(splitCateringValue('preorder_time_range'))
574
+ const preorderMaximumDays = parseInt(splitCateringValue('preorder_maximum_days'))
575
+ const preorderMinimumDays = parseInt(splitCateringValue('preorder_minimum_days'))
572
576
 
573
577
  const businessPreorderProps = {
574
578
  ...props,
@@ -16,7 +16,7 @@ interface SubcategoriesComponentParams {
16
16
  onClickSubcategory: any
17
17
  }
18
18
 
19
- const SubcategoriesComponent = (props : SubcategoriesComponentParams) => {
19
+ const SubcategoriesComponent = (props: SubcategoriesComponentParams) => {
20
20
  const {
21
21
  subcategoriesSelected,
22
22
  category,
@@ -56,10 +56,10 @@ const SubcategoriesComponent = (props : SubcategoriesComponentParams) => {
56
56
  >
57
57
  <OButton
58
58
  onClick={() => onClickSubcategory(null, category)}
59
- bgColor={allsubcategorySelected ? theme.colors.primary : theme.colors.backgroundGray}
60
59
  text={`${t('ALL', 'All')} ${allsubcategorySelected ? 'X' : ''}`}
61
60
  style={bpStyles.categoryButtonStyle}
62
- textStyle={{ color: allsubcategorySelected ? theme.colors.white : theme.colors.textNormal, fontSize: 12 }}
61
+ textStyle={{ fontSize: 12 }}
62
+ isDisabled={!allsubcategorySelected}
63
63
  />
64
64
  </ContainerButton>
65
65
  {category?.subcategories?.map((subcategory: any) => {
@@ -71,10 +71,10 @@ const SubcategoriesComponent = (props : SubcategoriesComponentParams) => {
71
71
  >
72
72
  <OButton
73
73
  onClick={() => onClickSubcategory(subcategory, category)}
74
- bgColor={isSubcategorySelected ? theme.colors.primary : theme.colors.backgroundGray}
75
74
  text={`${subcategory?.name} ${isSubcategorySelected ? 'X' : ''}`}
76
75
  style={bpStyles.categoryButtonStyle}
77
- textStyle={{ color: isSubcategorySelected ? theme.colors.white : theme.colors.textNormal, fontSize: 12 }}
76
+ textStyle={{ fontSize: 12 }}
77
+ isDisabled={!allsubcategorySelected}
78
78
  />
79
79
  </ContainerButton>
80
80
  )