ordering-ui-react-native 0.12.15 → 0.12.19
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/src/components/AddressList/index.tsx +3 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +168 -156
- package/themes/business/src/components/NewOrderNotification/index.tsx +14 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +3 -1
- package/themes/business/src/components/OrdersOption/index.tsx +19 -15
- package/themes/business/src/types/index.tsx +4 -1
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +128 -83
- package/themes/kiosk/src/components/DrawerView/index.tsx +57 -0
- package/themes/kiosk/src/components/DrawerView/styles.tsx +30 -0
- package/themes/kiosk/src/components/LanguageSelector/index.tsx +78 -58
- package/themes/kiosk/src/components/OrderDetails/index.tsx +3 -1
- package/themes/kiosk/src/components/ProductForm/index.tsx +129 -127
- package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
- package/themes/original/src/components/OrderProgress/index.tsx +3 -3
|
@@ -55,7 +55,8 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
55
55
|
handleChangeCommentState,
|
|
56
56
|
productObject,
|
|
57
57
|
onClose,
|
|
58
|
-
isFromCheckout
|
|
58
|
+
isFromCheckout,
|
|
59
|
+
isDrawer
|
|
59
60
|
} = props;
|
|
60
61
|
|
|
61
62
|
const theme = useTheme();
|
|
@@ -230,145 +231,146 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
230
231
|
|
|
231
232
|
return (
|
|
232
233
|
<>
|
|
233
|
-
<
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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
|
-
flexDirection: 'row',
|
|
273
|
-
alignItems: 'center',
|
|
274
|
-
padding: 20,
|
|
275
|
-
paddingTop: 0,
|
|
276
|
-
paddingBottom: 10
|
|
277
|
-
}}
|
|
278
|
-
>
|
|
279
|
-
<OImage
|
|
280
|
-
source={{uri: product?.images}}
|
|
281
|
-
width={70}
|
|
282
|
-
height={70}
|
|
283
|
-
resizeMode="cover"
|
|
284
|
-
borderRadius={6}
|
|
234
|
+
<ScrollView
|
|
235
|
+
style={styles.mainContainer}
|
|
236
|
+
contentContainerStyle={styles.scrollContainer}
|
|
237
|
+
onScroll={Animated.event(
|
|
238
|
+
[{ nativeEvent: { contentOffset: { y: scrollY }} }],
|
|
239
|
+
{useNativeDriver: false})
|
|
240
|
+
}
|
|
241
|
+
scrollEventThrottle={16}
|
|
242
|
+
>
|
|
243
|
+
<Animated.View style={[styles.header, { height: headerHeight }]}>
|
|
244
|
+
{!isDrawer && (<Animated.View style={{ opacity: navBar1ContainerOpacity }}>
|
|
245
|
+
<NavBar
|
|
246
|
+
{...navBarProps}
|
|
247
|
+
titleColor={theme.colors.white}
|
|
248
|
+
{...((navigation || onClose) && { leftImg: theme.images.general.arrow_left_white })}
|
|
249
|
+
btnStyle={{
|
|
250
|
+
width: 55,
|
|
251
|
+
height: 55,
|
|
252
|
+
backgroundColor: 'black',
|
|
253
|
+
borderRadius: 100,
|
|
254
|
+
opacity: 0.8,
|
|
255
|
+
left: 20,
|
|
256
|
+
}}
|
|
257
|
+
imgLeftStyle={{ width: 27, height: 27 }}
|
|
258
|
+
/>
|
|
259
|
+
</Animated.View>
|
|
260
|
+
)}
|
|
261
|
+
<Animated.View style={{ opacity: navBar2ContainerOpacity, position: 'absolute' }}>
|
|
262
|
+
<NavBar
|
|
263
|
+
{...navBarProps}
|
|
264
|
+
{...((navigation || onClose) && { leftImg: theme.images.general.arrow_left })}
|
|
265
|
+
btnStyle={{
|
|
266
|
+
width: 55,
|
|
267
|
+
height: 55,
|
|
268
|
+
backgroundColor: 'transparent',
|
|
269
|
+
borderRadius: 100,
|
|
270
|
+
left: 20,
|
|
271
|
+
}}
|
|
272
|
+
imgLeftStyle={{ width: 27, height: 27 }}
|
|
285
273
|
/>
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
274
|
+
</Animated.View>
|
|
275
|
+
|
|
276
|
+
<Animated.View style={{
|
|
277
|
+
backgroundColor: 'white',
|
|
278
|
+
width: orientationState?.dimensions?.width,
|
|
279
|
+
opacity: collapsedBarContainerOpacity,
|
|
280
|
+
}}>
|
|
281
|
+
<View
|
|
282
|
+
style={{
|
|
283
|
+
flexDirection: 'row',
|
|
284
|
+
alignItems: 'center',
|
|
285
|
+
padding: 20,
|
|
286
|
+
paddingTop: 0,
|
|
287
|
+
paddingBottom: 10
|
|
288
|
+
}}
|
|
291
289
|
>
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
290
|
+
<OImage
|
|
291
|
+
source={{uri: product?.images}}
|
|
292
|
+
width={70}
|
|
293
|
+
height={70}
|
|
294
|
+
resizeMode="cover"
|
|
295
|
+
borderRadius={6}
|
|
296
|
+
/>
|
|
297
|
+
<OText
|
|
298
|
+
size={orientationState?.dimensions?.width * 0.025}
|
|
299
|
+
weight="bold"
|
|
300
|
+
mLeft={20}
|
|
301
|
+
numberOfLines={2}
|
|
302
|
+
>
|
|
303
|
+
{product?.name}
|
|
304
|
+
</OText>
|
|
305
|
+
</View>
|
|
306
|
+
<View
|
|
307
|
+
style={{
|
|
308
|
+
position: 'absolute',
|
|
309
|
+
bottom: -2,
|
|
310
|
+
height: 1,
|
|
311
|
+
backgroundColor: 'white',
|
|
312
|
+
width: orientationState?.dimensions?.width,
|
|
313
|
+
...styles.shadow,
|
|
314
|
+
}}
|
|
315
|
+
/>
|
|
316
|
+
</Animated.View>
|
|
306
317
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
318
|
+
<Animated.View style={{
|
|
319
|
+
opacity: heroContainerOpacity,
|
|
320
|
+
position: 'absolute',
|
|
321
|
+
zIndex: -100,
|
|
322
|
+
transform: [{translateY: heroTranslateY }],
|
|
323
|
+
}}>
|
|
324
|
+
<View
|
|
325
|
+
style={{
|
|
326
|
+
width: orientationState?.dimensions?.width,
|
|
327
|
+
height: HEADER_EXPANDED_HEIGHT,
|
|
328
|
+
position: 'absolute',
|
|
329
|
+
zIndex: 1,
|
|
330
|
+
backgroundColor: 'rgba(24, 28, 50, 0.4)',
|
|
331
|
+
}}
|
|
332
|
+
>
|
|
333
|
+
<ImageBackground source={{ uri: product?.images }} resizeMode='cover' style={{ flex:1, justifyContent: 'center' }} />
|
|
323
334
|
|
|
324
|
-
|
|
335
|
+
</View>
|
|
325
336
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
>
|
|
337
|
-
<OText
|
|
338
|
-
color={theme.colors.white}
|
|
339
|
-
size={orientationState?.dimensions?.width * 0.048}
|
|
340
|
-
weight="bold"
|
|
341
|
-
mBottom={10}
|
|
342
|
-
numberOfLines={2}
|
|
337
|
+
<Animated.View
|
|
338
|
+
style={{
|
|
339
|
+
transform: [{translateY: heroTranslateY }],
|
|
340
|
+
width: orientationState?.dimensions?.width * 0.75,
|
|
341
|
+
height: HEADER_EXPANDED_HEIGHT / 2,
|
|
342
|
+
position: 'relative',
|
|
343
|
+
top: HEADER_EXPANDED_HEIGHT / 3,
|
|
344
|
+
zIndex: 100,
|
|
345
|
+
padding: 20,
|
|
346
|
+
}}
|
|
343
347
|
>
|
|
344
|
-
|
|
345
|
-
|
|
348
|
+
<OText
|
|
349
|
+
color={theme.colors.white}
|
|
350
|
+
size={orientationState?.dimensions?.width * 0.048}
|
|
351
|
+
weight="bold"
|
|
352
|
+
mBottom={10}
|
|
353
|
+
numberOfLines={2}
|
|
354
|
+
>
|
|
355
|
+
{product?.name || productCart?.name}
|
|
356
|
+
</OText>
|
|
346
357
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
358
|
+
<OText
|
|
359
|
+
color={theme.colors.white}
|
|
360
|
+
numberOfLines={4}
|
|
361
|
+
>
|
|
362
|
+
{product?.description || productCart?.description}
|
|
363
|
+
</OText>
|
|
364
|
+
</Animated.View>
|
|
353
365
|
</Animated.View>
|
|
354
366
|
</Animated.View>
|
|
355
|
-
</Animated.View>
|
|
356
367
|
|
|
357
|
-
<ScrollView
|
|
358
|
-
style={styles.mainContainer}
|
|
359
|
-
contentContainerStyle={styles.scrollContainer}
|
|
360
|
-
onScroll={Animated.event(
|
|
361
|
-
[{ nativeEvent: { contentOffset: { y: scrollY }} }],
|
|
362
|
-
{useNativeDriver: false})
|
|
363
|
-
}
|
|
364
|
-
scrollEventThrottle={16}
|
|
365
|
-
>
|
|
366
368
|
{!isFromCheckout && (
|
|
367
369
|
<Spinner visible={loading} />
|
|
368
370
|
)}
|
|
369
371
|
{!loading && !error && product && (
|
|
370
|
-
<View style={{ paddingTop: 20, paddingBottom: 80 }}>
|
|
371
|
-
<WrapContent>
|
|
372
|
+
<View style={{ paddingTop: isDrawer ? 10 : 20, paddingBottom: 80 }}>
|
|
373
|
+
<WrapContent isDrawer={isDrawer}>
|
|
372
374
|
<ProductDescription>
|
|
373
375
|
{(
|
|
374
376
|
(product?.sku && product?.sku !== '-1' && product?.sku !== '1') ||
|
|
@@ -500,7 +502,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
500
502
|
</TouchableOpacity>
|
|
501
503
|
</View>
|
|
502
504
|
)}
|
|
503
|
-
<View style={{ width: isSoldOut || maxProductQuantity <= 0 ? '100%' : '80%' }}>
|
|
505
|
+
<View style={{ width: isSoldOut || maxProductQuantity <= 0 ? '100%' : isDrawer ? '70%':'80%' }}>
|
|
504
506
|
{productCart && !isSoldOut && maxProductQuantity > 0 && auth && orderState.options?.address_id && (
|
|
505
507
|
<OButton
|
|
506
508
|
onClick={() => handleSaveProduct()}
|
|
@@ -106,11 +106,11 @@ const OrderProgressUI = (props: any) => {
|
|
|
106
106
|
const convertDiffToHours = (order: any) => {
|
|
107
107
|
const time = order.delivery_type === 1 ? order?.business?.delivery_time : order?.business?.pickup_time
|
|
108
108
|
const deliveryTime = order?.delivery_datetime_utc
|
|
109
|
-
? parseDate(order?.delivery_datetime_utc, { outputFormat: 'YYYY-MM-DD
|
|
110
|
-
: parseDate(order?.delivery_datetime, { utc: false, outputFormat: 'YYYY-MM-DD
|
|
109
|
+
? parseDate(order?.delivery_datetime_utc, { outputFormat: 'YYYY-MM-DD HH:mm' })
|
|
110
|
+
: parseDate(order?.delivery_datetime, { utc: false, outputFormat: 'YYYY-MM-DD HH:mm' })
|
|
111
111
|
const [hour, minute] = time.split(':')
|
|
112
112
|
const result = time ? (parseInt(hour, 10) * 60) + parseInt(minute, 10) : 0
|
|
113
|
-
const returnedDate = moment(
|
|
113
|
+
const returnedDate = moment(deliveryTime).add(result, 'minutes').format('hh:mm A')
|
|
114
114
|
return returnedDate
|
|
115
115
|
}
|
|
116
116
|
|