ordering-ui-react-native 0.14.71 → 0.14.74
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/kiosk/index.tsx +6 -0
- package/themes/kiosk/src/components/BusinessController/index.tsx +67 -0
- package/themes/kiosk/src/components/BusinessController/styles.tsx +23 -0
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +119 -0
- package/themes/kiosk/src/components/BusinessesListing/styles.tsx +24 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +62 -2
- package/themes/kiosk/src/components/LogoutButton/index.tsx +74 -0
- package/themes/kiosk/src/components/LogoutPopup/index.tsx +19 -7
- package/themes/kiosk/src/types/index.d.ts +1 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +7 -2
- package/themes/original/src/components/BusinessesListing/index.tsx +8 -9
- package/themes/original/src/components/Cart/index.tsx +8 -8
- package/themes/original/src/components/Checkout/index.tsx +82 -70
- package/themes/original/src/components/LoginForm/index.tsx +6 -4
- package/themes/original/src/components/OrderDetails/index.tsx +58 -6
- package/themes/original/src/components/OrderProgress/index.tsx +39 -31
- package/themes/original/src/components/OrderSummary/index.tsx +8 -8
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PhoneInputNumber/styles.tsx +1 -1
- package/themes/original/src/components/ProductForm/index.tsx +2 -2
- package/themes/original/src/components/ProductForm/styles.tsx +1 -1
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +15 -8
- package/themes/original/src/components/UpsellingProducts/index.tsx +1 -4
- package/themes/original/src/components/UserProfile/index.tsx +13 -11
- package/themes/original/src/components/WalletTransactionItem/index.tsx +5 -5
- package/themes/original/src/components/Wallets/styles.tsx +1 -1
- package/themes/original/src/components/shared/OInput.tsx +6 -2
- package/themes/original/src/utils/index.tsx +7 -0
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
ChCart,
|
|
40
40
|
DeliveryOptionsContainer,
|
|
41
41
|
DeliveryOptionItem,
|
|
42
|
-
|
|
42
|
+
WalletPaymentOptionContainer
|
|
43
43
|
} from './styles';
|
|
44
44
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
45
45
|
|
|
@@ -133,7 +133,7 @@ const CheckoutUI = (props: any) => {
|
|
|
133
133
|
const [webviewPaymethod, setWebviewPaymethod] = useState<any>(null)
|
|
134
134
|
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
const isWalletEnabled = configs?.wallet_enabled?.value === '1' && (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
|
|
137
137
|
|
|
138
138
|
const driverTipsOptions = typeof configs?.driver_tip_options?.value === 'string'
|
|
139
139
|
? JSON.parse(configs?.driver_tip_options?.value) || []
|
|
@@ -145,7 +145,7 @@ const CheckoutUI = (props: any) => {
|
|
|
145
145
|
|
|
146
146
|
const deliveryOptions = instructionsOptions?.result && instructionsOptions?.result?.filter((option: any) => option?.enabled)?.map((option: any) => {
|
|
147
147
|
return {
|
|
148
|
-
value: option?.id, key: option?.id, label: t(option?.name.toUpperCase().replace(/\s/g, '_'), option?.name)
|
|
148
|
+
value: option?.id, key: option?.id, label: t(option?.name.toUpperCase().replace(/\s/g, '_'), option?.name)
|
|
149
149
|
}
|
|
150
150
|
})
|
|
151
151
|
|
|
@@ -169,7 +169,7 @@ const CheckoutUI = (props: any) => {
|
|
|
169
169
|
|
|
170
170
|
const onFailPaypal = async () => {
|
|
171
171
|
if (showGateway.closedByUser === true) {
|
|
172
|
-
|
|
172
|
+
await confirmCart(cart.uuid)
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
const changeDeliveryOption = (option: any) => {
|
|
@@ -283,14 +283,14 @@ const CheckoutUI = (props: any) => {
|
|
|
283
283
|
<ChSection>
|
|
284
284
|
<ChBusinessDetails>
|
|
285
285
|
{
|
|
286
|
-
(businessDetails?.loading || cartState.loading) &&
|
|
286
|
+
(businessDetails?.loading || cartState.loading || !businessDetails?.business || Object.values(businessDetails?.business).length === 0) &&
|
|
287
287
|
!businessDetails?.error &&
|
|
288
288
|
(
|
|
289
289
|
<Placeholder Animation={Fade}>
|
|
290
290
|
<PlaceholderLine height={20} width={70} />
|
|
291
|
-
<PlaceholderLine height={
|
|
292
|
-
<PlaceholderLine height={
|
|
293
|
-
<PlaceholderLine height={
|
|
291
|
+
<PlaceholderLine height={10} width={60} />
|
|
292
|
+
<PlaceholderLine height={10} width={60} />
|
|
293
|
+
<PlaceholderLine height={10} width={80} style={{ marginBottom: 20 }} />
|
|
294
294
|
</Placeholder>
|
|
295
295
|
)}
|
|
296
296
|
{
|
|
@@ -337,9 +337,9 @@ const CheckoutUI = (props: any) => {
|
|
|
337
337
|
{cartState.loading ? (
|
|
338
338
|
<Placeholder Animation={Fade}>
|
|
339
339
|
<PlaceholderLine height={20} width={70} />
|
|
340
|
-
<PlaceholderLine height={
|
|
341
|
-
<PlaceholderLine height={
|
|
342
|
-
<PlaceholderLine height={
|
|
340
|
+
<PlaceholderLine height={10} width={60} />
|
|
341
|
+
<PlaceholderLine height={10} width={60} />
|
|
342
|
+
<PlaceholderLine height={10} width={80} style={{ marginBottom: 20 }} />
|
|
343
343
|
</Placeholder>
|
|
344
344
|
) : (
|
|
345
345
|
<UserDetails
|
|
@@ -358,54 +358,66 @@ const CheckoutUI = (props: any) => {
|
|
|
358
358
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40 }} />
|
|
359
359
|
</ChSection>
|
|
360
360
|
|
|
361
|
-
{
|
|
361
|
+
{options?.type === 1 && (
|
|
362
362
|
<DeliveryOptionsContainer>
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
363
|
+
{cartState.loading || deliveryOptionSelected === undefined ? (
|
|
364
|
+
<View style={{ height: 110 }}>
|
|
365
|
+
<Placeholder Animation={Fade}>
|
|
366
|
+
<PlaceholderLine height={20} width={70} />
|
|
367
|
+
<PlaceholderLine height={40} width={100} />
|
|
368
|
+
</Placeholder>
|
|
369
|
+
</View>
|
|
370
|
+
) : (
|
|
371
|
+
<>
|
|
372
|
+
<OText size={16}>{t('DELIVERY_OPTIONS', 'Delivery options')}</OText>
|
|
373
|
+
<View
|
|
374
|
+
style={{
|
|
375
|
+
backgroundColor: theme.colors.inputDisabled,
|
|
376
|
+
borderRadius: 7.5,
|
|
377
|
+
marginBottom: 20,
|
|
378
|
+
flex: 1
|
|
379
|
+
}}>
|
|
380
|
+
<Picker
|
|
381
|
+
countryCode={undefined}
|
|
382
|
+
visible={isDeliveryOptionModalVisible}
|
|
383
|
+
onClose={() => setIsDeliveryOptionModalVisible(false)}
|
|
384
|
+
withCountryNameButton
|
|
385
|
+
renderFlagButton={() => (
|
|
386
|
+
<TouchableOpacity onPress={() => setIsDeliveryOptionModalVisible(true)}>
|
|
387
|
+
<DeliveryOptionItem backgroundColor={theme?.colors?.inputDisabled}>
|
|
388
|
+
<OText
|
|
389
|
+
size={14}
|
|
390
|
+
>
|
|
391
|
+
{deliveryOptions.find((option: any) => option.value === deliveryOptionSelected).label}
|
|
392
|
+
</OText>
|
|
393
|
+
<MaterialIcons name='keyboard-arrow-down' style={styles.icon} />
|
|
394
|
+
</DeliveryOptionItem>
|
|
395
|
+
</TouchableOpacity>
|
|
396
|
+
)}
|
|
397
|
+
flatListProps={{
|
|
398
|
+
keyExtractor: (item: any) => item.value,
|
|
399
|
+
data: deliveryOptions || [],
|
|
400
|
+
renderItem: ({ item }: any) => (
|
|
401
|
+
<TouchableOpacity
|
|
402
|
+
onPress={() => changeDeliveryOption(item.value)}
|
|
403
|
+
disabled={
|
|
404
|
+
deliveryOptionSelected === item.value
|
|
405
|
+
}
|
|
406
|
+
>
|
|
407
|
+
<DeliveryOptionItem backgroundColor={deliveryOptionSelected === item.value ? theme.colors.inputDisabled : 'white'}>
|
|
408
|
+
<OText>
|
|
409
|
+
{item.label}
|
|
410
|
+
</OText>
|
|
411
|
+
</DeliveryOptionItem>
|
|
412
|
+
</TouchableOpacity>
|
|
413
|
+
)
|
|
414
|
+
}}
|
|
415
|
+
/>
|
|
416
|
+
</View>
|
|
417
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40 }} />
|
|
418
|
+
</>
|
|
419
|
+
)}
|
|
420
|
+
|
|
409
421
|
</DeliveryOptionsContainer>
|
|
410
422
|
)}
|
|
411
423
|
|
|
@@ -436,7 +448,7 @@ const CheckoutUI = (props: any) => {
|
|
|
436
448
|
height={80}
|
|
437
449
|
borderRadius={80}
|
|
438
450
|
/>
|
|
439
|
-
<View style={{ marginLeft:
|
|
451
|
+
<View style={{ marginLeft: 10, width: '85%' }}>
|
|
440
452
|
<OText size={22} numberOfLines={2} ellipsizeMode='tail' style={{ width: '85%' }}>
|
|
441
453
|
{businessName || businessDetails?.business?.name}
|
|
442
454
|
</OText>
|
|
@@ -530,14 +542,14 @@ const CheckoutUI = (props: any) => {
|
|
|
530
542
|
</ChSection>
|
|
531
543
|
)}
|
|
532
544
|
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
545
|
+
{!cartState.loading && cart && isWalletEnabled && (
|
|
546
|
+
<WalletPaymentOptionContainer>
|
|
547
|
+
<PaymentOptionWallet
|
|
548
|
+
cart={cart}
|
|
549
|
+
businessId={cart?.business_id}
|
|
550
|
+
/>
|
|
551
|
+
</WalletPaymentOptionContainer>
|
|
552
|
+
)}
|
|
541
553
|
|
|
542
554
|
|
|
543
555
|
{!cartState.loading && cart && (
|
|
@@ -571,7 +583,7 @@ const CheckoutUI = (props: any) => {
|
|
|
571
583
|
<OrderSummary
|
|
572
584
|
cart={cart}
|
|
573
585
|
isCartPending={cart?.status === 2}
|
|
574
|
-
|
|
586
|
+
onNavigationRedirect={onNavigationRedirect}
|
|
575
587
|
/>
|
|
576
588
|
</>
|
|
577
589
|
)}
|
|
@@ -580,7 +592,7 @@ const CheckoutUI = (props: any) => {
|
|
|
580
592
|
)}
|
|
581
593
|
|
|
582
594
|
{!cartState.loading && cart && (
|
|
583
|
-
|
|
595
|
+
<View>
|
|
584
596
|
<ChErrors style={{ marginBottom: 0 }}>
|
|
585
597
|
{!cart?.valid_address && cart?.status !== 2 && (
|
|
586
598
|
<OText
|
|
@@ -641,7 +653,7 @@ const CheckoutUI = (props: any) => {
|
|
|
641
653
|
}
|
|
642
654
|
btnRightValueShow
|
|
643
655
|
btnRightValue={parsePrice(cart?.total)}
|
|
644
|
-
iosBottom={
|
|
656
|
+
iosBottom={30}
|
|
645
657
|
/>
|
|
646
658
|
)}
|
|
647
659
|
{webviewPaymethod?.gateway === 'paypal' && showGateway.open && (
|
|
@@ -102,7 +102,8 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
102
102
|
},
|
|
103
103
|
});
|
|
104
104
|
|
|
105
|
-
const
|
|
105
|
+
const emailRef = useRef<any>({});
|
|
106
|
+
const passwordRef = useRef<any>({});
|
|
106
107
|
|
|
107
108
|
const handleChangeTab = (val: string) => {
|
|
108
109
|
props.handleChangeTab(val);
|
|
@@ -299,8 +300,9 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
299
300
|
type="email-address"
|
|
300
301
|
autoCompleteType="email"
|
|
301
302
|
returnKeyType="next"
|
|
302
|
-
onSubmitEditing={() =>
|
|
303
|
+
onSubmitEditing={() => passwordRef.current?.focus()}
|
|
303
304
|
blurOnSubmit={false}
|
|
305
|
+
forwardRef={emailRef}
|
|
304
306
|
/>
|
|
305
307
|
)}
|
|
306
308
|
name="email"
|
|
@@ -327,7 +329,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
327
329
|
handleData={(val: any) => setPhoneInputData(val)}
|
|
328
330
|
textInputProps={{
|
|
329
331
|
returnKeyType: 'next',
|
|
330
|
-
onSubmitEditing: () =>
|
|
332
|
+
onSubmitEditing: () => passwordRef?.current?.focus?.(),
|
|
331
333
|
}}
|
|
332
334
|
/>
|
|
333
335
|
</View>
|
|
@@ -359,7 +361,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
359
361
|
)
|
|
360
362
|
}
|
|
361
363
|
value={value}
|
|
362
|
-
forwardRef={
|
|
364
|
+
forwardRef={passwordRef}
|
|
363
365
|
onChange={(val: any) => onChange(val)}
|
|
364
366
|
returnKeyType="done"
|
|
365
367
|
onSubmitEditing={handleSubmit(onSubmit)}
|
|
@@ -47,6 +47,7 @@ import { verifyDecimals } from '../../utils';
|
|
|
47
47
|
import { OSRow } from '../OrderSummary/styles';
|
|
48
48
|
import AntIcon from 'react-native-vector-icons/AntDesign'
|
|
49
49
|
import { TaxInformation } from '../TaxInformation';
|
|
50
|
+
import { Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
50
51
|
|
|
51
52
|
export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
52
53
|
const {
|
|
@@ -421,7 +422,58 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
421
422
|
|
|
422
423
|
return (
|
|
423
424
|
<OrderDetailsContainer keyboardShouldPersistTaps="handled">
|
|
424
|
-
|
|
425
|
+
{(!order || Object.keys(order).length === 0) && (
|
|
426
|
+
<Placeholder style={{ marginTop: 30 }}>
|
|
427
|
+
<Header>
|
|
428
|
+
<OrderInfo>
|
|
429
|
+
<OrderData>
|
|
430
|
+
<PlaceholderLine width={60} height={15} />
|
|
431
|
+
<PlaceholderLine width={60} height={10} />
|
|
432
|
+
<StaturBar>
|
|
433
|
+
<PlaceholderLine height={15} />
|
|
434
|
+
<PlaceholderLine width={40} height={20} />
|
|
435
|
+
</StaturBar>
|
|
436
|
+
</OrderData>
|
|
437
|
+
<View
|
|
438
|
+
style={{
|
|
439
|
+
height: 8,
|
|
440
|
+
backgroundColor: theme.colors.backgroundGray100,
|
|
441
|
+
marginTop: 18,
|
|
442
|
+
marginHorizontal: -40,
|
|
443
|
+
}}
|
|
444
|
+
/>
|
|
445
|
+
</OrderInfo>
|
|
446
|
+
</Header>
|
|
447
|
+
<OrderContent>
|
|
448
|
+
<OrderBusiness>
|
|
449
|
+
<PlaceholderLine width={30} height={20} />
|
|
450
|
+
<PlaceholderLine width={60} height={15} />
|
|
451
|
+
<PlaceholderLine width={75} height={10} />
|
|
452
|
+
<PlaceholderLine width={40} height={10} />
|
|
453
|
+
<PlaceholderLine width={95} height={10} />
|
|
454
|
+
</OrderBusiness>
|
|
455
|
+
</OrderContent>
|
|
456
|
+
<View
|
|
457
|
+
style={{
|
|
458
|
+
height: 8,
|
|
459
|
+
backgroundColor: theme.colors.backgroundGray100,
|
|
460
|
+
marginTop: 18,
|
|
461
|
+
marginHorizontal: -40,
|
|
462
|
+
}}
|
|
463
|
+
/>
|
|
464
|
+
<OrderCustomer>
|
|
465
|
+
<PlaceholderLine width={20} height={20} />
|
|
466
|
+
<PlaceholderLine width={70} height={15} />
|
|
467
|
+
<PlaceholderLine width={65} height={10} />
|
|
468
|
+
<PlaceholderLine width={80} height={10} />
|
|
469
|
+
<PlaceholderLine width={70} height={10} />
|
|
470
|
+
<View style={{marginTop: 10}}>
|
|
471
|
+
<PlaceholderLine width={60} height={20} />
|
|
472
|
+
<PlaceholderLine width={40} height={10} />
|
|
473
|
+
</View>
|
|
474
|
+
</OrderCustomer>
|
|
475
|
+
</Placeholder>
|
|
476
|
+
)}
|
|
425
477
|
{order && Object.keys(order).length > 0 && (
|
|
426
478
|
<>
|
|
427
479
|
<Header>
|
|
@@ -768,7 +820,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
768
820
|
)}
|
|
769
821
|
</OText>
|
|
770
822
|
<TouchableOpacity style={{ marginLeft: 5 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_1' })}>
|
|
771
|
-
<AntIcon name='
|
|
823
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
772
824
|
</TouchableOpacity>
|
|
773
825
|
</OSRow>
|
|
774
826
|
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
@@ -816,7 +868,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
816
868
|
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
|
|
817
869
|
</OText>
|
|
818
870
|
<TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: tax, type: 'tax' })}>
|
|
819
|
-
<AntIcon name='
|
|
871
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
820
872
|
</TouchableOpacity>
|
|
821
873
|
</OSRow>
|
|
822
874
|
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0)}</OText>
|
|
@@ -832,7 +884,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
832
884
|
({parsePrice(fee?.fixed)} + {fee.percentage}%){' '}
|
|
833
885
|
</OText>
|
|
834
886
|
<TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })}>
|
|
835
|
-
<AntIcon name='
|
|
887
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
836
888
|
</TouchableOpacity>
|
|
837
889
|
</OSRow>
|
|
838
890
|
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0)}</OText>
|
|
@@ -850,7 +902,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
850
902
|
)}
|
|
851
903
|
</OText>
|
|
852
904
|
<TouchableOpacity style={{ marginLeft: 5 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_3' })}>
|
|
853
|
-
<AntIcon name='
|
|
905
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
854
906
|
</TouchableOpacity>
|
|
855
907
|
</OSRow>
|
|
856
908
|
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
@@ -874,7 +926,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
874
926
|
)}
|
|
875
927
|
</OText>
|
|
876
928
|
<TouchableOpacity style={{ marginLeft: 5 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_2' })}>
|
|
877
|
-
<AntIcon name='
|
|
929
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
878
930
|
</TouchableOpacity>
|
|
879
931
|
</OSRow>
|
|
880
932
|
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
@@ -21,14 +21,16 @@ import {
|
|
|
21
21
|
} from './styles'
|
|
22
22
|
|
|
23
23
|
const OrderProgressUI = (props: any) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
navigation
|
|
27
|
-
|
|
24
|
+
const {
|
|
25
|
+
orderList,
|
|
26
|
+
navigation,
|
|
27
|
+
loadOrders,
|
|
28
|
+
isFocused
|
|
29
|
+
} = props
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
const theme = useTheme();
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
const [, t] = useLanguage()
|
|
32
34
|
const [{ optimizeImage, parseDate, parseTime }] = useUtils()
|
|
33
35
|
const [lastOrder, setLastOrder] = useState<any>(null)
|
|
34
36
|
const imageFails = theme.images.general.emptyActiveOrders
|
|
@@ -53,11 +55,11 @@ const OrderProgressUI = (props: any) => {
|
|
|
53
55
|
overflow: 'hidden',
|
|
54
56
|
backgroundColor: 'white',
|
|
55
57
|
borderRadius: 8,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
shadowColor: '#000000',
|
|
59
|
+
shadowOffset: { width: 1, height: 1 },
|
|
60
|
+
shadowOpacity: 0.1,
|
|
61
|
+
shadowRadius: 1,
|
|
62
|
+
elevation: 3
|
|
61
63
|
},
|
|
62
64
|
logo: {
|
|
63
65
|
width: 50,
|
|
@@ -69,10 +71,10 @@ const OrderProgressUI = (props: any) => {
|
|
|
69
71
|
flexDirection: 'row',
|
|
70
72
|
alignItems: 'center'
|
|
71
73
|
}
|
|
72
|
-
|
|
74
|
+
});
|
|
73
75
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
const getOrderStatus = (s: any) => {
|
|
77
|
+
const status = parseInt(s)
|
|
76
78
|
const orderStatus = [
|
|
77
79
|
{ key: 0, value: t('PENDING', theme?.defaultLanguages?.PENDING || 'Pending'), slug: 'PENDING', percentage: 25 },
|
|
78
80
|
{ key: 1, value: t('COMPLETED', theme?.defaultLanguages?.COMPLETED || 'Completed'), slug: 'COMPLETED', percentage: 100 },
|
|
@@ -98,10 +100,10 @@ const OrderProgressUI = (props: any) => {
|
|
|
98
100
|
{ key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ARRIVED_BUSINESS || 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95 }
|
|
99
101
|
]
|
|
100
102
|
|
|
101
|
-
|
|
103
|
+
const objectStatus = orderStatus.find((o) => o.key === status)
|
|
102
104
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
return objectStatus && objectStatus
|
|
106
|
+
}
|
|
105
107
|
|
|
106
108
|
const convertDiffToHours = (order: any) => {
|
|
107
109
|
const time = order.delivery_type === 1 ? order?.business?.delivery_time : order?.business?.pickup_time
|
|
@@ -120,18 +122,24 @@ const OrderProgressUI = (props: any) => {
|
|
|
120
122
|
|
|
121
123
|
useEffect(() => {
|
|
122
124
|
if (orderList?.orders.length > 0) {
|
|
123
|
-
const sortedOrders = orderList.orders.sort((a: any, b:any) => a.id > b.id ? -1 : 1)
|
|
125
|
+
const sortedOrders = orderList.orders.sort((a: any, b: any) => a.id > b.id ? -1 : 1)
|
|
124
126
|
setLastOrder(sortedOrders[0])
|
|
125
127
|
}
|
|
126
128
|
}, [orderList?.orders])
|
|
127
129
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
if (isFocused) {
|
|
132
|
+
loadOrders()
|
|
133
|
+
}
|
|
134
|
+
}, [isFocused])
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<>
|
|
130
138
|
{orderList?.loading && (
|
|
131
|
-
<Placeholder Animation={Fade} height={
|
|
132
|
-
<PlaceholderLine height={
|
|
133
|
-
<PlaceholderLine height={
|
|
134
|
-
<PlaceholderLine height={
|
|
139
|
+
<Placeholder Animation={Fade} height={160}>
|
|
140
|
+
<PlaceholderLine height={60} style={{ borderRadius: 8, marginBottom: 10 }} />
|
|
141
|
+
<PlaceholderLine height={20} style={{ marginBottom: 10 }} />
|
|
142
|
+
<PlaceholderLine height={40} style={{ borderRadius: 8, marginBottom: 10 }} />
|
|
135
143
|
</Placeholder>
|
|
136
144
|
)}
|
|
137
145
|
{!orderList?.loading && orderList?.orders?.length > 0 && lastOrder && (
|
|
@@ -141,8 +149,8 @@ const OrderProgressUI = (props: any) => {
|
|
|
141
149
|
<FastImage
|
|
142
150
|
style={{ width: 50, height: 50 }}
|
|
143
151
|
source={{
|
|
144
|
-
|
|
145
|
-
|
|
152
|
+
uri: optimizeImage(lastOrder?.business?.logo, 'h_50,c_limit'),
|
|
153
|
+
priority: FastImage.priority.normal,
|
|
146
154
|
}}
|
|
147
155
|
resizeMode={FastImage.resizeMode.cover}
|
|
148
156
|
/>
|
|
@@ -150,7 +158,7 @@ const OrderProgressUI = (props: any) => {
|
|
|
150
158
|
<View style={{
|
|
151
159
|
paddingHorizontal: 10,
|
|
152
160
|
flex: 1
|
|
153
|
-
|
|
161
|
+
}}
|
|
154
162
|
>
|
|
155
163
|
<OText
|
|
156
164
|
size={13}
|
|
@@ -185,7 +193,7 @@ const OrderProgressUI = (props: any) => {
|
|
|
185
193
|
{lastOrder?.delivery_datetime_utc
|
|
186
194
|
? parseTime(lastOrder?.delivery_datetime_utc, { outputFormat: 'hh:mm A' })
|
|
187
195
|
: parseTime(lastOrder?.delivery_datetime, { utc: false })}
|
|
188
|
-
|
|
196
|
+
-
|
|
189
197
|
{convertDiffToHours(lastOrder)}
|
|
190
198
|
</OText>
|
|
191
199
|
</TimeWrapper>
|
|
@@ -200,8 +208,8 @@ const OrderProgressUI = (props: any) => {
|
|
|
200
208
|
conditioned
|
|
201
209
|
/>
|
|
202
210
|
)} */}
|
|
203
|
-
|
|
204
|
-
|
|
211
|
+
</>
|
|
212
|
+
)
|
|
205
213
|
}
|
|
206
214
|
|
|
207
215
|
export const OrderProgress = (props: any) => {
|
|
@@ -217,6 +225,6 @@ export const OrderProgress = (props: any) => {
|
|
|
217
225
|
}
|
|
218
226
|
}
|
|
219
227
|
|
|
220
|
-
|
|
228
|
+
return <OrderList {...orderProgressProps} />
|
|
221
229
|
|
|
222
230
|
}
|
|
@@ -154,10 +154,10 @@ const OrderSummaryUI = (props: any) => {
|
|
|
154
154
|
<OText size={12}>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
155
155
|
)}
|
|
156
156
|
<TouchableOpacity style={{ marginLeft: 3 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_1' })}>
|
|
157
|
-
<AntIcon name='
|
|
157
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
158
158
|
</TouchableOpacity>
|
|
159
159
|
<TouchableOpacity style={{ marginLeft: 3 }} onPress={() => onRemoveOffer(offer?.id)}>
|
|
160
|
-
<AntIcon name='closecircle' size={
|
|
160
|
+
<AntIcon name='closecircle' size={16} color={theme.colors.primary} />
|
|
161
161
|
</TouchableOpacity>
|
|
162
162
|
</OSRow>
|
|
163
163
|
<OText size={12}>
|
|
@@ -186,7 +186,7 @@ const OrderSummaryUI = (props: any) => {
|
|
|
186
186
|
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
|
|
187
187
|
</OText>
|
|
188
188
|
<TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: tax, type: 'tax' })} >
|
|
189
|
-
<AntIcon name='
|
|
189
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
190
190
|
</TouchableOpacity>
|
|
191
191
|
</OSRow>
|
|
192
192
|
<OText size={12}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0)}</OText>
|
|
@@ -202,7 +202,7 @@ const OrderSummaryUI = (props: any) => {
|
|
|
202
202
|
({parsePrice(fee?.fixed)} + {fee?.percentage}%){' '}
|
|
203
203
|
</OText>
|
|
204
204
|
<TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })} >
|
|
205
|
-
<AntIcon name='
|
|
205
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
206
206
|
</TouchableOpacity>
|
|
207
207
|
</OSRow>
|
|
208
208
|
<OText size={12}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0)}</OText>
|
|
@@ -218,10 +218,10 @@ const OrderSummaryUI = (props: any) => {
|
|
|
218
218
|
<OText size={12}>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
219
219
|
)}
|
|
220
220
|
<TouchableOpacity style={{ marginLeft: 3 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_3' })}>
|
|
221
|
-
<AntIcon name='
|
|
221
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
222
222
|
</TouchableOpacity>
|
|
223
223
|
<TouchableOpacity style={{ marginLeft: 3 }} onPress={() => onRemoveOffer(offer?.id)}>
|
|
224
|
-
<AntIcon name='closecircle' size={
|
|
224
|
+
<AntIcon name='closecircle' size={16} color={theme.colors.primary} />
|
|
225
225
|
</TouchableOpacity>
|
|
226
226
|
</OSRow>
|
|
227
227
|
<OText size={12}>
|
|
@@ -245,10 +245,10 @@ const OrderSummaryUI = (props: any) => {
|
|
|
245
245
|
<OText size={12}>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
246
246
|
)}
|
|
247
247
|
<TouchableOpacity style={{ marginLeft: 3 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_2' })}>
|
|
248
|
-
<AntIcon name='
|
|
248
|
+
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
249
249
|
</TouchableOpacity>
|
|
250
250
|
<TouchableOpacity style={{ marginLeft: 3 }} onPress={() => onRemoveOffer(offer?.id)}>
|
|
251
|
-
<AntIcon name='closecircle' size={
|
|
251
|
+
<AntIcon name='closecircle' size={16} color={theme.colors.primary} />
|
|
252
252
|
</TouchableOpacity>
|
|
253
253
|
</OSRow>
|
|
254
254
|
<OText size={12}>
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
Grayscale
|
|
21
21
|
} from 'react-native-color-matrix-image-filters'
|
|
22
22
|
|
|
23
|
-
import { View, TouchableOpacity, StyleSheet, Dimensions, I18nManager, SafeAreaView,
|
|
23
|
+
import { View, TouchableOpacity, StyleSheet, Dimensions, I18nManager, SafeAreaView, Platform, Button } from 'react-native';
|
|
24
24
|
|
|
25
25
|
import {
|
|
26
26
|
WrapHeader,
|
|
@@ -829,7 +829,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
829
829
|
)}
|
|
830
830
|
</ScrollView>
|
|
831
831
|
{!loading && !error && product && (
|
|
832
|
-
<ProductActions>
|
|
832
|
+
<ProductActions ios={Platform?.OS === 'ios'}>
|
|
833
833
|
<OText size={16} lineHeight={24} weight={'600'}>
|
|
834
834
|
{productCart.total ? parsePrice(productCart?.total) : ''}
|
|
835
835
|
</OText>
|
|
@@ -52,7 +52,7 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
52
52
|
const disableIncrement = option?.limit_suboptions_by_max ? balance === option?.max : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
|
|
53
53
|
const price = option?.with_half_option && suboption?.half_price && state.position !== 'whole' ? suboption?.half_price : suboption?.price
|
|
54
54
|
return (
|
|
55
|
-
<Container>
|
|
55
|
+
<Container onPress={() => handleSuboptionClick()}>
|
|
56
56
|
<IconControl disabled={disabled} onPress={() => handleSuboptionClick()}>
|
|
57
57
|
{((option?.min === 0 && option?.max === 1) || option?.max > 1) ? (
|
|
58
58
|
state?.selected ? (
|