ordering-ui-react-native 0.22.4 → 0.22.6

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.22.04",
3
+ "version": "0.22.06",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -77,6 +77,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
77
77
  const [printerSettings, setPrinterSettings] = useState('')
78
78
  const [autoPrintEnabled, setAutoPrintEnabled] = useState<boolean>(false)
79
79
 
80
+ const orderToComplete = [4,20,21]
81
+
80
82
  if (order?.status === 7 || order?.status === 4) {
81
83
  if (drivers?.length > 0 && drivers) {
82
84
  drivers.forEach((driver: any) => {
@@ -667,7 +669,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
667
669
  disabled={loading}
668
670
  />
669
671
  )}
670
- {order?.status === 4 && ![1].includes(order?.delivery_type) && (
672
+ {orderToComplete.includes(order?.status) && ![1].includes(order?.delivery_type) && (
671
673
  <FloatingButton
672
674
  btnText={t(
673
675
  'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
@@ -344,10 +344,11 @@ const PaymentOptionsUI = (props: any) => {
344
344
  setAddCardOpen={setAddCardOpen}
345
345
  addCardOpen={addCardOpen}
346
346
  isOpenMethod={isOpenMethod}
347
- handlePaymethodDataChange={handlePaymethodDataChange}
347
+ handleSource={handlePaymethodDataChange}
348
348
  clientSecret={props.clientSecret}
349
349
  businessId={props.businessId}
350
350
  onPaymentChange={onPaymentChange}
351
+ paySelected={props.paySelected}
351
352
  />
352
353
  </View>
353
354
  )}
@@ -414,6 +415,7 @@ const PaymentOptionsUI = (props: any) => {
414
415
  urlscheme={urlscheme}
415
416
  androidAppId={androidAppId}
416
417
  publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
418
+ paySelected={props.paySelected}
417
419
  />
418
420
  </KeyboardAvoidingView>
419
421
  </OModal>
@@ -439,6 +441,7 @@ const PaymentOptionsUI = (props: any) => {
439
441
  onCancel={() => handlePaymethodClick(null)}
440
442
  publicKey={isOpenMethod?.paymethod?.credentials.publishable}
441
443
  publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
444
+ paySelected={props.paySelected}
442
445
  />
443
446
  </View>
444
447
  )}
@@ -489,6 +492,7 @@ const PaymentOptionsUI = (props: any) => {
489
492
  publicKey={props.publicKey || isOpenMethod?.paymethod?.credentials?.publishable}
490
493
  setCardsList={setCardList}
491
494
  requirements={props.clientSecret}
495
+ handleSource={handlePaymethodDataChange}
492
496
  onSelectCard={handlePaymethodDataChange}
493
497
  onCancel={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
494
498
  publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable || isOpenMethod?.paymethod?.credentials?.publishable}
@@ -31,6 +31,7 @@ export const StripeCardsListUI = (props: any) => {
31
31
  handleCardClick,
32
32
  onOpen,
33
33
  gateway,
34
+ paySelected
34
35
  } = props;
35
36
 
36
37
  const theme = useTheme();
@@ -93,10 +94,9 @@ export const StripeCardsListUI = (props: any) => {
93
94
  >
94
95
  {cardsList.cards.map((card: any) => (
95
96
  <OSItem key={card.id} isUnique={cardsList.cards.length} isInvalid={!card?.zipcode && validateZipcodeCard}>
96
- {console.log(card?.zipcode && validateZipcodeCard)}
97
97
  <OSItemContent onPress={() => handleCardSelected(card)}>
98
98
  <View style={styles.viewStyle}>
99
- {card.id === cardSelected?.id ? (
99
+ {(card.id === cardSelected?.id || card.id === paySelected?.data?.id) ? (
100
100
  <OIcon
101
101
  src={theme.images.general.radio_act}
102
102
  width={16}