ordering-ui-react-native 0.15.0 → 0.15.2-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.
- package/package.json +7 -3
- package/src/DeliveryApp.tsx +32 -1
- package/src/components/BusinessTypeFilter/index.tsx +9 -2
- package/src/components/BusinessTypeFilter/styles.tsx +1 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +0 -1
- package/src/components/Home/index.tsx +3 -5
- package/src/components/LanguageSelector/index.tsx +65 -97
- package/src/components/LanguageSelector/styles.tsx +4 -17
- package/src/components/Messages/index.tsx +38 -30
- package/src/components/MomentOption/index.tsx +3 -1
- package/src/components/OrderDetails/index.tsx +25 -4
- package/src/components/PaymentOptions/index.tsx +9 -16
- package/src/components/PaymentOptionsWebView/index.tsx +123 -124
- package/src/components/ProductForm/index.tsx +1 -1
- package/src/components/ProductForm/styles.tsx +1 -0
- package/src/components/StripeElementsForm/index.tsx +27 -48
- package/src/components/UserProfileForm/index.tsx +35 -1
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/config.json +0 -2
- package/src/pages/Checkout.tsx +1 -1
- package/src/types/index.tsx +2 -9
- package/src/utils/index.tsx +2 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/Chat/index.tsx +32 -31
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -0
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +85 -17
- package/themes/business/src/components/OrdersListManager/index.tsx +874 -0
- package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
- package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
- package/themes/business/src/components/OrdersOption/index.tsx +70 -116
- package/themes/business/src/components/OrdersOption/styles.tsx +2 -5
- package/themes/business/src/components/PreviousOrders/index.tsx +82 -23
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessController/index.tsx +27 -6
- package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
- package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +51 -24
- package/themes/kiosk/src/components/Cart/index.tsx +1 -1
- package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
- package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
- package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
- package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +7 -5
- package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
- package/themes/kiosk/src/components/Intro/index.tsx +13 -13
- package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
- package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
- package/themes/kiosk/src/components/ProductForm/index.tsx +172 -124
- package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
- package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
- package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
- package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
- package/themes/original/index.tsx +179 -0
- package/themes/original/src/components/AddressForm/index.tsx +15 -10
- package/themes/original/src/components/AddressList/index.tsx +27 -1
- package/themes/original/src/components/AnalyticsSegment/index.tsx +127 -0
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +100 -45
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +28 -1
- package/themes/original/src/components/BusinessController/index.tsx +32 -21
- package/themes/original/src/components/BusinessListingSearch/index.tsx +7 -3
- package/themes/original/src/components/BusinessMenuList/index.tsx +14 -5
- package/themes/original/src/components/BusinessPreorder/index.tsx +142 -121
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +7 -5
- package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +23 -30
- package/themes/original/src/components/BusinessReviews/index.tsx +8 -28
- package/themes/original/src/components/BusinessesListing/index.tsx +39 -52
- package/themes/original/src/components/Cart/index.tsx +40 -9
- package/themes/original/src/components/CartContent/index.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +58 -33
- package/themes/original/src/components/Checkout/styles.tsx +7 -0
- package/themes/original/src/components/CouponControl/index.tsx +1 -0
- package/themes/original/src/components/DriverTips/index.tsx +1 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +8 -12
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +105 -90
- package/themes/original/src/components/LoginForm/index.tsx +156 -70
- package/themes/original/src/components/LoginForm/styles.tsx +6 -1
- package/themes/original/src/components/Messages/index.tsx +52 -45
- package/themes/original/src/components/Messages/styles.tsx +1 -3
- package/themes/original/src/components/MomentOption/index.tsx +127 -152
- package/themes/original/src/components/MomentOption/styles.tsx +42 -18
- package/themes/original/src/components/OrderDetails/index.tsx +102 -125
- package/themes/original/src/components/OrderDetails/styles.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +6 -7
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -0
- package/themes/original/src/components/OrderSummary/index.tsx +34 -1
- package/themes/original/src/components/OrdersOption/index.tsx +15 -46
- package/themes/original/src/components/OrdersOption/styles.tsx +0 -6
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +6 -2
- package/themes/original/src/components/PaymentOptions/index.tsx +24 -25
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -8
- package/themes/original/src/components/PlaceSpot/index.tsx +114 -0
- package/themes/original/src/components/PlaceSpot/styles.tsx +11 -0
- package/themes/original/src/components/PreviousOrders/index.tsx +19 -13
- package/themes/original/src/components/ProductForm/index.tsx +157 -108
- package/themes/original/src/components/ProductForm/styles.tsx +5 -3
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +6 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +10 -9
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/SignupForm/index.tsx +173 -154
- package/themes/original/src/components/SingleProductCard/index.tsx +1 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
- package/themes/original/src/components/TaxInformation/index.tsx +17 -7
- package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
- package/themes/original/src/components/UserDetails/index.tsx +4 -95
- package/themes/original/src/components/UserFormDetails/index.tsx +2 -14
- package/themes/original/src/components/UserProfile/index.tsx +16 -11
- package/themes/original/src/components/UserProfileForm/index.tsx +16 -8
- package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
- package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
- package/themes/original/src/components/shared/HeaderTitle.tsx +21 -0
- package/themes/original/src/components/shared/index.tsx +2 -0
- package/themes/original/src/types/index.tsx +64 -22
- package/themes/single-business/src/components/OrderTypeSelector/index.tsx +5 -5
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/StripeMethodForm/index.tsx +0 -168
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
+
import FastImage from 'react-native-fast-image'
|
|
2
3
|
import {
|
|
3
4
|
View,
|
|
4
5
|
TouchableOpacity,
|
|
@@ -69,7 +70,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
69
70
|
|
|
70
71
|
const { product, loading, error } = productObject;
|
|
71
72
|
|
|
72
|
-
const HEADER_EXPANDED_HEIGHT =
|
|
73
|
+
const HEADER_EXPANDED_HEIGHT = orientationState?.dimensions?.height * 0.4;
|
|
73
74
|
const HEADER_COLLAPSED_HEIGHT = orientationState?.dimensions?.height * 0.2;
|
|
74
75
|
|
|
75
76
|
const isError = (id: number) => {
|
|
@@ -87,7 +88,6 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
87
88
|
const isErrors = Object.values(errors).length > 0
|
|
88
89
|
if (!isErrors) {
|
|
89
90
|
handleSave && handleSave()
|
|
90
|
-
showCartBottomSheet()
|
|
91
91
|
return
|
|
92
92
|
}
|
|
93
93
|
}
|
|
@@ -204,7 +204,6 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
204
204
|
},
|
|
205
205
|
scrollContainer: {
|
|
206
206
|
padding: 16,
|
|
207
|
-
paddingTop: HEADER_EXPANDED_HEIGHT
|
|
208
207
|
},
|
|
209
208
|
header: {
|
|
210
209
|
backgroundColor: '#fff',
|
|
@@ -226,6 +225,10 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
226
225
|
shadowOpacity: 0.4,
|
|
227
226
|
shadowRadius: 3,
|
|
228
227
|
elevation: 5,
|
|
228
|
+
},
|
|
229
|
+
imageStyle: {
|
|
230
|
+
width: '100%',
|
|
231
|
+
height: HEADER_EXPANDED_HEIGHT,
|
|
229
232
|
}
|
|
230
233
|
});
|
|
231
234
|
|
|
@@ -233,118 +236,173 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
233
236
|
<>
|
|
234
237
|
<ScrollView
|
|
235
238
|
style={styles.mainContainer}
|
|
236
|
-
contentContainerStyle={styles.scrollContainer}
|
|
237
239
|
onScroll={Animated.event(
|
|
238
240
|
[{ nativeEvent: { contentOffset: { y: scrollY } } }],
|
|
239
241
|
{ useNativeDriver: false })
|
|
240
242
|
}
|
|
241
243
|
scrollEventThrottle={16}
|
|
242
244
|
>
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
{
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
245
|
+
{!isDrawer ? (
|
|
246
|
+
<Animated.View style={[styles.header, { height: headerHeight }]}>
|
|
247
|
+
{!isDrawer && (
|
|
248
|
+
<Animated.View style={{ opacity: navBar1ContainerOpacity }}>
|
|
249
|
+
<NavBar
|
|
250
|
+
{...navBarProps}
|
|
251
|
+
titleColor={theme.colors.white}
|
|
252
|
+
btnStyle={{
|
|
253
|
+
width: 55,
|
|
254
|
+
height: 55,
|
|
255
|
+
overflow: 'scroll',
|
|
256
|
+
backgroundColor: 'black',
|
|
257
|
+
borderRadius: 100,
|
|
258
|
+
color: 'white',
|
|
259
|
+
opacity: 0.8,
|
|
260
|
+
left: 20,
|
|
261
|
+
}}
|
|
262
|
+
/>
|
|
263
|
+
</Animated.View>
|
|
264
|
+
)}
|
|
265
|
+
<Animated.View style={{ opacity: navBar2ContainerOpacity, position: 'absolute' }}>
|
|
266
|
+
<NavBar
|
|
267
|
+
{...navBarProps}
|
|
268
|
+
btnStyle={{
|
|
269
|
+
width: 55,
|
|
270
|
+
height: 55,
|
|
271
|
+
backgroundColor: 'transparent',
|
|
272
|
+
borderRadius: 100,
|
|
273
|
+
left: 20,
|
|
274
|
+
}}
|
|
275
|
+
/>
|
|
276
|
+
</Animated.View>
|
|
273
277
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
278
|
+
<Animated.View style={{
|
|
279
|
+
backgroundColor: 'white',
|
|
280
|
+
width: orientationState?.dimensions?.width,
|
|
281
|
+
opacity: collapsedBarContainerOpacity,
|
|
282
|
+
}}>
|
|
283
|
+
<View
|
|
284
|
+
style={{
|
|
285
|
+
flexDirection: 'row',
|
|
286
|
+
alignItems: 'center',
|
|
287
|
+
padding: 20,
|
|
288
|
+
paddingTop: 0,
|
|
289
|
+
paddingBottom: 10
|
|
290
|
+
}}
|
|
291
|
+
>
|
|
292
|
+
{product?.images ? (
|
|
293
|
+
<FastImage
|
|
294
|
+
style={{ height: 70, width: 70, borderRadius: 6 }}
|
|
295
|
+
source={{
|
|
296
|
+
uri: product?.images,
|
|
297
|
+
priority: FastImage.priority.normal,
|
|
298
|
+
// cache:FastImage.cacheControl.web
|
|
299
|
+
}}
|
|
300
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
301
|
+
/>
|
|
302
|
+
) : (
|
|
303
|
+
<ImageBackground
|
|
304
|
+
style={{ height: 70, width: 70, borderRadius: 6 }}
|
|
305
|
+
source={theme.images.dummies.product}
|
|
306
|
+
imageStyle={{ borderRadius: 6 }}
|
|
307
|
+
resizeMode='cover'
|
|
308
|
+
/>
|
|
309
|
+
)}
|
|
310
|
+
<OText
|
|
311
|
+
size={orientationState?.dimensions?.width * 0.025}
|
|
312
|
+
weight="bold"
|
|
313
|
+
mLeft={20}
|
|
314
|
+
numberOfLines={2}
|
|
315
|
+
>
|
|
316
|
+
{product?.name}
|
|
317
|
+
</OText>
|
|
318
|
+
</View>
|
|
319
|
+
<View
|
|
320
|
+
style={{
|
|
321
|
+
position: 'absolute',
|
|
322
|
+
bottom: -2,
|
|
323
|
+
height: 1,
|
|
324
|
+
backgroundColor: 'white',
|
|
325
|
+
width: orientationState?.dimensions?.width,
|
|
326
|
+
...styles.shadow,
|
|
327
|
+
}}
|
|
294
328
|
/>
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
329
|
+
</Animated.View>
|
|
330
|
+
|
|
331
|
+
<Animated.View style={{
|
|
332
|
+
opacity: heroContainerOpacity,
|
|
333
|
+
position: 'absolute',
|
|
334
|
+
zIndex: -100,
|
|
335
|
+
transform: [{ translateY: heroTranslateY }],
|
|
336
|
+
}}>
|
|
337
|
+
<View
|
|
338
|
+
style={{
|
|
339
|
+
width: orientationState?.dimensions?.width,
|
|
340
|
+
height: HEADER_EXPANDED_HEIGHT,
|
|
341
|
+
position: 'absolute',
|
|
342
|
+
zIndex: 1,
|
|
343
|
+
backgroundColor: 'rgba(24, 28, 50, 0.4)',
|
|
344
|
+
}}
|
|
300
345
|
>
|
|
301
|
-
{product?.
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
346
|
+
{product?.images ? (
|
|
347
|
+
<FastImage
|
|
348
|
+
style={{ flex: 1, justifyContent: 'center' }}
|
|
349
|
+
source={{
|
|
350
|
+
uri: product?.images,
|
|
351
|
+
priority: FastImage.priority.normal,
|
|
352
|
+
// cache:FastImage.cacheControl.web
|
|
353
|
+
}}
|
|
354
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
355
|
+
/>
|
|
356
|
+
) : (
|
|
357
|
+
<ImageBackground
|
|
358
|
+
style={{ flex: 1, justifyContent: 'center' }}
|
|
359
|
+
source={theme.images.dummies.product}
|
|
360
|
+
resizeMode='cover'
|
|
361
|
+
/>
|
|
362
|
+
)}
|
|
363
|
+
</View>
|
|
364
|
+
</Animated.View>
|
|
314
365
|
</Animated.View>
|
|
315
|
-
|
|
316
|
-
<
|
|
317
|
-
|
|
318
|
-
position: 'absolute',
|
|
319
|
-
zIndex: -100,
|
|
320
|
-
transform: [{ translateY: heroTranslateY }],
|
|
321
|
-
}}>
|
|
322
|
-
<View
|
|
366
|
+
) : (
|
|
367
|
+
<View style={{...styles.imageStyle}}>
|
|
368
|
+
<Animated.View
|
|
323
369
|
style={{
|
|
324
|
-
|
|
325
|
-
|
|
370
|
+
...styles.imageStyle,
|
|
371
|
+
opacity: heroContainerOpacity,
|
|
326
372
|
position: 'absolute',
|
|
327
|
-
zIndex:
|
|
328
|
-
|
|
373
|
+
zIndex: -100,
|
|
374
|
+
transform: [{ translateY: heroTranslateY }],
|
|
329
375
|
}}
|
|
330
376
|
>
|
|
331
|
-
<
|
|
377
|
+
<View style={styles.imageStyle}>
|
|
378
|
+
{product?.images ? (
|
|
379
|
+
<FastImage
|
|
380
|
+
style={{ flex: 1 }}
|
|
381
|
+
source={{
|
|
382
|
+
uri: product?.images,
|
|
383
|
+
priority: FastImage.priority.normal,
|
|
384
|
+
// cache:FastImage.cacheControl.web
|
|
385
|
+
}}
|
|
386
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
387
|
+
/>
|
|
388
|
+
) : (
|
|
389
|
+
<ImageBackground
|
|
390
|
+
style={{ flex: 1, justifyContent: 'center' }}
|
|
391
|
+
source={theme.images.dummies.product}
|
|
392
|
+
resizeMode='cover'
|
|
393
|
+
/>
|
|
394
|
+
)}
|
|
395
|
+
</View>
|
|
396
|
+
</Animated.View>
|
|
397
|
+
</View>
|
|
398
|
+
)}
|
|
332
399
|
|
|
333
|
-
</View>
|
|
334
400
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
width: orientationState?.dimensions?.width * 0.75,
|
|
339
|
-
height: HEADER_EXPANDED_HEIGHT / 2,
|
|
340
|
-
position: 'relative',
|
|
341
|
-
top: HEADER_EXPANDED_HEIGHT / 3,
|
|
342
|
-
zIndex: 100,
|
|
343
|
-
padding: 20,
|
|
344
|
-
}}
|
|
345
|
-
>
|
|
401
|
+
{!loading && !error && product && (
|
|
402
|
+
<View style={{ paddingTop: isDrawer ? 20 : HEADER_EXPANDED_HEIGHT, paddingBottom: 80, paddingHorizontal: 16 }}>
|
|
403
|
+
<WrapContent isDrawer={isDrawer}>
|
|
346
404
|
<OText
|
|
347
|
-
|
|
405
|
+
style={{ marginTop: 20 }}
|
|
348
406
|
size={orientationState?.dimensions?.width * 0.038}
|
|
349
407
|
weight="bold"
|
|
350
408
|
mBottom={10}
|
|
@@ -353,33 +411,23 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
353
411
|
{product?.name || productCart?.name}
|
|
354
412
|
</OText>
|
|
355
413
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
414
|
+
{(product?.description || productCart?.description) && (
|
|
415
|
+
<OText
|
|
416
|
+
numberOfLines={4}
|
|
417
|
+
>
|
|
418
|
+
{product?.description || productCart?.description}
|
|
419
|
+
</OText>
|
|
420
|
+
)}
|
|
421
|
+
|
|
422
|
+
{((product?.sku && product?.sku !== '-1' && product?.sku !== '1') ||
|
|
423
|
+
(productCart?.sku && productCart?.sku !== '-1' && productCart?.sku !== '1')
|
|
424
|
+
) && (
|
|
425
|
+
<ProductDescription>
|
|
426
|
+
<OText size={20}>{t('SKU', 'Sku')}</OText>
|
|
427
|
+
<OText>{product?.sku || productCart?.sku}</OText>
|
|
428
|
+
</ProductDescription>
|
|
429
|
+
)}
|
|
365
430
|
|
|
366
|
-
{/* {!isFromCheckout && (
|
|
367
|
-
<Spinner visible={loading} />
|
|
368
|
-
)} */}
|
|
369
|
-
{!loading && !error && product && (
|
|
370
|
-
<View style={{ paddingTop: isDrawer ? 10 : 20, paddingBottom: 80 }}>
|
|
371
|
-
<WrapContent isDrawer={isDrawer}>
|
|
372
|
-
<ProductDescription>
|
|
373
|
-
{(
|
|
374
|
-
(product?.sku && product?.sku !== '-1' && product?.sku !== '1') ||
|
|
375
|
-
(productCart?.sku && productCart?.sku !== '-1' && productCart?.sku !== '1')
|
|
376
|
-
) && (
|
|
377
|
-
<>
|
|
378
|
-
<OText size={20}>{t('SKU', 'Sku')}</OText>
|
|
379
|
-
<OText>{product?.sku || productCart?.sku}</OText>
|
|
380
|
-
</>
|
|
381
|
-
)}
|
|
382
|
-
</ProductDescription>
|
|
383
431
|
<ProductEditions>
|
|
384
432
|
{product?.ingredients.length > 0 && (
|
|
385
433
|
<View style={styles.optionContainer}>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React,{ useState, useEffect } from 'react'
|
|
2
2
|
import Spinner from 'react-native-loading-spinner-overlay';
|
|
3
|
-
import { StyleSheet, View, Platform } from 'react-native'
|
|
3
|
+
import { StyleSheet, View, Platform, ImageBackground } from 'react-native'
|
|
4
4
|
import {
|
|
5
5
|
UpsellingPage as UpsellingPageController,
|
|
6
6
|
useUtils,
|
|
@@ -20,6 +20,7 @@ import { Container } from '../../layouts/Container';
|
|
|
20
20
|
import GridContainer from '../../layouts/GridContainer';
|
|
21
21
|
import { PORTRAIT, useDeviceOrientation } from "../../../../../src/hooks/DeviceOrientation";
|
|
22
22
|
import { useTheme } from 'styled-components/native';
|
|
23
|
+
import FastImage from 'react-native-fast-image';
|
|
23
24
|
|
|
24
25
|
const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
25
26
|
const {
|
|
@@ -114,7 +115,24 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
114
115
|
{
|
|
115
116
|
!upsellingProducts.error ? upsellingProducts.products.map((product: any) => (
|
|
116
117
|
<Item key={product.id}>
|
|
117
|
-
|
|
118
|
+
{product?.images ? (
|
|
119
|
+
<FastImage
|
|
120
|
+
style={styles.imageStyle}
|
|
121
|
+
source={{
|
|
122
|
+
uri: product?.images,
|
|
123
|
+
priority: FastImage.priority.normal,
|
|
124
|
+
// cache:FastImage.cacheControl.web
|
|
125
|
+
}}
|
|
126
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
127
|
+
/>
|
|
128
|
+
) : (
|
|
129
|
+
<ImageBackground
|
|
130
|
+
style={styles.imageStyle}
|
|
131
|
+
source={theme.images.dummies.product}
|
|
132
|
+
imageStyle={{ borderRadius: 10 }}
|
|
133
|
+
resizeMode='cover'
|
|
134
|
+
/>
|
|
135
|
+
)}
|
|
118
136
|
<Details>
|
|
119
137
|
<OText
|
|
120
138
|
weight="500"
|
|
@@ -125,24 +143,22 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
125
143
|
{product.name}
|
|
126
144
|
</OText>
|
|
127
145
|
|
|
128
|
-
|
|
129
|
-
<OText
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
</OText>
|
|
146
|
+
<OText>
|
|
147
|
+
<OText
|
|
148
|
+
color={theme.colors.primary}
|
|
149
|
+
weight="500"
|
|
150
|
+
>
|
|
151
|
+
{parsePrice(product.price)}
|
|
152
|
+
</OText>
|
|
136
153
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
</OText>
|
|
154
|
+
<OText
|
|
155
|
+
color={theme.colors.mediumGray}
|
|
156
|
+
size={12}
|
|
157
|
+
style={{textDecorationLine: 'line-through', textDecorationStyle: 'solid'}}
|
|
158
|
+
>
|
|
159
|
+
{product?.offer_price ? ` ${parsePrice(product?.offer_price)} ` : ''}
|
|
144
160
|
</OText>
|
|
145
|
-
|
|
161
|
+
</OText>
|
|
146
162
|
</Details>
|
|
147
163
|
|
|
148
164
|
<OButton
|
|
@@ -200,24 +216,22 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
200
216
|
{product.name}
|
|
201
217
|
</OText>
|
|
202
218
|
|
|
203
|
-
|
|
204
|
-
<OText
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
</OText>
|
|
219
|
+
<OText>
|
|
220
|
+
<OText
|
|
221
|
+
color={theme.colors.primary}
|
|
222
|
+
weight="500"
|
|
223
|
+
>
|
|
224
|
+
{parsePrice(product.price)}
|
|
225
|
+
</OText>
|
|
211
226
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
</OText>
|
|
227
|
+
<OText
|
|
228
|
+
color={theme.colors.mediumGray}
|
|
229
|
+
size={12}
|
|
230
|
+
style={{textDecorationLine: 'line-through', textDecorationStyle: 'solid'}}
|
|
231
|
+
>
|
|
232
|
+
{product?.offer_price ? parsePrice(product?.offer_price) : ''}
|
|
219
233
|
</OText>
|
|
220
|
-
|
|
234
|
+
</OText>
|
|
221
235
|
</Details>
|
|
222
236
|
<OButton
|
|
223
237
|
text={t('ADD_PRODUCT', 'add product')}
|
|
@@ -10,8 +10,6 @@ import {
|
|
|
10
10
|
|
|
11
11
|
import * as React from 'react';
|
|
12
12
|
import styled from 'styled-components/native';
|
|
13
|
-
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
14
|
-
import { Icon, IconProps } from 'react-native-vector-icons/Icon';
|
|
15
13
|
|
|
16
14
|
const StyledButton = styled.View<Props>`
|
|
17
15
|
background-color: ${(props: any) => props.theme.colors.primary};
|
|
@@ -79,19 +77,17 @@ interface Props {
|
|
|
79
77
|
isCircle?: boolean;
|
|
80
78
|
bgColor?: string;
|
|
81
79
|
borderColor?: string;
|
|
82
|
-
iconProps?: IconProps;
|
|
83
|
-
IconCustom?: React.FunctionComponent
|
|
84
80
|
}
|
|
85
81
|
|
|
86
82
|
const OButton = (props: Props): React.ReactElement => {
|
|
87
83
|
if (props.isDisabled) {
|
|
88
84
|
return (
|
|
89
85
|
<View style={props.parentStyle}>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
86
|
+
<StyledButtonDisabled style={props.style}>
|
|
87
|
+
<StyledTextDisabled style={props.disabledTextStyle ? props.disabledTextStyle : props.textStyle}>
|
|
88
|
+
{props.text}
|
|
89
|
+
</StyledTextDisabled>
|
|
90
|
+
</StyledButtonDisabled>
|
|
95
91
|
</View>
|
|
96
92
|
);
|
|
97
93
|
}
|
|
@@ -115,15 +111,6 @@ const OButton = (props: Props): React.ReactElement => {
|
|
|
115
111
|
{props.imgLeftSrc ? (
|
|
116
112
|
<StyledImage style={props.imgLeftStyle} source={props.imgLeftSrc} />
|
|
117
113
|
) : null}
|
|
118
|
-
{props.iconProps ? (
|
|
119
|
-
<>
|
|
120
|
-
{props?.IconCustom ? (
|
|
121
|
-
<props.IconCustom {...props.iconProps} />
|
|
122
|
-
) : (
|
|
123
|
-
<AntDesignIcon {...props.iconProps} />
|
|
124
|
-
)}
|
|
125
|
-
</>
|
|
126
|
-
) : null}
|
|
127
114
|
{props.text ? (
|
|
128
115
|
<StyledText style={props.textStyle}>{props.text}</StyledText>
|
|
129
116
|
) : null}
|