ordering-ui-react-native 0.16.50 → 0.16.53

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 (28) hide show
  1. package/package.json +1 -1
  2. package/src/components/ReviewProducts/index.tsx +11 -0
  3. package/src/components/SingleProductReview/index.tsx +1 -1
  4. package/themes/original/index.tsx +6 -0
  5. package/themes/original/src/components/BusinessBasicInformation/index.tsx +197 -142
  6. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +2 -2
  7. package/themes/original/src/components/BusinessProductsListing/index.tsx +34 -8
  8. package/themes/original/src/components/BusinessProductsListing/styles.tsx +5 -0
  9. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +9 -1
  10. package/themes/original/src/components/BusinessesListing/Layout/Appointment/styles.tsx +3 -2
  11. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +238 -94
  12. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +46 -2
  13. package/themes/original/src/components/BusinessesListing/index.tsx +98 -23
  14. package/themes/original/src/components/GoogleMap/index.tsx +10 -11
  15. package/themes/original/src/components/Reviews/ReviewDriver/index.tsx +301 -0
  16. package/themes/original/src/components/Reviews/ReviewDriver/styles.tsx +39 -0
  17. package/themes/original/src/components/Reviews/ReviewOrder/index.tsx +326 -0
  18. package/themes/original/src/components/Reviews/ReviewOrder/styles.tsx +53 -0
  19. package/themes/original/src/components/Reviews/ReviewProducts/index.tsx +101 -0
  20. package/themes/original/src/components/Reviews/ReviewProducts/styles.tsx +17 -0
  21. package/themes/original/src/components/Reviews/index.tsx +9 -0
  22. package/themes/original/src/components/ServiceForm/index.tsx +15 -5
  23. package/themes/original/src/components/SignupForm/index.tsx +26 -24
  24. package/themes/original/src/components/SingleProductCard/index.tsx +113 -103
  25. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -2
  26. package/themes/original/src/components/shared/OBottomPopup.tsx +26 -7
  27. package/themes/original/src/components/shared/OButton.tsx +2 -0
  28. package/themes/original/src/types/index.tsx +19 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.16.50",
3
+ "version": "0.16.53",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -61,6 +61,17 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
61
61
  }
62
62
  }, [formState])
63
63
 
64
+ useEffect(() => {
65
+ const _changes = order?.products.map(product => {
66
+ return {
67
+ product_id: product?.product_id,
68
+ comment: '',
69
+ qualification: 5
70
+ }
71
+ })
72
+ handleChangeFormState(_changes)
73
+ }, [])
74
+
64
75
  return (
65
76
  <>
66
77
  <ReviewProductsContainer>
@@ -69,7 +69,7 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
69
69
  }
70
70
 
71
71
  useEffect(() => {
72
- if (comments?.length === 0 && !extraComment && formState.changes?.length === 0 && qualification === 5) return
72
+ if (comments?.length === 0 && !extraComment) return
73
73
  let _comments = ''
74
74
  if (comments.length > 0) {
75
75
  comments.map(comment => (_comments += comment.content + '. '))
@@ -29,6 +29,9 @@ import { UserProfileForm } from './src/components/UserProfileForm';
29
29
  import { ReviewOrder } from './src/components/ReviewOrder';
30
30
  import { ReviewProducts } from './src/components/ReviewProducts';
31
31
  import { ReviewDriver } from './src/components/ReviewDriver';
32
+ import { ReviewOrder as ReviewOrderModal } from './src/components/Reviews/ReviewOrder';
33
+ import { ReviewProducts as ReviewProductsModal } from './src/components/Reviews/ReviewProducts';
34
+ import { ReviewDriver as ReviewDriverModal } from './src/components/Reviews/ReviewDriver';
32
35
  import { UserProfile } from './src/components/UserProfile';
33
36
  import { MessageListing } from './src/components/MessageListing';
34
37
  import { Messages } from './src/components/Messages';
@@ -186,6 +189,9 @@ export {
186
189
  ReviewOrder,
187
190
  ReviewProducts,
188
191
  ReviewDriver,
192
+ ReviewOrderModal,
193
+ ReviewProductsModal,
194
+ ReviewDriverModal,
189
195
  BusinessMenuList,
190
196
  UserProfile,
191
197
  MessageListing,
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { StyleSheet, View, TouchableOpacity, Linking } from 'react-native';
3
- import { useUtils, useOrder, useLanguage } from 'ordering-components/native';
3
+ import { useUtils, useOrder, useLanguage, useOrderingTheme } from 'ordering-components/native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import { OIcon, OText, OModal } from '../shared';
6
6
  import { BusinessBasicInformationParams } from '../../types';
@@ -38,6 +38,7 @@ export const BusinessBasicInformation = (
38
38
  const { business, loading } = businessState;
39
39
 
40
40
  const theme = useTheme();
41
+ const [orderingTheme] = useOrderingTheme()
41
42
  const [orderState] = useOrder();
42
43
  const [, t] = useLanguage();
43
44
  const [{ parsePrice, parseDistance, optimizeImage }] = useUtils();
@@ -45,13 +46,15 @@ export const BusinessBasicInformation = (
45
46
  const [openBusinessReviews, setOpenBusinessReviews] = useState(false);
46
47
  const [businessInformationObtained, setBusinessInformationObtained] = useState(false)
47
48
  const [businessReviewsObtained, setBusinessReviewsObtainedbtained] = useState(false)
48
-
49
+ const isChewLayout = theme?.layouts?.business_view?.components?.header?.components?.layout?.type === 'chew'
50
+ const showLogo = !orderingTheme?.theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
51
+
49
52
  const styles = StyleSheet.create({
50
53
  businesInfoheaderStyle: {
51
54
  height: 150,
52
55
  },
53
56
  headerStyle: {
54
- height: 260,
57
+ height: isChewLayout ? 170 : 260,
55
58
  },
56
59
  businessLogo: {
57
60
  width: 72,
@@ -62,7 +65,7 @@ export const BusinessBasicInformation = (
62
65
  },
63
66
  businessInfo: {
64
67
  paddingHorizontal: 40,
65
- paddingTop: 56,
68
+ paddingTop: isChewLayout ? 0 : 56,
66
69
  },
67
70
  bullet: {
68
71
  flexDirection: 'row',
@@ -89,7 +92,7 @@ export const BusinessBasicInformation = (
89
92
  socialIcon: {
90
93
  borderRadius: 3,
91
94
  borderColor: theme.colors.border,
92
- borderWidth: 1,
95
+ borderWidth: isChewLayout ? 0 : 1,
93
96
  width: 20,
94
97
  height: 20,
95
98
  justifyContent: 'center',
@@ -102,6 +105,16 @@ export const BusinessBasicInformation = (
102
105
  width: 12,
103
106
  margin: 0,
104
107
  padding: 0
108
+ },
109
+ headerChewStyle: {
110
+ paddingHorizontal: 30,
111
+ justifyContent: 'center',
112
+ height: '100%'
113
+ },
114
+ socialIconsChewContainer: {
115
+ flexDirection: 'row',
116
+ justifyContent: 'flex-start',
117
+ marginTop: 5
105
118
  }
106
119
  });
107
120
 
@@ -135,14 +148,14 @@ export const BusinessBasicInformation = (
135
148
  };
136
149
 
137
150
  const SocialNetWork = (props: any) => {
138
- const { socialLink, iconTitle} = props
151
+ const { socialLink, iconTitle } = props
139
152
 
140
153
  return (
141
154
  <TouchableOpacity style={styles.socialIcon} onPress={() => Linking.openURL(socialLink)}>
142
155
  <MaterialComIcon
143
156
  name={iconTitle}
144
- color={theme.colors.textNormal}
145
- size={14}
157
+ color={isChewLayout ? theme.colors.black : theme.colors.textNormal}
158
+ size={isChewLayout ? 18 : 14}
146
159
  />
147
160
  </TouchableOpacity>
148
161
  )
@@ -172,85 +185,9 @@ export const BusinessBasicInformation = (
172
185
  }
173
186
  }, [businessState?.business])
174
187
 
175
- return (
176
- <BusinessContainer>
177
- <BusinessHeader
178
- style={
179
- isBusinessInfoShow
180
- ? styles.businesInfoheaderStyle
181
- : { ...styles.headerStyle, backgroundColor: theme.colors.backgroundGray }
182
- }
183
- source={{
184
- uri:
185
- header ||
186
- optimizeImage(businessState?.business?.header, 'h_250,c_limit'),
187
- }}>
188
- {!isBusinessInfoShow && (
189
- <WrapBusinessInfo onPress={() => handleClickBusinessInformation()}>
190
- <OIcon src={theme.images.general.info} width={24} />
191
- </WrapBusinessInfo>
192
- )}
193
- </BusinessHeader>
194
- <BusinessInfo style={styles.businessInfo}>
195
- <BusinessLogo>
196
- {loading ? (
197
- <View>
198
- <Placeholder Animation={Fade}>
199
- <PlaceholderLine height={50} width={20} />
200
- </Placeholder>
201
- </View>
202
- ) : (
203
- !isBusinessInfoShow && (
204
- <OIcon
205
- url={
206
- logo ||
207
- optimizeImage(businessState?.business?.logo, 'h_70,c_limit')
208
- }
209
- style={styles.businessLogo}
210
- />
211
- )
212
- )}
213
- </BusinessLogo>
214
- <BusinessInfoItem>
215
- {loading ? (
216
- <Placeholder Animation={Fade}>
217
- <PlaceholderLine height={30} width={20} />
218
- </Placeholder>
219
- ) : (
220
- <TitleWrapper>
221
- <OText size={24} weight={'600'}>
222
- {business?.name}
223
- </OText>
224
- {business?.ribbon?.enabled && (
225
- <RibbonBox
226
- bgColor={business?.ribbon?.color}
227
- isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
228
- isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
229
- >
230
- <OText
231
- size={10}
232
- weight={'400'}
233
- color={theme.colors.white}
234
- numberOfLines={2}
235
- ellipsizeMode='tail'
236
- lineHeight={13}
237
- >
238
- {business?.ribbon?.text}
239
- </OText>
240
- </RibbonBox>
241
- )}
242
- </TitleWrapper>
243
- )}
244
- </BusinessInfoItem>
245
- {loading ? (
246
- <Placeholder Animation={Fade}>
247
- <PlaceholderLine width={10} />
248
- </Placeholder>
249
- ) : (
250
- <View style={{ width: '75%' }}>
251
- <OText color={theme.colors.textNormal}>{getBusinessType()}</OText>
252
- </View>
253
- )}
188
+ const SocialIcons = () => {
189
+ return (
190
+ <>
254
191
  {loading ? (
255
192
  <Placeholder Animation={Fade}>
256
193
  <View style={{ flexDirection: 'row' }}>
@@ -266,7 +203,7 @@ export const BusinessBasicInformation = (
266
203
  showsVerticalScrollIndicator={false}
267
204
  showsHorizontalScrollIndicator={false}
268
205
  horizontal
269
- contentContainerStyle={{ flex: 1}}
206
+ contentContainerStyle={{ flex: 1 }}
270
207
  >
271
208
  {!!business?.facebook_profile && (
272
209
  <SocialNetWork
@@ -285,7 +222,7 @@ export const BusinessBasicInformation = (
285
222
  <View style={styles.tiktokIcon}>
286
223
  <OIcon
287
224
  src={theme.images.general.tiktok}
288
- style={{ width: '100%', height: '100%'}}
225
+ style={{ width: '100%', height: '100%' }}
289
226
  />
290
227
  </View>
291
228
  </TouchableOpacity>
@@ -308,72 +245,190 @@ export const BusinessBasicInformation = (
308
245
  iconTitle='snapchat'
309
246
  />
310
247
  )}
248
+ {isChewLayout && (
249
+ <TouchableOpacity onPress={() => handleClickBusinessInformation()}>
250
+ <OText style={{textDecorationColor: theme.colors.black, textDecorationLine: 'underline'}}>
251
+ {t('SEE_MORE_DESCRIPTION', 'See more')}
252
+ </OText>
253
+ </TouchableOpacity>
254
+ )}
311
255
  </SocialListWrapper>
312
256
  )}
313
- <View>
314
- <BusinessInfoItem>
315
- {loading && (
316
- <Placeholder Animation={Fade}>
317
- <View style={{ flexDirection: 'row' }}>
318
- <PlaceholderLine width={13} style={{ marginRight: 10 }} />
319
- <PlaceholderLine width={13} style={{ marginRight: 10 }} />
320
- <PlaceholderLine width={13} style={{ marginRight: 10 }} />
321
- <PlaceholderLine width={13} />
322
- </View>
323
- </Placeholder>
324
- )}
325
- <View style={styles.bullet}>
326
- <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
327
- {`${t('DELIVERY_FEE', 'Delivery fee')} ${business && parsePrice(business?.delivery_price || 0)} \u2022 `}
257
+ </>
258
+ )
259
+ }
260
+
261
+ return (
262
+ <BusinessContainer isChewLayout={isChewLayout && !showLogo}>
263
+ <BusinessHeader
264
+ isChewLayout={isChewLayout}
265
+ style={
266
+ isBusinessInfoShow
267
+ ? styles.businesInfoheaderStyle
268
+ : { ...styles.headerStyle, backgroundColor: theme.colors.backgroundGray }
269
+ }
270
+ source={{
271
+ uri:
272
+ header ||
273
+ optimizeImage(businessState?.business?.header, 'h_250,c_limit'),
274
+ }}
275
+ imageStyle={{ opacity: isChewLayout ? 0.5 : 1 }}
276
+ >
277
+ {!isBusinessInfoShow && !isChewLayout && (
278
+ <WrapBusinessInfo onPress={() => handleClickBusinessInformation()}>
279
+ <OIcon src={theme.images.general.info} width={24} />
280
+ </WrapBusinessInfo>
281
+ )}
282
+ {isChewLayout && (
283
+ <View style={styles.headerChewStyle}>
284
+ <OText size={24} weight={'600'} mBottom={-5}>
285
+ {business?.name}
286
+ </OText>
287
+ {business?.city?.name && (
288
+ <OText>
289
+ {business?.city?.name}
328
290
  </OText>
329
- {orderState?.options?.type === 1 ? (
330
- <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
331
- {convertHoursToMinutes(business?.delivery_time) + ` \u2022 `}
332
- </OText>
291
+ )}
292
+ <View style={styles.socialIconsChewContainer}>
293
+ <SocialIcons />
294
+ </View>
295
+ </View>
296
+ )}
297
+ </BusinessHeader>
298
+ <BusinessInfo style={styles.businessInfo}>
299
+ {showLogo && (
300
+ <BusinessLogo isChewLayout={isChewLayout}>
301
+ {loading ? (
302
+ <View>
303
+ <Placeholder Animation={Fade}>
304
+ <PlaceholderLine height={50} width={20} />
305
+ </Placeholder>
306
+ </View>
307
+ ) : (
308
+ !isBusinessInfoShow && (
309
+ <OIcon
310
+ url={
311
+ logo ||
312
+ optimizeImage(businessState?.business?.logo, 'h_70,c_limit')
313
+ }
314
+ style={styles.businessLogo}
315
+ />
316
+ )
317
+ )}
318
+ </BusinessLogo>
319
+ )}
320
+ {!isChewLayout && (
321
+
322
+ <>
323
+ <BusinessInfoItem>
324
+ {loading ? (
325
+ <Placeholder Animation={Fade}>
326
+ <PlaceholderLine height={30} width={20} />
327
+ </Placeholder>
333
328
  ) : (
334
- <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
335
- {convertHoursToMinutes(business?.pickup_time) + ` \u2022 `}
336
- </OText>
329
+ <TitleWrapper>
330
+ <OText size={24} weight={'600'}>
331
+ {business?.name}
332
+ </OText>
333
+ {business?.ribbon?.enabled && (
334
+ <RibbonBox
335
+ bgColor={business?.ribbon?.color}
336
+ isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
337
+ isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
338
+ >
339
+ <OText
340
+ size={10}
341
+ weight={'400'}
342
+ color={theme.colors.white}
343
+ numberOfLines={2}
344
+ ellipsizeMode='tail'
345
+ lineHeight={13}
346
+ >
347
+ {business?.ribbon?.text}
348
+ </OText>
349
+ </RibbonBox>
350
+ )}
351
+ </TitleWrapper>
337
352
  )}
338
- <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
339
- {parseDistance(business?.distance || 0) + ` \u2022 `}
340
- </OText>
341
- </View>
353
+ </BusinessInfoItem>
354
+ {loading ? (
355
+ <Placeholder Animation={Fade}>
356
+ <PlaceholderLine width={10} />
357
+ </Placeholder>
358
+ ) : (
359
+ <View style={{ width: '75%' }}>
360
+ <OText color={theme.colors.textNormal}>{getBusinessType()}</OText>
361
+ </View>
362
+ )}
363
+ {!isChewLayout && (
364
+ <SocialIcons />
365
+ )}
366
+ <View>
367
+ <BusinessInfoItem>
368
+ {loading && (
369
+ <Placeholder Animation={Fade}>
370
+ <View style={{ flexDirection: 'row' }}>
371
+ <PlaceholderLine width={13} style={{ marginRight: 10 }} />
372
+ <PlaceholderLine width={13} style={{ marginRight: 10 }} />
373
+ <PlaceholderLine width={13} style={{ marginRight: 10 }} />
374
+ <PlaceholderLine width={13} />
375
+ </View>
376
+ </Placeholder>
377
+ )}
378
+ <View style={styles.bullet}>
379
+ <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
380
+ {`${t('DELIVERY_FEE', 'Delivery fee')} ${business && parsePrice(business?.delivery_price || 0)} \u2022 `}
381
+ </OText>
382
+ {orderState?.options?.type === 1 ? (
383
+ <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
384
+ {convertHoursToMinutes(business?.delivery_time) + ` \u2022 `}
385
+ </OText>
386
+ ) : (
387
+ <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
388
+ {convertHoursToMinutes(business?.pickup_time) + ` \u2022 `}
389
+ </OText>
390
+ )}
391
+ <OText color={theme.colors.textSecondary} size={12} style={styles.metadata}>
392
+ {parseDistance(business?.distance || 0) + ` \u2022 `}
393
+ </OText>
394
+ </View>
342
395
 
343
- <View style={styles.reviewStyle}>
344
- <OIcon
345
- src={theme.images.general.star}
346
- width={14}
347
- color={theme.colors.textSecondary}
348
- style={{ marginTop: -2, marginEnd: 2 }}
349
- />
350
- <OText size={12} color={theme.colors.textSecondary}>
351
- {business?.reviews?.total}
352
- </OText>
396
+ <View style={styles.reviewStyle}>
397
+ <OIcon
398
+ src={theme.images.general.star}
399
+ width={14}
400
+ color={theme.colors.textSecondary}
401
+ style={{ marginTop: -2, marginEnd: 2 }}
402
+ />
403
+ <OText size={12} color={theme.colors.textSecondary}>
404
+ {business?.reviews?.total}
405
+ </OText>
406
+ </View>
407
+ </BusinessInfoItem>
353
408
  </View>
354
- </BusinessInfoItem>
355
- </View>
356
- <WrapReviews>
357
- {!isBusinessInfoShow && (
358
- <>
359
- {isPreOrder && (!business?.professionals || business?.professionals?.length === 0) && (
409
+ <WrapReviews>
410
+ {!isBusinessInfoShow && (
360
411
  <>
361
- <TouchableOpacity onPress={() => navigation.navigate('BusinessPreorder', { business: businessState?.business, handleBusinessClick: () => navigation?.goBack() })}>
412
+ {isPreOrder && (!business?.professionals || business?.professionals?.length === 0) && (
413
+ <>
414
+ <TouchableOpacity onPress={() => navigation.navigate('BusinessPreorder', { business: businessState?.business, handleBusinessClick: () => navigation?.goBack() })}>
415
+ <OText color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>
416
+ {t('PRE_ORDER', 'Preorder')}
417
+ </OText>
418
+ </TouchableOpacity>
419
+ <OText size={12} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
420
+ </>
421
+ )}
422
+ <TouchableOpacity onPress={() => handleClickBusinessReviews()}>
362
423
  <OText color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>
363
- {t('PRE_ORDER', 'Preorder')}
424
+ {t('REVIEWS', 'Reviews')}
364
425
  </OText>
365
426
  </TouchableOpacity>
366
- <OText size={12} color={theme.colors.textSecondary}>{' \u2022 '}</OText>
367
427
  </>
368
428
  )}
369
- <TouchableOpacity onPress={() => handleClickBusinessReviews()}>
370
- <OText color={theme.colors.textSecondary} style={{ textDecorationLine: 'underline' }}>
371
- {t('REVIEWS', 'Reviews')}
372
- </OText>
373
- </TouchableOpacity>
374
- </>
375
- )}
376
- </WrapReviews>
429
+ </WrapReviews>
430
+ </>
431
+ )}
377
432
  </BusinessInfo>
378
433
  {businessInformationObtained ? (
379
434
  <OModal
@@ -3,7 +3,7 @@ import { Platform } from 'react-native';
3
3
 
4
4
  export const BusinessContainer = styled.View`
5
5
  flex-direction: column;
6
- padding-bottom: 35px;
6
+ padding-bottom: ${(props: any) => props.isChewLayout ? '0' : '35px'};
7
7
  `;
8
8
  export const BusinessHeader = styled.ImageBackground`
9
9
  width: 100%;
@@ -20,7 +20,7 @@ export const BusinessLogo = styled.View`
20
20
  box-shadow: 0 0 2px ${Platform.OS == 'android' ? '#000000DD' : '#0000001A'};
21
21
  elevation: 2;
22
22
  background-color: white;
23
- border-radius: 7.6px;
23
+ border-radius: 7.6px;
24
24
  `;
25
25
  export const BusinessInfo = styled.View`
26
26
  justify-content: flex-start;
@@ -1,6 +1,5 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from 'react'
2
2
  import { View, TouchableOpacity, StyleSheet, SafeAreaView, Dimensions, Platform, KeyboardAvoidingViewBase, KeyboardAvoidingView } from 'react-native'
3
- import { IOScrollView } from 'react-native-intersection-observer'
4
3
  import { useTheme } from 'styled-components/native';
5
4
  import {
6
5
  BusinessAndProductList,
@@ -10,7 +9,8 @@ import {
10
9
  useUtils,
11
10
  ToastType,
12
11
  useToast,
13
- useConfig
12
+ useConfig,
13
+ useOrderingTheme
14
14
  } from 'ordering-components/native'
15
15
  import { OButton, OIcon, OModal, OText } from '../shared'
16
16
  import Alert from '../../providers/AlertProvider'
@@ -28,13 +28,15 @@ import {
28
28
  FiltProductsContainer,
29
29
  ContainerSafeAreaView,
30
30
  BackgroundGray,
31
- ProfessionalFilterWrapper
31
+ ProfessionalFilterWrapper,
32
+ NearBusiness
32
33
  } from './styles'
33
34
  import { FloatingButton } from '../FloatingButton'
34
35
  import { UpsellingRedirect } from './UpsellingRedirect'
35
36
  import Animated from 'react-native-reanimated'
36
37
  import { ProfessionalFilter } from '../ProfessionalFilter';
37
38
  import { ServiceForm } from '../ServiceForm';
39
+ import { BusinessesListing } from '../BusinessesListing/Layout/Original'
38
40
 
39
41
  const PIXELS_TO_SCROLL = 2000
40
42
 
@@ -59,10 +61,12 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
59
61
  getNextProducts,
60
62
  handleUpdateProducts,
61
63
  professionalSelected,
62
- handleChangeProfessionalSelected
64
+ handleChangeProfessionalSelected,
65
+ onBusinessClick
63
66
  } = props
64
67
 
65
68
  const theme = useTheme();
69
+ const [orderingTheme] = useOrderingTheme()
66
70
  const [, t] = useLanguage()
67
71
  const [{ auth }] = useSession()
68
72
  const [orderState, { clearCart }] = useOrder()
@@ -70,6 +74,11 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
70
74
  const [, { showToast }] = useToast()
71
75
  const [{ configs }] = useConfig()
72
76
  const isPreOrder = configs?.preorder_status_enabled?.value === '1'
77
+
78
+ const isChewLayout = theme?.layouts?.business_view?.components?.header?.components?.layout?.type === 'chew'
79
+ const showLogo = !orderingTheme?.theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
80
+ const showBusinessNearCity = !theme?.layouts?.business_view?.components?.near_business?.hidden
81
+
73
82
  const styles = StyleSheet.create({
74
83
  mainContainer: {
75
84
  flex: 1,
@@ -240,6 +249,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
240
249
  onClick={() => handleBackNavigation()}
241
250
  imgLeftStyle={{ tintColor: theme.colors.textNormal, width: 30 }}
242
251
  />
252
+
243
253
  </View>
244
254
  {!errorQuantityProducts && (
245
255
  <View style={{ ...styles.headerItem }}>
@@ -267,6 +277,17 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
267
277
  </WrapSearchBar>
268
278
  )}
269
279
  </TopHeader>
280
+ {showBusinessNearCity && (
281
+ <NearBusiness>
282
+ <BusinessesListing
283
+ logosLayout
284
+ propsToFetch={['id', 'logo', 'location', 'timezone', 'schedule', 'open', 'slug']}
285
+ cityId={businessState?.business?.city_id}
286
+ onBusinessClick={onBusinessClick}
287
+ actualSlug={businessState?.business?.slug}
288
+ />
289
+ </NearBusiness>
290
+ )}
270
291
  </Animated.View>
271
292
 
272
293
  {business?.categories?.length > 0 && isOpenFiltProducts && (
@@ -343,7 +364,13 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
343
364
  />
344
365
  </ProfessionalFilterWrapper>
345
366
  )}
346
- <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
367
+ <View
368
+ style={{
369
+ height: 8,
370
+ backgroundColor: theme.colors.backgroundGray100,
371
+ marginTop: isChewLayout && showLogo ? 10 : 0
372
+ }}
373
+ />
347
374
  {!loading && business?.id && (
348
375
  <>
349
376
  {!(business?.categories?.length === 0) && (
@@ -366,7 +393,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
366
393
  </>
367
394
  )}
368
395
  {!loading && business?.id && (
369
- <IOScrollView rootMargin={{ top: 0, bottom: 0 }}>
396
+ <>
370
397
  <WrapContent
371
398
  onLayout={(event: any) => setProductListLayout(event.nativeEvent.layout)}
372
399
  >
@@ -397,7 +424,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
397
424
  handleUpdateProducts={handleUpdateProducts}
398
425
  />
399
426
  </WrapContent>
400
- </IOScrollView>
427
+ </>
401
428
  )}
402
429
  {loading && !error && (
403
430
  <>
@@ -422,7 +449,6 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
422
449
  </>
423
450
  )}
424
451
  </BusinessProductsListingContainer>
425
-
426
452
  {!loading && auth && currentCart?.products?.length > 0 && categoryState.products.length !== 0 && (
427
453
  <FloatingButton
428
454
  btnText={
@@ -60,3 +60,8 @@ export const ProfessionalFilterWrapper = styled.View`
60
60
  padding-left: 40px;
61
61
  margin-bottom: 35px;
62
62
  `
63
+
64
+ export const NearBusiness = styled.View`
65
+ width: 100%;
66
+ padding-left: 20px;
67
+ `
@@ -320,7 +320,15 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
320
320
  </MomentWrapper>
321
321
  <View style={styles.wrapperOrderOptions}>
322
322
  <WrapMomentOption onPress={() => navigation.navigate('OrderTypes', { configTypes: configTypes, setOrderTypeValue })}>
323
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textSecondary}>{t(getTypesText(orderTypeValue || orderState?.options?.type || 1), 'Delivery')}</OText>
323
+ <OText
324
+ size={12}
325
+ numberOfLines={1}
326
+ ellipsizeMode={'tail'}
327
+ color={theme.colors.textSecondary}
328
+ style={{ textAlign: 'left' }}
329
+ >
330
+ {t(getTypesText(orderTypeValue || orderState?.options?.type || 1), 'Delivery')}
331
+ </OText>
324
332
  <OIcon
325
333
  src={theme.images.general.arrow_down}
326
334
  width={10}
@@ -43,8 +43,9 @@ export const WrapMomentOption = styled.TouchableOpacity`
43
43
  font-size: 12px;
44
44
  max-width: 240px;
45
45
  height: 26px;
46
+ width: 130px;
46
47
  align-items: center;
47
- justify-content: center;
48
+ justify-content: space-between;
48
49
  padding-horizontal: 8px;
49
50
  flex-direction: row;
50
51
  margin-end: 12px;
@@ -84,7 +85,7 @@ export const FarAwayMessage = styled.View`
84
85
  `
85
86
 
86
87
  export const SearchBarWrapper = styled.View`
87
- width: 100px;
88
+ width: 130px;
88
89
  `
89
90
 
90
91
  export const MomentWrapper = styled.View`