@blocklet/payment-react 1.18.56 → 1.19.0
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/es/checkout/donate.d.ts +1 -15
- package/es/checkout/donate.js +301 -189
- package/es/checkout/form.d.ts +1 -15
- package/es/checkout/form.js +5 -13
- package/es/checkout/table.js +3 -3
- package/es/components/blockchain/gas.d.ts +1 -5
- package/es/components/blockchain/gas.js +10 -2
- package/es/components/blockchain/tx.d.ts +1 -8
- package/es/components/blockchain/tx.js +28 -7
- package/es/components/confirm.d.ts +1 -10
- package/es/components/confirm.js +4 -10
- package/es/components/country-select.d.ts +3 -2
- package/es/components/country-select.js +375 -352
- package/es/components/input.d.ts +11 -20
- package/es/components/input.js +46 -43
- package/es/components/lazy-loader.js +1 -2
- package/es/components/link.d.ts +2 -9
- package/es/components/link.js +9 -6
- package/es/components/livemode.d.ts +2 -8
- package/es/components/livemode.js +1 -5
- package/es/components/loading-button.d.ts +6 -1
- package/es/components/loading-button.js +56 -66
- package/es/components/over-due-invoice-payment.d.ts +0 -18
- package/es/components/over-due-invoice-payment.js +138 -95
- package/es/components/payment-beneficiaries.d.ts +2 -7
- package/es/components/payment-beneficiaries.js +86 -40
- package/es/components/pricing-item.d.ts +0 -5
- package/es/components/pricing-item.js +1 -4
- package/es/components/pricing-table.d.ts +2 -10
- package/es/components/pricing-table.js +8 -7
- package/es/components/resume-subscription.d.ts +0 -10
- package/es/components/resume-subscription.js +42 -21
- package/es/components/truncated-text.d.ts +2 -9
- package/es/components/truncated-text.js +0 -5
- package/es/contexts/donate.d.ts +0 -7
- package/es/contexts/donate.js +10 -8
- package/es/contexts/payment.d.ts +1 -4
- package/es/contexts/payment.js +7 -2
- package/es/history/invoice/list.d.ts +2 -18
- package/es/history/invoice/list.js +151 -73
- package/es/history/payment/list.js +115 -38
- package/es/hooks/keyboard.d.ts +1 -1
- package/es/hooks/keyboard.js +2 -4
- package/es/libs/cached-request.js +2 -4
- package/es/libs/phone-validator.js +1 -2
- package/es/libs/util.js +2 -4
- package/es/libs/validator.js +2 -4
- package/es/payment/amount.d.ts +2 -7
- package/es/payment/amount.js +1 -5
- package/es/payment/donation-form.d.ts +2 -10
- package/es/payment/donation-form.js +196 -160
- package/es/payment/error.d.ts +2 -8
- package/es/payment/error.js +40 -20
- package/es/payment/footer.d.ts +2 -3
- package/es/payment/footer.js +19 -6
- package/es/payment/form/addon.js +14 -4
- package/es/payment/form/address.d.ts +2 -9
- package/es/payment/form/address.js +3 -6
- package/es/payment/form/currency.js +45 -25
- package/es/payment/form/index.d.ts +2 -8
- package/es/payment/form/index.js +107 -65
- package/es/payment/form/phone.js +2 -4
- package/es/payment/form/stripe/form.d.ts +2 -8
- package/es/payment/form/stripe/form.js +1 -3
- package/es/payment/header.js +38 -16
- package/es/payment/index.d.ts +2 -9
- package/es/payment/index.js +5 -14
- package/es/payment/product-card.d.ts +2 -11
- package/es/payment/product-card.js +84 -50
- package/es/payment/product-donation.js +175 -114
- package/es/payment/product-item.d.ts +2 -9
- package/es/payment/product-item.js +185 -142
- package/es/payment/product-skeleton.js +2 -2
- package/es/payment/skeleton/donation.js +27 -7
- package/es/payment/skeleton/overview.js +22 -2
- package/es/payment/skeleton/payment.js +33 -5
- package/es/payment/success.d.ts +2 -9
- package/es/payment/success.js +41 -14
- package/es/payment/summary.d.ts +2 -17
- package/es/payment/summary.js +184 -111
- package/es/theme/index.d.ts +0 -5
- package/es/theme/index.js +2 -5
- package/es/theme/typography.d.ts +2 -2
- package/lib/checkout/donate.d.ts +1 -15
- package/lib/checkout/donate.js +75 -54
- package/lib/checkout/form.d.ts +1 -15
- package/lib/checkout/form.js +7 -15
- package/lib/checkout/table.js +4 -4
- package/lib/components/blockchain/gas.d.ts +1 -5
- package/lib/components/blockchain/gas.js +3 -2
- package/lib/components/blockchain/tx.d.ts +1 -8
- package/lib/components/blockchain/tx.js +11 -7
- package/lib/components/confirm.d.ts +1 -10
- package/lib/components/confirm.js +5 -11
- package/lib/components/country-select.d.ts +3 -2
- package/lib/components/country-select.js +23 -22
- package/lib/components/input.d.ts +11 -20
- package/lib/components/input.js +20 -23
- package/lib/components/lazy-loader.js +1 -1
- package/lib/components/link.d.ts +2 -9
- package/lib/components/link.js +3 -8
- package/lib/components/livemode.d.ts +2 -8
- package/lib/components/livemode.js +3 -7
- package/lib/components/loading-button.d.ts +6 -1
- package/lib/components/loading-button.js +9 -17
- package/lib/components/over-due-invoice-payment.d.ts +0 -18
- package/lib/components/over-due-invoice-payment.js +31 -33
- package/lib/components/payment-beneficiaries.d.ts +2 -7
- package/lib/components/payment-beneficiaries.js +12 -11
- package/lib/components/pricing-item.d.ts +0 -5
- package/lib/components/pricing-item.js +2 -5
- package/lib/components/pricing-table.d.ts +2 -10
- package/lib/components/pricing-table.js +5 -11
- package/lib/components/resume-subscription.d.ts +0 -10
- package/lib/components/resume-subscription.js +16 -16
- package/lib/components/table.js +1 -1
- package/lib/components/truncated-text.d.ts +2 -9
- package/lib/components/truncated-text.js +1 -6
- package/lib/contexts/donate.d.ts +0 -7
- package/lib/contexts/donate.js +4 -7
- package/lib/contexts/payment.d.ts +1 -4
- package/lib/contexts/payment.js +4 -7
- package/lib/history/invoice/list.d.ts +2 -18
- package/lib/history/invoice/list.js +49 -37
- package/lib/history/payment/list.js +30 -16
- package/lib/hooks/keyboard.d.ts +1 -1
- package/lib/hooks/mobile.js +1 -1
- package/lib/hooks/subscription.js +1 -1
- package/lib/index.js +2 -2
- package/lib/libs/api.js +1 -1
- package/lib/libs/dayjs.js +1 -1
- package/lib/libs/phone-validator.js +0 -2
- package/lib/libs/theme.js +1 -1
- package/lib/libs/util.js +1 -1
- package/lib/libs/validator.js +1 -1
- package/lib/locales/en.js +1 -1
- package/lib/locales/index.js +1 -1
- package/lib/locales/zh.js +1 -1
- package/lib/payment/amount.d.ts +2 -7
- package/lib/payment/amount.js +2 -6
- package/lib/payment/donation-form.d.ts +2 -10
- package/lib/payment/donation-form.js +33 -38
- package/lib/payment/error.d.ts +2 -8
- package/lib/payment/error.js +11 -13
- package/lib/payment/footer.d.ts +2 -3
- package/lib/payment/footer.js +5 -5
- package/lib/payment/form/addon.js +5 -3
- package/lib/payment/form/address.d.ts +2 -9
- package/lib/payment/form/address.js +5 -8
- package/lib/payment/form/currency.js +3 -3
- package/lib/payment/form/index.d.ts +2 -8
- package/lib/payment/form/index.js +19 -15
- package/lib/payment/form/phone.js +1 -1
- package/lib/payment/form/stripe/form.d.ts +2 -8
- package/lib/payment/form/stripe/form.js +3 -6
- package/lib/payment/header.js +8 -4
- package/lib/payment/index.d.ts +2 -9
- package/lib/payment/index.js +7 -16
- package/lib/payment/product-card.d.ts +2 -11
- package/lib/payment/product-card.js +13 -20
- package/lib/payment/product-donation.js +71 -66
- package/lib/payment/product-item.d.ts +2 -9
- package/lib/payment/product-item.js +24 -25
- package/lib/payment/product-skeleton.js +2 -2
- package/lib/payment/skeleton/donation.js +8 -4
- package/lib/payment/skeleton/overview.js +6 -2
- package/lib/payment/skeleton/payment.js +9 -3
- package/lib/payment/success.d.ts +2 -9
- package/lib/payment/success.js +12 -15
- package/lib/payment/summary.d.ts +2 -17
- package/lib/payment/summary.js +44 -45
- package/lib/theme/index.d.ts +0 -5
- package/lib/theme/index.js +2 -5
- package/lib/theme/typography.d.ts +2 -2
- package/package.json +40 -40
- package/src/checkout/donate.tsx +103 -35
- package/src/checkout/form.tsx +5 -14
- package/src/checkout/table.tsx +3 -3
- package/src/components/blockchain/gas.tsx +5 -3
- package/src/components/blockchain/tx.tsx +22 -8
- package/src/components/confirm.tsx +4 -11
- package/src/components/country-select.tsx +391 -378
- package/src/components/input.tsx +49 -45
- package/src/components/link.tsx +9 -7
- package/src/components/livemode.tsx +2 -6
- package/src/components/loading-button.tsx +63 -76
- package/src/components/over-due-invoice-payment.tsx +43 -28
- package/src/components/payment-beneficiaries.tsx +33 -14
- package/src/components/pricing-item.tsx +1 -4
- package/src/components/pricing-table.tsx +8 -8
- package/src/components/resume-subscription.tsx +20 -14
- package/src/components/table.tsx +2 -2
- package/src/components/truncated-text.tsx +0 -6
- package/src/contexts/donate.tsx +6 -7
- package/src/contexts/payment.tsx +7 -3
- package/src/history/invoice/list.tsx +74 -35
- package/src/history/payment/list.tsx +53 -16
- package/src/hooks/keyboard.ts +1 -1
- package/src/payment/amount.tsx +1 -6
- package/src/payment/donation-form.tsx +47 -29
- package/src/payment/error.tsx +16 -8
- package/src/payment/footer.tsx +11 -3
- package/src/payment/form/addon.tsx +6 -1
- package/src/payment/form/address.tsx +3 -7
- package/src/payment/form/currency.tsx +12 -2
- package/src/payment/form/index.tsx +30 -12
- package/src/payment/form/stripe/form.tsx +1 -5
- package/src/payment/header.tsx +14 -2
- package/src/payment/index.tsx +10 -21
- package/src/payment/product-card.tsx +41 -18
- package/src/payment/product-donation.tsx +85 -47
- package/src/payment/product-item.tsx +46 -24
- package/src/payment/product-skeleton.tsx +3 -2
- package/src/payment/skeleton/donation.tsx +12 -2
- package/src/payment/skeleton/overview.tsx +12 -2
- package/src/payment/skeleton/payment.tsx +16 -3
- package/src/payment/success.tsx +26 -15
- package/src/payment/summary.tsx +74 -42
- package/src/theme/index.tsx +5 -8
- package/src/theme/typography.ts +2 -2
|
@@ -15,10 +15,5 @@ interface BenefitsProps {
|
|
|
15
15
|
};
|
|
16
16
|
totalAmount?: string;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var defaultProps: {
|
|
21
|
-
totalAmount: string;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export default PaymentBeneficiaries;
|
|
18
|
+
export default function PaymentBeneficiaries({ data, currency, totalAmount }: BenefitsProps): import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -2,22 +2,28 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Avatar, Box, Stack, Typography } from "@mui/material";
|
|
3
3
|
import { BN, fromUnitToToken } from "@ocap/util";
|
|
4
4
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
5
|
-
PaymentBeneficiaries
|
|
6
|
-
totalAmount: "0"
|
|
7
|
-
};
|
|
8
|
-
export default function PaymentBeneficiaries({ data, currency, totalAmount }) {
|
|
5
|
+
export default function PaymentBeneficiaries({ data, currency, totalAmount = "0" }) {
|
|
9
6
|
const { t } = useLocaleContext();
|
|
10
7
|
return /* @__PURE__ */ jsxs(Stack, { spacing: 2, children: [
|
|
11
|
-
/* @__PURE__ */ jsx(
|
|
8
|
+
/* @__PURE__ */ jsx(
|
|
9
|
+
Typography,
|
|
10
|
+
{
|
|
11
|
+
variant: "subtitle2",
|
|
12
|
+
sx: {
|
|
13
|
+
color: "text.secondary"
|
|
14
|
+
},
|
|
15
|
+
children: t("benefits.title", { count: data.length })
|
|
16
|
+
}
|
|
17
|
+
),
|
|
12
18
|
data.map((item) => {
|
|
13
19
|
const amount = item.amount || (totalAmount ? new BN(totalAmount).mul(new BN(Number(item.percent))).div(new BN(100)).toString() : "0");
|
|
14
20
|
return /* @__PURE__ */ jsxs(
|
|
15
21
|
Stack,
|
|
16
22
|
{
|
|
17
23
|
direction: { xs: "column", sm: "row" },
|
|
18
|
-
alignItems: "center",
|
|
19
|
-
justifyContent: "space-between",
|
|
20
24
|
sx: {
|
|
25
|
+
alignItems: "center",
|
|
26
|
+
justifyContent: "space-between",
|
|
21
27
|
px: 0.5,
|
|
22
28
|
borderRadius: 1,
|
|
23
29
|
bgcolor: "background.paper",
|
|
@@ -26,41 +32,81 @@ export default function PaymentBeneficiaries({ data, currency, totalAmount }) {
|
|
|
26
32
|
}
|
|
27
33
|
},
|
|
28
34
|
children: [
|
|
29
|
-
/* @__PURE__ */ jsxs(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
/* @__PURE__ */ jsxs(
|
|
36
|
+
Stack,
|
|
37
|
+
{
|
|
38
|
+
direction: "row",
|
|
39
|
+
spacing: 1.5,
|
|
40
|
+
sx: {
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
width: { xs: "100%", sm: "auto" }
|
|
43
|
+
},
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsx(Avatar, { src: item.avatar, alt: item.name, sx: { width: 32, height: 32 }, variant: "square" }),
|
|
46
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
Typography,
|
|
49
|
+
{
|
|
50
|
+
variant: "subtitle2",
|
|
51
|
+
onClick: () => {
|
|
52
|
+
if (item.url) {
|
|
53
|
+
window.open(item.url, "_blank");
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
sx: {
|
|
57
|
+
cursor: item.url ? "pointer" : "default",
|
|
58
|
+
"&:hover": {
|
|
59
|
+
color: item.url ? "text.link" : "inherit"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
children: item.name
|
|
39
63
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
Typography,
|
|
67
|
+
{
|
|
68
|
+
variant: "caption",
|
|
69
|
+
sx: {
|
|
70
|
+
color: "text.secondary",
|
|
71
|
+
cursor: "pointer"
|
|
72
|
+
},
|
|
73
|
+
children: item.address
|
|
45
74
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
75
|
+
)
|
|
76
|
+
] })
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsxs(
|
|
81
|
+
Stack,
|
|
82
|
+
{
|
|
83
|
+
sx: {
|
|
84
|
+
alignItems: "flex-end",
|
|
85
|
+
width: { xs: "100%", sm: "auto" },
|
|
86
|
+
mt: { xs: 1, sm: 0 }
|
|
87
|
+
},
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "subtitle2", children: [
|
|
90
|
+
fromUnitToToken(amount, currency.decimal),
|
|
91
|
+
" ",
|
|
92
|
+
currency.symbol
|
|
93
|
+
] }),
|
|
94
|
+
/* @__PURE__ */ jsxs(
|
|
95
|
+
Typography,
|
|
96
|
+
{
|
|
97
|
+
variant: "caption",
|
|
98
|
+
sx: {
|
|
99
|
+
color: "text.secondary"
|
|
100
|
+
},
|
|
101
|
+
children: [
|
|
102
|
+
Number(item.percent),
|
|
103
|
+
"%"
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
)
|
|
64
110
|
]
|
|
65
111
|
},
|
|
66
112
|
item.address
|
|
@@ -7,9 +7,4 @@ export type PricingItemProps = {
|
|
|
7
7
|
children?: (pricing: PricingRenderProps, product?: TProductExpanded | undefined) => React.ReactNode;
|
|
8
8
|
};
|
|
9
9
|
declare function PricingItem({ productId, quantity, children, priceId }: PricingItemProps): import("react").JSX.Element;
|
|
10
|
-
declare namespace PricingItem {
|
|
11
|
-
var defaultProps: {
|
|
12
|
-
children: null;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
10
|
export default PricingItem;
|
|
@@ -10,7 +10,7 @@ import { formatError, formatTotalPrice } from "../libs/util.js";
|
|
|
10
10
|
const fetchProduct = (productId) => {
|
|
11
11
|
return api.get(`/api/products/${productId}`).then((res) => res?.data);
|
|
12
12
|
};
|
|
13
|
-
function PricingItem({ productId, quantity, children, priceId }) {
|
|
13
|
+
function PricingItem({ productId, quantity, children = void 0, priceId }) {
|
|
14
14
|
const { locale } = useLocaleContext();
|
|
15
15
|
const { data: productInfo, loading = false } = useRequest(() => fetchProduct(productId), {
|
|
16
16
|
refreshDeps: [productId],
|
|
@@ -37,7 +37,4 @@ function PricingItem({ productId, quantity, children, priceId }) {
|
|
|
37
37
|
}
|
|
38
38
|
return /* @__PURE__ */ jsx(Box, { children: children ? children(pricing, productInfo) : /* @__PURE__ */ jsx(Typography, { children: pricing?.totalPrice }) });
|
|
39
39
|
}
|
|
40
|
-
PricingItem.defaultProps = {
|
|
41
|
-
children: null
|
|
42
|
-
};
|
|
43
40
|
export default PricingItem;
|
|
@@ -7,13 +7,5 @@ type Props = {
|
|
|
7
7
|
interval?: string;
|
|
8
8
|
hideCurrency?: boolean;
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var defaultProps: {
|
|
13
|
-
alignItems: string;
|
|
14
|
-
mode: string;
|
|
15
|
-
interval: string;
|
|
16
|
-
hideCurrency: boolean;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export default PricingTable;
|
|
10
|
+
export default function PricingTable({ table, alignItems, interval, mode, onSelect, hideCurrency, }: Props): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -55,13 +55,14 @@ const groupItemsByRecurring = (items, currency) => {
|
|
|
55
55
|
});
|
|
56
56
|
return { recurring, grouped };
|
|
57
57
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
interval
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
export default function PricingTable({
|
|
59
|
+
table,
|
|
60
|
+
alignItems = "center",
|
|
61
|
+
interval = "",
|
|
62
|
+
mode = "checkout",
|
|
63
|
+
onSelect,
|
|
64
|
+
hideCurrency = false
|
|
65
|
+
}) {
|
|
65
66
|
const { t, locale } = useLocaleContext();
|
|
66
67
|
const { isMobile } = useMobile();
|
|
67
68
|
const {
|
|
@@ -12,14 +12,4 @@ type Props = {
|
|
|
12
12
|
authToken?: string;
|
|
13
13
|
};
|
|
14
14
|
declare function RecoverSubscription({ subscriptionId, dialogProps, onResumed, successToast, authToken, }: Props): import("react").JSX.Element | null;
|
|
15
|
-
declare namespace RecoverSubscription {
|
|
16
|
-
var defaultProps: {
|
|
17
|
-
onResumed: () => void;
|
|
18
|
-
dialogProps: {
|
|
19
|
-
open: boolean;
|
|
20
|
-
};
|
|
21
|
-
successToast: boolean;
|
|
22
|
-
authToken: undefined;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
15
|
export default RecoverSubscription;
|
|
@@ -27,11 +27,13 @@ const recoverSubscription = async (params) => {
|
|
|
27
27
|
};
|
|
28
28
|
function RecoverSubscription({
|
|
29
29
|
subscriptionId,
|
|
30
|
-
dialogProps = {
|
|
30
|
+
dialogProps = {
|
|
31
|
+
open: true
|
|
32
|
+
},
|
|
31
33
|
onResumed = () => {
|
|
32
34
|
},
|
|
33
35
|
successToast = true,
|
|
34
|
-
authToken
|
|
36
|
+
authToken = void 0
|
|
35
37
|
}) {
|
|
36
38
|
const { t, locale } = useLocaleContext();
|
|
37
39
|
const { connect } = usePaymentContext();
|
|
@@ -133,26 +135,45 @@ function RecoverSubscription({
|
|
|
133
135
|
title: dialogProps?.title || t("payment.customer.recover.title"),
|
|
134
136
|
sx: { "& .MuiDialogContent-root": { pt: 0 } },
|
|
135
137
|
onClose: handleClose,
|
|
136
|
-
children: error ? /* @__PURE__ */ jsx(Alert, { severity: "error", children: error.message }) : /* @__PURE__ */ jsxs(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
138
|
+
children: error ? /* @__PURE__ */ jsx(Alert, { severity: "error", children: error.message }) : /* @__PURE__ */ jsxs(
|
|
139
|
+
Stack,
|
|
140
|
+
{
|
|
141
|
+
sx: {
|
|
142
|
+
gap: 2
|
|
143
|
+
},
|
|
144
|
+
children: [
|
|
145
|
+
/* @__PURE__ */ jsx(
|
|
146
|
+
Typography,
|
|
147
|
+
{
|
|
148
|
+
variant: "body2",
|
|
149
|
+
sx: {
|
|
150
|
+
color: "text.secondary"
|
|
151
|
+
},
|
|
152
|
+
children: t("payment.customer.recover.description", {
|
|
153
|
+
date: formatToDate(Number(data?.subscription?.current_period_end || "0") * 1e3)
|
|
154
|
+
})
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
needStake && /* @__PURE__ */ jsx(Alert, { severity: "warning", children: t("payment.customer.recover.stakeRequiredDescription") }),
|
|
158
|
+
/* @__PURE__ */ jsxs(
|
|
159
|
+
Stack,
|
|
160
|
+
{
|
|
161
|
+
direction: "row",
|
|
162
|
+
sx: {
|
|
163
|
+
justifyContent: "flex-end",
|
|
164
|
+
gap: 2,
|
|
165
|
+
mt: 2
|
|
166
|
+
},
|
|
167
|
+
children: [
|
|
168
|
+
/* @__PURE__ */ jsx(Button, { variant: "outlined", color: "primary", onClick: handleClose, children: t("common.cancel") }),
|
|
169
|
+
/* @__PURE__ */ jsx(LoadingButton, { variant: "contained", size: "small", loading: recoverLoading, onClick: handleRecover, children: t("common.confirm") })
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
)
|
|
146
176
|
}
|
|
147
177
|
);
|
|
148
178
|
}
|
|
149
|
-
RecoverSubscription.defaultProps = {
|
|
150
|
-
onResumed: () => {
|
|
151
|
-
},
|
|
152
|
-
dialogProps: {
|
|
153
|
-
open: true
|
|
154
|
-
},
|
|
155
|
-
successToast: true,
|
|
156
|
-
authToken: void 0
|
|
157
|
-
};
|
|
158
179
|
export default RecoverSubscription;
|
|
@@ -3,12 +3,5 @@ interface TruncatedTextProps {
|
|
|
3
3
|
maxLength?: number;
|
|
4
4
|
useWidth?: boolean;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var defaultProps: {
|
|
9
|
-
useWidth: boolean;
|
|
10
|
-
text: string;
|
|
11
|
-
maxLength: number;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export default TruncatedText;
|
|
6
|
+
export default function TruncatedText({ text, maxLength, useWidth }: TruncatedTextProps): import("react").JSX.Element | null;
|
|
7
|
+
export {};
|
|
@@ -21,8 +21,3 @@ export default function TruncatedText({ text = "", maxLength = 100, useWidth = f
|
|
|
21
21
|
}
|
|
22
22
|
return /* @__PURE__ */ jsx(CustomTooltip, { title: text, placement: "bottom", enterTouchDelay: 0, children: /* @__PURE__ */ jsx(Typography, { children: truncatedText }) });
|
|
23
23
|
}
|
|
24
|
-
TruncatedText.defaultProps = {
|
|
25
|
-
useWidth: false,
|
|
26
|
-
text: "",
|
|
27
|
-
maxLength: 100
|
|
28
|
-
};
|
package/es/contexts/donate.d.ts
CHANGED
|
@@ -28,13 +28,6 @@ export type DonateContextProps = {
|
|
|
28
28
|
declare const DonateContext: import("react").Context<DonateContextType>;
|
|
29
29
|
declare const Consumer: import("react").Consumer<DonateContextType>;
|
|
30
30
|
declare function DonateProvider({ mountLocation, description, defaultSettings, children, active, enableDonate, }: DonateContextProps): import("react").JSX.Element | null;
|
|
31
|
-
declare namespace DonateProvider {
|
|
32
|
-
var defaultProps: {
|
|
33
|
-
defaultSettings: {};
|
|
34
|
-
active: boolean;
|
|
35
|
-
enableDonate: boolean;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
31
|
declare function useDonateContext(): DonateContextType;
|
|
39
32
|
export declare const clearDonateCache: (mountLocation: string) => void;
|
|
40
33
|
export declare const clearDonateSettings: (mountLocation: string) => Promise<void>;
|
package/es/contexts/donate.js
CHANGED
|
@@ -83,8 +83,7 @@ function DonateProvider({
|
|
|
83
83
|
};
|
|
84
84
|
const supportPaymentKit = getPaymentKitComponent();
|
|
85
85
|
const handleEnable = async () => {
|
|
86
|
-
if (!enableDonate || !data || data?.active)
|
|
87
|
-
return;
|
|
86
|
+
if (!enableDonate || !data || data?.active) return;
|
|
88
87
|
try {
|
|
89
88
|
await api.put(`/api/settings/${data.id}`, { active: true });
|
|
90
89
|
if (supportPaymentKit) {
|
|
@@ -111,7 +110,15 @@ function DonateProvider({
|
|
|
111
110
|
},
|
|
112
111
|
children: data?.active === false ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
113
112
|
enableDonate && isAdmin && /* @__PURE__ */ jsxs(Stack, { spacing: 1, sx: { alignItems: "center" }, children: [
|
|
114
|
-
/* @__PURE__ */ jsx(
|
|
113
|
+
/* @__PURE__ */ jsx(
|
|
114
|
+
Typography,
|
|
115
|
+
{
|
|
116
|
+
sx: {
|
|
117
|
+
color: "text.secondary"
|
|
118
|
+
},
|
|
119
|
+
children: t("payment.checkout.donation.inactive")
|
|
120
|
+
}
|
|
121
|
+
),
|
|
115
122
|
/* @__PURE__ */ jsx(
|
|
116
123
|
Button,
|
|
117
124
|
{
|
|
@@ -151,11 +158,6 @@ function useDonateContext() {
|
|
|
151
158
|
const context = useContext(DonateContext);
|
|
152
159
|
return context;
|
|
153
160
|
}
|
|
154
|
-
DonateProvider.defaultProps = {
|
|
155
|
-
defaultSettings: {},
|
|
156
|
-
active: true,
|
|
157
|
-
enableDonate: false
|
|
158
|
-
};
|
|
159
161
|
export const clearDonateCache = (mountLocation) => {
|
|
160
162
|
const livemode = localStorage.getItem("livemode") !== "false";
|
|
161
163
|
const cacheKey = `donate-settings-${mountLocation}-${livemode}`;
|
package/es/contexts/payment.d.ts
CHANGED
|
@@ -29,9 +29,6 @@ export type PaymentContextProps = {
|
|
|
29
29
|
};
|
|
30
30
|
declare const PaymentContext: import("react").Context<PaymentContextType>;
|
|
31
31
|
declare const Consumer: import("react").Consumer<PaymentContextType>;
|
|
32
|
-
declare function PaymentProvider({ session, connect, children, baseUrl, authToken }: PaymentContextProps): import("react").JSX.Element | null;
|
|
33
|
-
declare namespace PaymentProvider {
|
|
34
|
-
var defaultProps: {};
|
|
35
|
-
}
|
|
32
|
+
declare function PaymentProvider({ session, connect, children, baseUrl, authToken, }: PaymentContextProps): import("react").JSX.Element | null;
|
|
36
33
|
declare function usePaymentContext(): PaymentContextType;
|
|
37
34
|
export { PaymentContext, PaymentProvider, Consumer as SettingsConsumer, usePaymentContext };
|
package/es/contexts/payment.js
CHANGED
|
@@ -48,7 +48,13 @@ const syncToSpaceRequest = (userDid, spaceDid) => {
|
|
|
48
48
|
return res;
|
|
49
49
|
});
|
|
50
50
|
};
|
|
51
|
-
function PaymentProvider({
|
|
51
|
+
function PaymentProvider({
|
|
52
|
+
session,
|
|
53
|
+
connect,
|
|
54
|
+
children,
|
|
55
|
+
baseUrl = void 0,
|
|
56
|
+
authToken = void 0
|
|
57
|
+
}) {
|
|
52
58
|
const [crossOriginLoading, setCrossOriginLoading] = useState(false);
|
|
53
59
|
if (authToken) {
|
|
54
60
|
window.__PAYMENT_KIT_AUTH_TOKEN = authToken;
|
|
@@ -150,5 +156,4 @@ function usePaymentContext() {
|
|
|
150
156
|
const context = useContext(PaymentContext);
|
|
151
157
|
return context;
|
|
152
158
|
}
|
|
153
|
-
PaymentProvider.defaultProps = {};
|
|
154
159
|
export { PaymentContext, PaymentProvider, Consumer as SettingsConsumer, usePaymentContext };
|
|
@@ -13,21 +13,5 @@ type Props = {
|
|
|
13
13
|
onTableDataChange?: Function;
|
|
14
14
|
relatedSubscription?: boolean;
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var defaultProps: {
|
|
19
|
-
customer_id: string;
|
|
20
|
-
subscription_id: string;
|
|
21
|
-
currency_id: string;
|
|
22
|
-
include_staking: boolean;
|
|
23
|
-
include_recovered_from: boolean;
|
|
24
|
-
status: string;
|
|
25
|
-
pageSize: number;
|
|
26
|
-
target: string;
|
|
27
|
-
action: string;
|
|
28
|
-
type: string;
|
|
29
|
-
onTableDataChange: () => void;
|
|
30
|
-
relatedSubscription: boolean;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export default CustomerInvoiceList;
|
|
16
|
+
export default function CustomerInvoiceList(rawProps: Props): JSX.Element;
|
|
17
|
+
export {};
|