ordering-ui-react-native 0.22.46 → 0.22.47-crash-driver-2
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.
- package/package.json +1 -1
- package/themes/business/src/components/DriverMap/index.tsx +6 -6
- package/themes/business/src/components/MapView/index.tsx +13 -5
- package/themes/original/src/components/ProductForm/index.tsx +107 -102
- package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +2 -1
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
package/package.json
CHANGED
|
@@ -378,8 +378,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
378
378
|
<>
|
|
379
379
|
<Marker
|
|
380
380
|
coordinate={{
|
|
381
|
-
latitude: destination
|
|
382
|
-
longitude: destination
|
|
381
|
+
latitude: typeof destination?.latitude !== 'object' ? destination?.latitude : 0,
|
|
382
|
+
longitude: typeof destination?.longitude !== 'object' ? destination?.latitude : 0
|
|
383
383
|
}}
|
|
384
384
|
title={location.title}>
|
|
385
385
|
<Icon
|
|
@@ -397,8 +397,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
397
397
|
</View>
|
|
398
398
|
</Marker>
|
|
399
399
|
<Marker coordinate={{
|
|
400
|
-
latitude: parsedUserLocation
|
|
401
|
-
longitude: parsedUserLocation
|
|
400
|
+
latitude: typeof parsedUserLocation?.latitude !== 'object' ? parsedUserLocation?.latitude : 0,
|
|
401
|
+
longitude: typeof parsedUserLocation?.longitude !== 'object' ? parsedUserLocation?.latitude : 0
|
|
402
402
|
}}>
|
|
403
403
|
<View style={styles.driverIcon}>
|
|
404
404
|
<OIcon
|
|
@@ -413,8 +413,8 @@ export const DriverMap = (props: GoogleMapsParams) => {
|
|
|
413
413
|
) : (
|
|
414
414
|
<Marker
|
|
415
415
|
coordinate={{
|
|
416
|
-
latitude: parsedUserLocation
|
|
417
|
-
longitude: parsedUserLocation
|
|
416
|
+
latitude: typeof parsedUserLocation?.latitude !== 'object' ? parsedUserLocation?.latitude : 0,
|
|
417
|
+
longitude: typeof parsedUserLocation?.longitude !== 'object' ? parsedUserLocation?.latitude : 0
|
|
418
418
|
}}
|
|
419
419
|
title={markerTitle || t('YOUR_LOCATION', 'Your Location')}
|
|
420
420
|
/>
|
|
@@ -55,10 +55,13 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
55
55
|
if (mapRef.current) {
|
|
56
56
|
mapRef.current.fitToCoordinates(
|
|
57
57
|
[
|
|
58
|
-
{ latitude: location.latitude ?? 0, longitude: location.longitude ?? 0},
|
|
59
58
|
{
|
|
60
|
-
latitude:
|
|
61
|
-
longitude:
|
|
59
|
+
latitude: typeof location?.latitude !== 'object' ? location?.latitude : 0,
|
|
60
|
+
longitude: typeof location?.longitude !== 'object' ? location?.latitude : 0
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
latitude: typeof userLocation?.latitude !== 'object' ? userLocation?.latitude : 0,
|
|
64
|
+
longitude: typeof userLocation?.longitude !== 'object' ? userLocation?.latitude : 0
|
|
62
65
|
},
|
|
63
66
|
],
|
|
64
67
|
{
|
|
@@ -133,8 +136,8 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
133
136
|
const RenderMarker = ({ marker, customer, orderIds }: { marker: any, customer?: boolean, orderIds?: Array<number> }) => {
|
|
134
137
|
const markerRef = useRef<any>()
|
|
135
138
|
|
|
136
|
-
let coordinateLat = (customer ? marker?.customer?.location?.lat : marker?.business?.location?.lat) ?? initialPosition?.latitude
|
|
137
|
-
let coordinateLng = (customer ? marker?.customer?.location?.lng : marker?.business?.location?.lng) ?? initialPosition?.longitude
|
|
139
|
+
let coordinateLat = (customer ? marker?.customer?.location?.lat || 0 : marker?.business?.location?.lat || 0) ?? (initialPosition?.latitude || 0)
|
|
140
|
+
let coordinateLng = (customer ? marker?.customer?.location?.lng || 0 : marker?.business?.location?.lng || 0) ?? (initialPosition?.longitude || 0)
|
|
138
141
|
|
|
139
142
|
useEffect(() => {
|
|
140
143
|
if (
|
|
@@ -231,6 +234,11 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
231
234
|
return (
|
|
232
235
|
<SafeAreaView style={{ flex: 1 }}>
|
|
233
236
|
<View style={{ flex: 1 }}>
|
|
237
|
+
<View>
|
|
238
|
+
<OText>
|
|
239
|
+
{`Locations: lat: ${userLocation?.latitude}, lng: ${userLocation?.longitude}`}
|
|
240
|
+
</OText>
|
|
241
|
+
</View>
|
|
234
242
|
{!isLoadingBusinessMarkers && isFocused && (
|
|
235
243
|
<View style={{ flex: 1 }}>
|
|
236
244
|
<MapView
|
|
@@ -88,6 +88,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
88
88
|
const [events] = useEvent()
|
|
89
89
|
const commentRef = useRef()
|
|
90
90
|
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
91
|
+
const hideProductDummyLogo = theme?.business_view?.components?.products?.components?.product?.components?.dummy?.hidden
|
|
91
92
|
|
|
92
93
|
const styles = StyleSheet.create({
|
|
93
94
|
mainContainer: {
|
|
@@ -487,114 +488,118 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
487
488
|
</View>
|
|
488
489
|
) : (
|
|
489
490
|
<>
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
}
|
|
507
|
-
nextButton={
|
|
508
|
-
<View style={styles.swiperButton}>
|
|
509
|
-
<IconAntDesign
|
|
510
|
-
name="caretright"
|
|
511
|
-
color={theme.colors.white}
|
|
512
|
-
size={13}
|
|
513
|
-
// style={styles.starIcon}
|
|
514
|
-
/>
|
|
515
|
-
</View>
|
|
516
|
-
}
|
|
517
|
-
>
|
|
518
|
-
{gallery && gallery?.length > 0 && gallery.map((img : any, i: number) => (
|
|
519
|
-
<View
|
|
520
|
-
style={styles.slide1}
|
|
521
|
-
key={i}
|
|
522
|
-
>
|
|
523
|
-
{(String(img).includes('http') || typeof img === 'number') ? (
|
|
524
|
-
<FastImage
|
|
525
|
-
style={{ height: '100%', opacity: isSoldOut ? 0.5 : 1, aspectRatio: 16 / 9 }}
|
|
526
|
-
source={typeof img !== 'number' ? {
|
|
527
|
-
uri: optimizeImage(img, 'h_1024,c_limit'),
|
|
528
|
-
priority: FastImage.priority.normal,
|
|
529
|
-
} : img}
|
|
530
|
-
/>
|
|
531
|
-
) : (
|
|
532
|
-
<>
|
|
533
|
-
<YoutubePlayer
|
|
534
|
-
height={'100%'}
|
|
535
|
-
width={'100%'}
|
|
536
|
-
play={playing}
|
|
537
|
-
videoId={img}
|
|
538
|
-
onChangeState={onStateChange}
|
|
491
|
+
{(product?.images || !hideProductDummyLogo) && (
|
|
492
|
+
<>
|
|
493
|
+
<Swiper
|
|
494
|
+
loop={false}
|
|
495
|
+
ref={swiperRef}
|
|
496
|
+
showsButtons={true}
|
|
497
|
+
style={styles.mainSwiper}
|
|
498
|
+
showsPagination={false}
|
|
499
|
+
onIndexChanged={(index : any) => handleChangeMainIndex(index)}
|
|
500
|
+
prevButton={
|
|
501
|
+
<View style={styles.swiperButton}>
|
|
502
|
+
<IconAntDesign
|
|
503
|
+
name="caretleft"
|
|
504
|
+
color={theme.colors.white}
|
|
505
|
+
size={13}
|
|
506
|
+
// style={styles.starIcon}
|
|
539
507
|
/>
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
paddingHorizontal: 20,
|
|
550
|
-
paddingVertical: 15
|
|
551
|
-
}}
|
|
552
|
-
>
|
|
553
|
-
{gallery?.length > 1 && gallery.map((img: any, index: number) => (
|
|
554
|
-
<TouchableOpacity
|
|
555
|
-
key={index}
|
|
556
|
-
onPress={() => handleClickThumb(index)}
|
|
557
|
-
>
|
|
558
|
-
<View
|
|
559
|
-
style={{
|
|
560
|
-
height: 56,
|
|
561
|
-
borderRadius: 8,
|
|
562
|
-
margin: 8,
|
|
563
|
-
opacity: index === thumbsSwiper ? 1 : 0.8
|
|
564
|
-
}}
|
|
565
|
-
>
|
|
566
|
-
{String(img).includes('http') ? (
|
|
567
|
-
<OIcon
|
|
568
|
-
url={img}
|
|
569
|
-
style={{
|
|
570
|
-
borderColor: theme.colors.lightGray,
|
|
571
|
-
borderRadius: 8,
|
|
572
|
-
minHeight: '100%',
|
|
573
|
-
opacity: isSoldOut ? 0.5 : 1
|
|
574
|
-
}}
|
|
575
|
-
width={56}
|
|
576
|
-
height={56}
|
|
577
|
-
cover
|
|
508
|
+
</View>
|
|
509
|
+
}
|
|
510
|
+
nextButton={
|
|
511
|
+
<View style={styles.swiperButton}>
|
|
512
|
+
<IconAntDesign
|
|
513
|
+
name="caretright"
|
|
514
|
+
color={theme.colors.white}
|
|
515
|
+
size={13}
|
|
516
|
+
// style={styles.starIcon}
|
|
578
517
|
/>
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
518
|
+
</View>
|
|
519
|
+
}
|
|
520
|
+
>
|
|
521
|
+
{gallery && gallery?.length > 0 && gallery.map((img : any, i: number) => (
|
|
522
|
+
<View
|
|
523
|
+
style={styles.slide1}
|
|
524
|
+
key={i}
|
|
525
|
+
>
|
|
526
|
+
{(String(img).includes('http') || typeof img === 'number') ? (
|
|
527
|
+
<FastImage
|
|
528
|
+
style={{ height: '100%', opacity: isSoldOut ? 0.5 : 1, aspectRatio: 16 / 9 }}
|
|
529
|
+
source={typeof img !== 'number' ? {
|
|
530
|
+
uri: optimizeImage(img, 'h_1024,c_limit'),
|
|
531
|
+
priority: FastImage.priority.normal,
|
|
532
|
+
} : img}
|
|
533
|
+
/>
|
|
534
|
+
) : (
|
|
535
|
+
<>
|
|
536
|
+
<YoutubePlayer
|
|
537
|
+
height={'100%'}
|
|
538
|
+
width={'100%'}
|
|
539
|
+
play={playing}
|
|
540
|
+
videoId={img}
|
|
541
|
+
onChangeState={onStateChange}
|
|
542
|
+
/>
|
|
543
|
+
<Button title={playing ? "pause" : "play"} onPress={togglePlaying} />
|
|
544
|
+
</>
|
|
545
|
+
)}
|
|
546
|
+
</View>
|
|
547
|
+
))}
|
|
548
|
+
</Swiper>
|
|
549
|
+
<ScrollView
|
|
550
|
+
horizontal
|
|
551
|
+
contentContainerStyle={{
|
|
552
|
+
paddingHorizontal: 20,
|
|
553
|
+
paddingVertical: 15
|
|
554
|
+
}}
|
|
555
|
+
>
|
|
556
|
+
{gallery?.length > 1 && gallery.map((img: any, index: number) => (
|
|
557
|
+
<TouchableOpacity
|
|
558
|
+
key={index}
|
|
559
|
+
onPress={() => handleClickThumb(index)}
|
|
560
|
+
>
|
|
561
|
+
<View
|
|
582
562
|
style={{
|
|
583
|
-
|
|
563
|
+
height: 56,
|
|
584
564
|
borderRadius: 8,
|
|
585
|
-
|
|
586
|
-
opacity:
|
|
565
|
+
margin: 8,
|
|
566
|
+
opacity: index === thumbsSwiper ? 1 : 0.8
|
|
587
567
|
}}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
568
|
+
>
|
|
569
|
+
{String(img).includes('http') ? (
|
|
570
|
+
<OIcon
|
|
571
|
+
url={img}
|
|
572
|
+
style={{
|
|
573
|
+
borderColor: theme.colors.lightGray,
|
|
574
|
+
borderRadius: 8,
|
|
575
|
+
minHeight: '100%',
|
|
576
|
+
opacity: isSoldOut ? 0.5 : 1
|
|
577
|
+
}}
|
|
578
|
+
width={56}
|
|
579
|
+
height={56}
|
|
580
|
+
cover
|
|
581
|
+
/>
|
|
582
|
+
) : (
|
|
583
|
+
<OIcon
|
|
584
|
+
url={'https://img.youtube.com/vi/' + img + '/0.jpg'}
|
|
585
|
+
style={{
|
|
586
|
+
borderColor: theme.colors.lightGray,
|
|
587
|
+
borderRadius: 8,
|
|
588
|
+
minHeight: '100%',
|
|
589
|
+
opacity: isSoldOut ? 0.5 : 1
|
|
590
|
+
}}
|
|
591
|
+
width={56}
|
|
592
|
+
height={56}
|
|
593
|
+
cover
|
|
594
|
+
/>
|
|
595
|
+
)}
|
|
596
|
+
</View>
|
|
597
|
+
</TouchableOpacity>
|
|
595
598
|
|
|
596
|
-
|
|
597
|
-
|
|
599
|
+
))}
|
|
600
|
+
</ScrollView>
|
|
601
|
+
</>
|
|
602
|
+
)}
|
|
598
603
|
</>
|
|
599
604
|
)}
|
|
600
605
|
</WrapHeader>
|
|
@@ -43,6 +43,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
43
43
|
? theme?.checkout?.components?.cart?.components?.product?.components?.image?.hidden
|
|
44
44
|
: theme?.confirmation?.components?.cart?.components?.products?.components?.photo?.hidden
|
|
45
45
|
|
|
46
|
+
const hideProductDummyLogo = theme?.business_view?.components?.products?.components?.product?.components?.dummy?.hidden
|
|
46
47
|
const hideProductCommentHide = isFromCheckout && theme?.checkout?.components?.cart?.components?.product?.components?.comments?.hidden
|
|
47
48
|
|
|
48
49
|
const pickerStyle = StyleSheet.create({
|
|
@@ -159,7 +160,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
159
160
|
>
|
|
160
161
|
<View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>
|
|
161
162
|
<ContentInfo>
|
|
162
|
-
{(product?.images || theme?.images?.dummies?.product) && !hideProductImage && (
|
|
163
|
+
{(product?.images || (!hideProductDummyLogo && theme?.images?.dummies?.product)) && !hideProductImage && (
|
|
163
164
|
<ProductImage>
|
|
164
165
|
{isFromCheckout ? (
|
|
165
166
|
product?.images ? (
|
|
@@ -48,6 +48,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
48
48
|
const hideAddButton = theme?.business_view?.components?.products?.components?.add_to_cart_button?.hidden ?? true
|
|
49
49
|
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
50
50
|
const hideProductDescription = theme?.business_view?.components?.products?.components?.product?.components?.description?.hidden
|
|
51
|
+
const hideProductDummyLogo = theme?.business_view?.components?.products?.components?.product?.components?.dummy?.hidden
|
|
51
52
|
const hideProductLogo = viewString
|
|
52
53
|
? theme?.[viewString]?.components?.cart?.components?.products?.image?.hidden
|
|
53
54
|
: theme?.business_view?.components?.products?.components?.product?.components?.image?.hidden
|
|
@@ -283,7 +284,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
283
284
|
</OText>
|
|
284
285
|
</RibbonBox>
|
|
285
286
|
)}
|
|
286
|
-
{!hideProductLogo && (
|
|
287
|
+
{(!hideProductLogo && (product?.images || !hideProductDummyLogo)) && (
|
|
287
288
|
<FastImage
|
|
288
289
|
style={styles.productStyle}
|
|
289
290
|
source={product?.images ? {
|
|
@@ -25,6 +25,9 @@ export const UpsellingLayout = (props : any) => {
|
|
|
25
25
|
const [{ parsePrice }] = useUtils()
|
|
26
26
|
const [, t] = useLanguage()
|
|
27
27
|
|
|
28
|
+
const hideProductDummyLogo = theme?.business_view?.components?.products?.components?.product?.components?.dummy?.hidden
|
|
29
|
+
|
|
30
|
+
|
|
28
31
|
const styles = StyleSheet.create({
|
|
29
32
|
imageStyle: {
|
|
30
33
|
width: 73,
|
|
@@ -66,9 +69,11 @@ export const UpsellingLayout = (props : any) => {
|
|
|
66
69
|
<OText size={10} color={theme.colors.primary}>{t('ADD', 'Add')}</OText>
|
|
67
70
|
</AddButton>
|
|
68
71
|
</View>
|
|
69
|
-
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
+
{(product?.images || !hideProductDummyLogo) && (
|
|
73
|
+
<View>
|
|
74
|
+
<OIcon url={product?.images || theme?.images?.dummies?.product} style={styles.imageStyle} />
|
|
75
|
+
</View>
|
|
76
|
+
)}
|
|
72
77
|
</Item>
|
|
73
78
|
)) : (
|
|
74
79
|
<OText>
|