ordering-ui-react-native 0.12.92 → 0.12.93
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
CHANGED
|
@@ -567,86 +567,87 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
567
567
|
|
|
568
568
|
{!loading && !error && product && (
|
|
569
569
|
<ProductActions>
|
|
570
|
-
<OText size={16} lineHeight={24} weight={'600'}>
|
|
571
|
-
{productCart.total ? parsePrice(productCart?.total) : ''}
|
|
572
|
-
</OText>
|
|
573
570
|
{productCart && !isSoldOut && maxProductQuantity > 0 && (
|
|
574
|
-
|
|
575
|
-
<
|
|
576
|
-
|
|
577
|
-
disabled={productCart.quantity === 1 || isSoldOut}>
|
|
578
|
-
<OIcon
|
|
579
|
-
src={theme.images.general.minus}
|
|
580
|
-
width={16}
|
|
581
|
-
color={
|
|
582
|
-
productCart.quantity === 1 || isSoldOut
|
|
583
|
-
? theme.colors.backgroundGray
|
|
584
|
-
: theme.colors.backgroundDark
|
|
585
|
-
}
|
|
586
|
-
/>
|
|
587
|
-
</TouchableOpacity>
|
|
588
|
-
<OText
|
|
589
|
-
size={12}
|
|
590
|
-
lineHeight={18}
|
|
591
|
-
style={{ minWidth: 29, textAlign: 'center' }}>
|
|
592
|
-
{productCart.quantity}
|
|
571
|
+
<>
|
|
572
|
+
<OText size={16} lineHeight={24} weight={'600'}>
|
|
573
|
+
{productCart.total ? parsePrice(productCart?.total) : ''}
|
|
593
574
|
</OText>
|
|
594
|
-
<
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
575
|
+
<View style={styles.quantityControl}>
|
|
576
|
+
<TouchableOpacity
|
|
577
|
+
onPress={decrement}
|
|
578
|
+
disabled={productCart.quantity === 1 || isSoldOut}>
|
|
579
|
+
<OIcon
|
|
580
|
+
src={theme.images.general.minus}
|
|
581
|
+
width={16}
|
|
582
|
+
color={
|
|
583
|
+
productCart.quantity === 1 || isSoldOut
|
|
584
|
+
? theme.colors.backgroundGray
|
|
585
|
+
: theme.colors.backgroundDark
|
|
586
|
+
}
|
|
587
|
+
/>
|
|
588
|
+
</TouchableOpacity>
|
|
589
|
+
<OText
|
|
590
|
+
size={12}
|
|
591
|
+
lineHeight={18}
|
|
592
|
+
style={{ minWidth: 29, textAlign: 'center' }}>
|
|
593
|
+
{productCart.quantity}
|
|
594
|
+
</OText>
|
|
595
|
+
<TouchableOpacity
|
|
596
|
+
onPress={increment}
|
|
597
|
+
disabled={
|
|
605
598
|
maxProductQuantity <= 0 ||
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
599
|
+
productCart.quantity >= maxProductQuantity ||
|
|
600
|
+
isSoldOut
|
|
601
|
+
}>
|
|
602
|
+
<OIcon
|
|
603
|
+
src={theme.images.general.plus}
|
|
604
|
+
width={16}
|
|
605
|
+
color={
|
|
606
|
+
maxProductQuantity <= 0 ||
|
|
607
|
+
productCart.quantity >= maxProductQuantity ||
|
|
608
|
+
isSoldOut
|
|
609
|
+
? theme.colors.backgroundGray
|
|
610
|
+
: theme.colors.backgroundDark
|
|
611
|
+
}
|
|
612
|
+
/>
|
|
613
|
+
</TouchableOpacity>
|
|
614
|
+
</View>
|
|
615
|
+
</>
|
|
614
616
|
)}
|
|
615
617
|
<View
|
|
616
|
-
style={{
|
|
617
|
-
|
|
618
|
-
}}>
|
|
618
|
+
style={{ width: isSoldOut || maxProductQuantity <= 0 ? '100%' : '40%'}}
|
|
619
|
+
>
|
|
619
620
|
{productCart &&
|
|
620
621
|
!isSoldOut &&
|
|
621
622
|
maxProductQuantity > 0 &&
|
|
622
623
|
auth &&
|
|
623
|
-
orderState.options?.address_id &&
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
624
|
+
orderState.options?.address_id &&
|
|
625
|
+
(
|
|
626
|
+
<OButton
|
|
627
|
+
onClick={() => handleSaveProduct()}
|
|
628
|
+
imgRightSrc=""
|
|
629
|
+
text={`${orderState.loading
|
|
630
|
+
? t('LOADING', 'Loading')
|
|
631
|
+
: editMode
|
|
632
|
+
? t('UPDATE', 'Update')
|
|
633
|
+
: t('ADD', 'Add')
|
|
634
|
+
}`}
|
|
635
|
+
textStyle={{
|
|
636
|
+
color: saveErrors ? theme.colors.primary : theme.colors.white,
|
|
637
|
+
}}
|
|
638
|
+
style={{
|
|
639
|
+
backgroundColor: saveErrors ? theme.colors.white : theme.colors.primary,
|
|
640
|
+
borderColor: saveErrors ? theme.colors.white : theme.colors.primary,
|
|
641
|
+
opacity: saveErrors ? 0.3 : 1,
|
|
642
|
+
borderRadius: 7.6,
|
|
643
|
+
height: 44,
|
|
644
|
+
shadowOpacity: 0,
|
|
645
|
+
borderWidth: 1,
|
|
646
|
+
}}
|
|
647
|
+
/>
|
|
648
|
+
)}
|
|
649
|
+
{auth && !orderState.options?.address_id &&(
|
|
650
|
+
orderState.loading ? (
|
|
650
651
|
<OButton
|
|
651
652
|
isDisabled
|
|
652
653
|
text={t('LOADING', 'Loading')}
|
|
@@ -654,7 +655,8 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
654
655
|
/>
|
|
655
656
|
) : (
|
|
656
657
|
<OButton onClick={navigation.navigate('AddressList')} />
|
|
657
|
-
))
|
|
658
|
+
))
|
|
659
|
+
}
|
|
658
660
|
{(!auth || isSoldOut || maxProductQuantity <= 0) && (
|
|
659
661
|
<OButton
|
|
660
662
|
isDisabled={isSoldOut || maxProductQuantity <= 0}
|
|
@@ -669,6 +671,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
669
671
|
style={{
|
|
670
672
|
borderColor: theme.colors.primary,
|
|
671
673
|
backgroundColor: theme.colors.white,
|
|
674
|
+
borderRadius: 8
|
|
672
675
|
}}
|
|
673
676
|
/>
|
|
674
677
|
)}
|