@homefile/components-v2 2.7.24 → 2.7.26

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.
@@ -2,10 +2,5 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  import { MyProfileReceipts, CreditCardContainer } from '..';
3
3
  export const ProfilePaymentTab = ({ paymentMethod, receipts, handleDelete, handleNewCard, }) => {
4
4
  const hasReceipts = receipts.length > 0;
5
- const { brand, number, isPaymentMethodValid } = paymentMethod || {
6
- brand: '',
7
- number: '',
8
- isPaymentMethodValid: false,
9
- };
10
- return (_jsxs(_Fragment, { children: [_jsx(CreditCardContainer, { brand: brand, cardNumber: number, hasError: !isPaymentMethodValid, onAddCard: handleNewCard, onDeleteCard: handleDelete, onSubmit: () => null, cardHolder: '', cvv: '', expirationMonth: '', expirationYear: '' }), hasReceipts && _jsx(MyProfileReceipts, { receipts })] }));
5
+ return (_jsxs(_Fragment, { children: [(paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.isPaymentMethodValid) && (_jsx(CreditCardContainer, { brand: paymentMethod.brand, cardNumber: paymentMethod.number, hasError: !paymentMethod.isPaymentMethodValid, onAddCard: handleNewCard, onDeleteCard: handleDelete, onSubmit: () => null, cardHolder: '', cvv: '', expirationMonth: '', expirationYear: '' })), hasReceipts && _jsx(MyProfileReceipts, { receipts })] }));
11
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.7.24",
3
+ "version": "2.7.26",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -8,26 +8,23 @@ export const ProfilePaymentTab = ({
8
8
  handleNewCard,
9
9
  }: ProfilePaymentTabI) => {
10
10
  const hasReceipts = receipts.length > 0
11
- const { brand, number, isPaymentMethodValid } = paymentMethod || {
12
- brand: '',
13
- number: '',
14
- isPaymentMethodValid: false,
15
- }
16
11
 
17
12
  return (
18
13
  <>
19
- <CreditCardContainer
20
- brand={brand}
21
- cardNumber={number}
22
- hasError={!isPaymentMethodValid}
23
- onAddCard={handleNewCard}
24
- onDeleteCard={handleDelete}
25
- onSubmit={() => null}
26
- cardHolder={''}
27
- cvv={''}
28
- expirationMonth={''}
29
- expirationYear={''}
30
- />
14
+ {paymentMethod?.isPaymentMethodValid && (
15
+ <CreditCardContainer
16
+ brand={paymentMethod.brand}
17
+ cardNumber={paymentMethod.number}
18
+ hasError={!paymentMethod.isPaymentMethodValid}
19
+ onAddCard={handleNewCard}
20
+ onDeleteCard={handleDelete}
21
+ onSubmit={() => null}
22
+ cardHolder={''}
23
+ cvv={''}
24
+ expirationMonth={''}
25
+ expirationYear={''}
26
+ />
27
+ )}
31
28
  {hasReceipts && <MyProfileReceipts {...{ receipts }} />}
32
29
  </>
33
30
  )