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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.12.92",
3
+ "version": "0.12.93",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -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
- <View style={styles.quantityControl}>
575
- <TouchableOpacity
576
- onPress={decrement}
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
- <TouchableOpacity
595
- onPress={increment}
596
- disabled={
597
- maxProductQuantity <= 0 ||
598
- productCart.quantity >= maxProductQuantity ||
599
- isSoldOut
600
- }>
601
- <OIcon
602
- src={theme.images.general.plus}
603
- width={16}
604
- color={
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
- productCart.quantity >= maxProductQuantity ||
607
- isSoldOut
608
- ? theme.colors.backgroundGray
609
- : theme.colors.backgroundDark
610
- }
611
- />
612
- </TouchableOpacity>
613
- </View>
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
- width: isSoldOut || maxProductQuantity <= 0 ? '100%' : '40%',
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
- <OButton
625
- onClick={() => handleSaveProduct()}
626
- imgRightSrc=""
627
- text={`${orderState.loading
628
- ? t('LOADING', 'Loading')
629
- : editMode
630
- ? t('UPDATE', 'Update')
631
- : t('ADD', 'Add')
632
- }`}
633
- textStyle={{
634
- color: saveErrors ? theme.colors.primary : theme.colors.white,
635
- }}
636
- style={{
637
- backgroundColor: saveErrors ? theme.colors.white : theme.colors.primary,
638
- borderColor: saveErrors ? theme.colors.white : theme.colors.primary,
639
- opacity: saveErrors ? 0.3 : 1,
640
- borderRadius: 7.6,
641
- height: 44,
642
- shadowOpacity: 0,
643
- borderWidth: 1,
644
- }}
645
- />
646
- )}
647
- {auth &&
648
- !orderState.options?.address_id &&
649
- (orderState.loading ? (
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
  )}