ordering-ui-react-native 0.14.38 → 0.14.40-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 (56) hide show
  1. package/package.json +2 -2
  2. package/src/components/BusinessItemAccordion/index.tsx +2 -2
  3. package/src/components/BusinessProductsListing/index.tsx +10 -26
  4. package/src/components/Cart/index.tsx +136 -62
  5. package/src/components/Cart/styles.tsx +7 -0
  6. package/src/components/Checkout/index.tsx +32 -168
  7. package/src/components/OrderDetails/index.tsx +102 -34
  8. package/src/components/OrderDetails/styles.tsx +7 -0
  9. package/src/components/OrderSummary/index.tsx +142 -58
  10. package/src/components/OrderSummary/styles.tsx +10 -2
  11. package/src/components/PaymentOptions/index.tsx +3 -1
  12. package/src/components/PaymentOptionsWebView/index.tsx +150 -0
  13. package/src/components/ProductForm/index.tsx +7 -9
  14. package/src/components/SingleProductCard/index.tsx +1 -1
  15. package/src/components/StripeElementsForm/index.tsx +28 -13
  16. package/src/components/TaxInformation/index.tsx +58 -26
  17. package/src/components/UpsellingProducts/index.tsx +13 -31
  18. package/src/components/VerifyPhone/styles.tsx +1 -2
  19. package/src/components/shared/OIcon.tsx +4 -1
  20. package/src/index.tsx +2 -0
  21. package/src/navigators/HomeNavigator.tsx +6 -0
  22. package/src/pages/ProductDetails.tsx +55 -0
  23. package/src/types/index.tsx +2 -0
  24. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  25. package/themes/kiosk/src/components/Cart/index.tsx +14 -21
  26. package/themes/kiosk/src/components/CartItem/index.tsx +9 -7
  27. package/themes/kiosk/src/components/CustomerName/index.tsx +2 -1
  28. package/themes/kiosk/src/components/Intro/index.tsx +4 -4
  29. package/themes/kiosk/src/components/OptionCard/index.tsx +11 -6
  30. package/themes/kiosk/src/components/PaymentOptions/index.tsx +46 -44
  31. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -9
  32. package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -2
  33. package/themes/original/src/components/BusinessProductsListing/index.tsx +8 -4
  34. package/themes/original/src/components/BusinessesListing/index.tsx +100 -75
  35. package/themes/original/src/components/Cart/index.tsx +122 -24
  36. package/themes/original/src/components/Cart/styles.tsx +8 -1
  37. package/themes/original/src/components/Checkout/index.tsx +38 -3
  38. package/themes/original/src/components/Help/index.tsx +1 -1
  39. package/themes/original/src/components/Home/index.tsx +5 -3
  40. package/themes/original/src/components/MessageListing/index.tsx +4 -2
  41. package/themes/original/src/components/OrderDetails/index.tsx +114 -42
  42. package/themes/original/src/components/OrderDetails/styles.tsx +8 -1
  43. package/themes/original/src/components/OrderProgress/index.tsx +2 -1
  44. package/themes/original/src/components/OrderSummary/index.tsx +132 -23
  45. package/themes/original/src/components/OrderSummary/styles.tsx +7 -0
  46. package/themes/original/src/components/PaymentOptionWallet/index.tsx +6 -2
  47. package/themes/original/src/components/PaymentOptions/index.tsx +8 -2
  48. package/themes/original/src/components/ProductForm/index.tsx +63 -65
  49. package/themes/original/src/components/ProductForm/styles.tsx +6 -0
  50. package/themes/original/src/components/ProductOptionSubOption/index.tsx +3 -2
  51. package/themes/original/src/components/SingleProductCard/index.tsx +21 -11
  52. package/themes/original/src/components/SingleProductCard/styles.tsx +4 -0
  53. package/themes/original/src/components/StripeElementsForm/index.tsx +28 -13
  54. package/themes/original/src/components/TaxInformation/index.tsx +59 -27
  55. package/themes/original/src/components/UpsellingProducts/index.tsx +26 -18
  56. package/themes/original/src/types/index.tsx +2 -0
@@ -19,6 +19,8 @@ import Spinner from 'react-native-loading-spinner-overlay';
19
19
  import { LANDSCAPE, PORTRAIT, useDeviceOrientation } from '../../../../../src/hooks/DeviceOrientation';
20
20
  import GridContainer from '../../layouts/GridContainer';
21
21
  import { OModal, PaymentOptionStripe } from '../../../../../src';
22
+ import AntIconDesign from 'react-native-vector-icons/AntDesign'
23
+ import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons'
22
24
 
23
25
  const PaymentOptionsUI = (props: any) => {
24
26
  const {
@@ -41,7 +43,7 @@ const PaymentOptionsUI = (props: any) => {
41
43
  } = props;
42
44
 
43
45
  const theme = useTheme();
44
- const [, {showToast}] = useToast();
46
+ const [, { showToast }] = useToast();
45
47
  const [, t] = useLanguage();
46
48
  const [orientationState] = useDeviceOrientation();
47
49
  const [userErrors, setUserErrors] = useState<any>([]);
@@ -134,52 +136,52 @@ const PaymentOptionsUI = (props: any) => {
134
136
  CASH_ID:
135
137
  cashIndex !== -1
136
138
  ? {
137
- style: cardStyle,
138
- title: t('CASH', 'Cash'),
139
- description: t(
140
- 'GO_FOR_YOR_RECEIPT_AND_GO_TO_THE_FRONT_COUNTER',
141
- 'Pay with cash in the front counter',
142
- ),
143
- bgImage: theme.images.general.cash,
144
- icon: theme.images.general.shoppingCart,
145
- callToActionText: t('LETS_GO', 'LETS_GO'),
146
- onClick: () =>
147
- onSelectPaymethod(supportedMethods[cashIndex], false),
148
- ...supportedMethods[cashIndex],
149
- }
139
+ style: cardStyle,
140
+ title: t('CASH', 'Cash'),
141
+ description: t(
142
+ 'GO_FOR_YOR_RECEIPT_AND_GO_TO_THE_FRONT_COUNTER',
143
+ 'Pay with cash in the front counter',
144
+ ),
145
+ bgImage: theme.images.general.cash,
146
+ callToActionText: t('LETS_GO', 'LETS_GO'),
147
+ VectorIcon: () => <AntIconDesign name='shoppingcart' size={28} color='white' style={{ marginBottom: 10 }} />,
148
+ onClick: () =>
149
+ onSelectPaymethod(supportedMethods[cashIndex], false),
150
+ ...supportedMethods[cashIndex],
151
+ }
150
152
  : null,
151
153
 
152
154
  CARD_ON_DELIVERY_ID:
153
155
  cardOnDeliveryIndex !== -1
154
156
  ? {
155
- style: cardStyle,
156
- title: t('CARD', supportedMethods[cardOnDeliveryIndex]?.name),
157
- description: t(
158
- 'WE_ACCEPT_EVERY_DEBIT_OR_CREDIT_CARD',
159
- 'We accept every debit or credit card',
160
- ),
161
- bgImage: theme.images.general.carddelivery,
162
- icon: theme.images.general.pushPin,
163
- callToActionText: t("LETS_GO", "Let's go"),
164
- onClick: () => onSelectPaymethod(supportedMethods[cardOnDeliveryIndex], false),
165
- ...supportedMethods[cardOnDeliveryIndex],
166
- }
157
+ style: cardStyle,
158
+ title: t('CARD', supportedMethods[cardOnDeliveryIndex]?.name),
159
+ description: t(
160
+ 'WE_ACCEPT_EVERY_DEBIT_OR_CREDIT_CARD',
161
+ 'We accept every debit or credit card',
162
+ ),
163
+ bgImage: theme.images.general.carddelivery,
164
+ callToActionText: t("LETS_GO", "Let's go"),
165
+ VectorIcon: () => <MaterialIcon name='pin-outline' size={28} color='white' style={{ marginBottom: 10 }} />,
166
+ onClick: () => onSelectPaymethod(supportedMethods[cardOnDeliveryIndex], false),
167
+ ...supportedMethods[cardOnDeliveryIndex],
168
+ }
167
169
  : null,
168
170
  STRIPE:
169
171
  stripeIndex !== -1
170
172
  ? {
171
- style: cardStyle,
172
- title: t('STRIPE', supportedMethods[stripeIndex]?.name),
173
- description: t('STRIPE', 'Stripe'),
174
- bgImage: theme.images.general.carddelivery,
175
- icon: theme.images.general.pushPin,
176
- callToActionText: t('INSERT_INFO', 'Test info'),
177
- onClick: () => {
178
- onSelectPaymethod(supportedMethods[stripeIndex], false);
179
- setIsOpenModal(true)
180
- },
181
- ...supportedMethods[stripeIndex],
182
- }
173
+ style: cardStyle,
174
+ title: t('STRIPE', supportedMethods[stripeIndex]?.name),
175
+ description: t('STRIPE', 'Stripe'),
176
+ bgImage: theme.images.general.carddelivery,
177
+ callToActionText: t('INSERT_INFO', 'Test info'),
178
+ VectorIcon: () => <MaterialIcon name='pin-outline' size={28} color='white' style={{ marginBottom: 10 }} />,
179
+ onClick: () => {
180
+ onSelectPaymethod(supportedMethods[stripeIndex], false);
181
+ setIsOpenModal(true)
182
+ },
183
+ ...supportedMethods[stripeIndex],
184
+ }
183
185
  : null,
184
186
  };
185
187
 
@@ -193,11 +195,11 @@ const PaymentOptionsUI = (props: any) => {
193
195
  <NavBar
194
196
  title={t('PAYMENT_METHODS', 'Payment methods')}
195
197
  onActionLeft={goToBack}
196
- btnStyle={{paddingLeft: 0}}
198
+ btnStyle={{ paddingLeft: 0 }}
197
199
  />
198
200
 
199
201
  <View
200
- style={{marginVertical: orientationState?.dimensions?.height * 0.03}}>
202
+ style={{ marginVertical: orientationState?.dimensions?.height * 0.03 }}>
201
203
  <OText size={orientationState?.dimensions?.width * 0.048}>
202
204
  {t('HOW_WOULD_YOU', 'How would you')} {'\n'}
203
205
  <OText
@@ -209,10 +211,10 @@ const PaymentOptionsUI = (props: any) => {
209
211
  </View>
210
212
 
211
213
  {supportedMethods?.length > 0 && (
212
- <GridContainer style={{justifyContent: 'space-between'}}>
214
+ <GridContainer style={{ justifyContent: 'space-between' }}>
213
215
  {propsOfItems.CARD_ON_DELIVERY_ID && (
214
- <View style={{marginBottom: orientationState?.orientation === LANDSCAPE ? 20 : 0}}>
215
- <OptionCard {...propsOfItems?.CARD_ON_DELIVERY_ID} styke/>
216
+ <View style={{ marginBottom: orientationState?.orientation === LANDSCAPE ? 20 : 0 }}>
217
+ <OptionCard {...propsOfItems?.CARD_ON_DELIVERY_ID} styke />
216
218
  </View>
217
219
  )}
218
220
 
@@ -249,7 +251,7 @@ const PaymentOptionsUI = (props: any) => {
249
251
  )}
250
252
  </GridContainer>
251
253
  )}
252
- <View style={{height: orientationState?.dimensions?.height * 0.05}} />
254
+ <View style={{ height: orientationState?.dimensions?.height * 0.05 }} />
253
255
  <OModal
254
256
  open={isOpenModal}
255
257
  onClose={() => setIsOpenModal(false)}
@@ -139,17 +139,20 @@ export const BusinessItemAccordion = (props: any) => {
139
139
  )}
140
140
  </BIActions>
141
141
  </BIHeader>
142
- {!isActive && !isClosed && !!isProducts && !checkoutButtonDisabled && (
142
+ {!isActive && !isClosed && !!isProducts && (
143
143
  <PriceContainer>
144
144
  <OText>{parsePrice(cart?.total)}</OText>
145
- <OButton
146
- onClick={handleClickCheckout}
147
- textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
148
- style={{ width: 160, flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
149
- text={t('CHECKOUT', 'Checkout')}
150
- bgColor={(cart?.subtotal < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
151
- borderColor={theme.colors.primary}
152
- />
145
+ {cart?.valid_products && (
146
+ <OButton
147
+ onClick={handleClickCheckout}
148
+ textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
149
+ style={{ width: 160, flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
150
+ text={t('CHECKOUT', 'Checkout')}
151
+ bgColor={(cart?.subtotal < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
152
+ borderColor={theme.colors.primary}
153
+ isDisabled={checkoutButtonDisabled}
154
+ />
155
+ )}
153
156
  </PriceContainer>
154
157
  )}
155
158
 
@@ -7,9 +7,10 @@ export const BIContainer = styled.View`
7
7
  opacity: 1;
8
8
  border-radius: 7.6px;
9
9
  overflow: hidden;
10
-
10
+ min-height: 120px;
11
11
  ${(props: any) => props.isClosed && css`
12
- opacity: 0.5;
12
+ opacity: 0.5;
13
+ min-height: 60px;
13
14
  `}
14
15
  `
15
16
 
@@ -155,6 +155,10 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
155
155
  const handleTouchDrag = useCallback(() => {
156
156
  setCategoryClicked(false);
157
157
  }, []);
158
+
159
+ const handleBackNavigation = () => {
160
+ navigation?.canGoBack() ? navigation.goBack() : navigation.navigate('BottomTab')
161
+ }
158
162
 
159
163
  return (
160
164
  <SafeAreaView
@@ -169,7 +173,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
169
173
  imgLeftSrc={theme.images.general.arrow_left}
170
174
  imgRightSrc={null}
171
175
  style={styles.btnBackArrow}
172
- onClick={() => navigation?.canGoBack() && navigation.goBack()}
176
+ onClick={() => handleBackNavigation()}
173
177
  imgLeftStyle={{ tintColor: theme.colors.textNormal, width: 16 }}
174
178
  />
175
179
  </View>
@@ -231,7 +235,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
231
235
  selectedCategoryId={selectedCategoryId}
232
236
  lazyLoadProductsRecommended={business?.lazy_load_products_recommended}
233
237
  setSelectedCategoryId={setSelectedCategoryId}
234
- setCategoryClicked={setCategoryClicked}
238
+ setCategoryClicked={setCategoryClicked}
235
239
  />
236
240
  )}
237
241
  </>
@@ -309,13 +313,13 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
309
313
  business={currentCart?.business}
310
314
  cartProducts={currentCart?.products}
311
315
  cart={currentCart}
312
- setOpenUpselling={setOpenUpselling}
316
+ setOpenUpselling={setOpenUpselling}
313
317
  handleUpsellingPage={handleUpsellingPage}
314
318
  handleCloseUpsellingPage={handleCloseUpsellingPage}
315
319
  openUpselling={openUpselling}
316
320
  canOpenUpselling={canOpenUpselling}
317
321
  setCanOpenUpselling={setCanOpenUpselling}
318
- onRedirect={onRedirect}
322
+ onRedirect={onRedirect}
319
323
  />
320
324
  )}
321
325
  </SafeAreaView>
@@ -7,6 +7,7 @@ import {
7
7
  ScrollView,
8
8
  Platform,
9
9
  TouchableOpacity,
10
+ RefreshControl
10
11
  } from 'react-native';
11
12
  import {
12
13
  BusinessList as BusinessesListingController,
@@ -57,11 +58,12 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
57
58
  handleBusinessClick,
58
59
  paginationProps,
59
60
  handleChangeSearch,
60
- businessId
61
+ businessId
61
62
  } = props;
62
63
 
63
64
  const theme = useTheme();
64
65
  const isFocused = useIsFocused();
66
+ const [refreshing] = useState(false);
65
67
 
66
68
  const styles = StyleSheet.create({
67
69
  container: {
@@ -142,15 +144,15 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
142
144
  };
143
145
 
144
146
  const getDistance = (lat1: any, lon1: any, lat2: any, lon2: any) => {
145
- const R = 6371 // km
146
- const dLat = convertToRadian(lat2 - lat1)
147
- const dLon = convertToRadian(lon2 - lon1)
148
- const curLat1 = convertToRadian(lat1)
149
- const curLat2 = convertToRadian(lat2)
150
- const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(curLat1) * Math.cos(curLat2)
151
- const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
152
- return R * c
153
- }
147
+ const R = 6371 // km
148
+ const dLat = convertToRadian(lat2 - lat1)
149
+ const dLon = convertToRadian(lon2 - lon1)
150
+ const curLat1 = convertToRadian(lat1)
151
+ const curLat2 = convertToRadian(lat2)
152
+ const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(curLat1) * Math.cos(curLat2)
153
+ const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
154
+ return R * c
155
+ }
154
156
 
155
157
  useEffect(() => {
156
158
  if (businessesList.businesses.length > 0) {
@@ -162,6 +164,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
162
164
  setFeaturedBusinesses(ary);
163
165
  }
164
166
  }, [businessesList.businesses]);
167
+
165
168
  // const resetInactivityTimeout = () => {
166
169
  // clearTimeout(timerId.current)
167
170
  // timerId.current = setInterval(() => {
@@ -173,21 +176,37 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
173
176
  // resetInactivityTimeout()
174
177
  // }, [])
175
178
 
179
+ const handleOnRefresh = () => {
180
+ const hasMore = !(
181
+ paginationProps.totalPages === paginationProps.currentPage
182
+ );
183
+ if (!businessesList.loading && hasMore) {
184
+ getBusinesses();
185
+ }
186
+ }
187
+
176
188
  useEffect(() => {
177
189
  Geolocation.getCurrentPosition((pos) => {
178
- const crd = pos.coords
179
- const distance = getDistance(crd.latitude, crd.longitude, orderState?.options?.address?.location?.lat, orderState?.options?.address?.location?.lng)
180
- if (distance > 20) setIsFarAway(true)
190
+ const crd = pos.coords
191
+ const distance = getDistance(crd.latitude, crd.longitude, orderState?.options?.address?.location?.lat, orderState?.options?.address?.location?.lng)
192
+ if (distance > 20) setIsFarAway(true)
181
193
  else setIsFarAway(false)
182
- }, (err) => {
183
- console.log(`ERROR(${err.code}): ${err.message}`)
184
- }, {
185
- enableHighAccuracy: true, timeout: 15000, maximumAge: 10000
186
- })
187
- }, [orderState?.options?.address?.location])
194
+ }, (err) => {
195
+ console.log(`ERROR(${err.code}): ${err.message}`)
196
+ }, {
197
+ enableHighAccuracy: true, timeout: 15000, maximumAge: 10000
198
+ })
199
+ }, [orderState?.options?.address?.location])
188
200
 
189
201
  return (
190
- <ScrollView style={styles.container} onScroll={(e) => handleScroll(e)} showsVerticalScrollIndicator={false}>
202
+ <ScrollView style={styles.container} onScroll={(e) => handleScroll(e)} showsVerticalScrollIndicator={false}
203
+ refreshControl={
204
+ <RefreshControl
205
+ refreshing={refreshing}
206
+ onRefresh={() => handleOnRefresh()}
207
+ />
208
+ }
209
+ >
191
210
  <HeaderWrapper
192
211
  source={theme.images.backgrounds.business_list_header}
193
212
  style={{ paddingTop: top + 20 }}>
@@ -257,72 +276,78 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
257
276
  />
258
277
  </WrapMomentOption>
259
278
 
260
- {!businessId && (
261
- <SearchBar
262
- onSearch={handleChangeSearch}
263
- searchValue={searchValue}
264
- lazyLoad
265
- isCancelXButtonShow={!!searchValue}
266
- borderStyle={styles.borderStyle}
267
- onCancel={() => handleChangeSearch('')}
268
- placeholder={t('SEARCH', 'Search')}
269
- height={26}
270
- inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
271
- />
272
- )}
279
+ {!businessId && (
280
+ <SearchBar
281
+ onSearch={handleChangeSearch}
282
+ searchValue={searchValue}
283
+ lazyLoad
284
+ isCancelXButtonShow={!!searchValue}
285
+ borderStyle={styles.borderStyle}
286
+ onCancel={() => handleChangeSearch('')}
287
+ placeholder={t('SEARCH', 'Search')}
288
+ height={26}
289
+ inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
290
+ />
291
+ )}
273
292
 
274
293
  </View>
275
294
  </OrderControlContainer>
276
295
  </HeaderWrapper>
277
- {isFocused && (
278
- <OrderProgressWrapper>
279
- <OrderProgress
280
- {...props}
281
- />
282
- </OrderProgressWrapper>
283
- )}
284
- {!businessId && !props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
285
- <FeaturedWrapper>
286
- <OText size={16} style={{ marginLeft: 40 }} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('FEATURED_BUSINESS', 'Featured business')}</OText>
287
- <ScrollView
288
- showsHorizontalScrollIndicator={false}
289
- nestedScrollEnabled
290
- horizontal contentContainerStyle={{ paddingHorizontal: 40 }}>
291
- {featuredBusiness.map((bAry: any, idx) => (
292
- <View key={'f-listing_' + idx}>
293
- <BusinessFeaturedController
294
- key={bAry[0].id}
295
- business={bAry[0]}
296
- handleCustomClick={handleBusinessClick}
297
- orderType={orderState?.options?.type}
298
- />
299
- {bAry.length > 1 && (
296
+ {
297
+ isFocused && (
298
+ <OrderProgressWrapper>
299
+ <OrderProgress
300
+ {...props}
301
+ />
302
+ </OrderProgressWrapper>
303
+ )
304
+ }
305
+ {
306
+ !businessId && !props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
307
+ <FeaturedWrapper>
308
+ <OText size={16} style={{ marginLeft: 40 }} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('FEATURED_BUSINESS', 'Featured business')}</OText>
309
+ <ScrollView
310
+ showsHorizontalScrollIndicator={false}
311
+ nestedScrollEnabled
312
+ horizontal contentContainerStyle={{ paddingHorizontal: 40 }}>
313
+ {featuredBusiness.map((bAry: any, idx) => (
314
+ <View key={'f-listing_' + idx}>
300
315
  <BusinessFeaturedController
301
- key={bAry[1].id}
302
- business={bAry[1]}
316
+ key={bAry[0].id}
317
+ business={bAry[0]}
303
318
  handleCustomClick={handleBusinessClick}
304
319
  orderType={orderState?.options?.type}
305
320
  />
306
- )}
307
- </View>
308
- ))}
309
- </ScrollView>
310
- </FeaturedWrapper>
311
- )}
321
+ {bAry.length > 1 && (
322
+ <BusinessFeaturedController
323
+ key={bAry[1].id}
324
+ business={bAry[1]}
325
+ handleCustomClick={handleBusinessClick}
326
+ orderType={orderState?.options?.type}
327
+ />
328
+ )}
329
+ </View>
330
+ ))}
331
+ </ScrollView>
332
+ </FeaturedWrapper>
333
+ )
334
+ }
312
335
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
313
- {!businessId && !props.franchiseId && (
314
- <HighestRatedBusinesses onBusinessClick={handleBusinessClick} navigation={navigation} />
315
- )}
336
+ {
337
+ !businessId && !props.franchiseId && (
338
+ <HighestRatedBusinesses onBusinessClick={handleBusinessClick} navigation={navigation} />
339
+ )
340
+ }
316
341
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
317
342
  <ListWrapper>
318
- {!businessId && (
319
- <BusinessTypeFilter
320
- images={props.images}
321
- businessTypes={props.businessTypes}
322
- defaultBusinessType={props.defaultBusinessType}
323
- handleChangeBusinessType={handleChangeBusinessType}
324
- />
325
- )}
343
+ {!businessId && (
344
+ <BusinessTypeFilter
345
+ images={props.images}
346
+ businessTypes={props.businessTypes}
347
+ defaultBusinessType={props.defaultBusinessType}
348
+ handleChangeBusinessType={handleChangeBusinessType}
349
+ />
350
+ )}
326
351
  {!businessesList.loading && businessesList.businesses.length === 0 && (
327
352
  <NotFoundSource
328
353
  content={t(