@blocklet/payment-react 1.18.0 → 1.18.2
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.js +55 -10
- package/es/checkout/form.d.ts +2 -1
- package/es/checkout/form.js +32 -45
- package/es/components/payment-beneficiaries.d.ts +24 -0
- package/es/components/payment-beneficiaries.js +70 -0
- package/es/index.d.ts +2 -1
- package/es/index.js +3 -1
- package/es/locales/en.js +13 -1
- package/es/locales/zh.js +13 -1
- package/es/payment/donation-form.d.ts +24 -0
- package/es/payment/donation-form.js +604 -0
- package/es/payment/error.d.ts +1 -1
- package/es/payment/error.js +11 -1
- package/es/payment/form/index.d.ts +9 -3
- package/es/payment/form/index.js +60 -12
- package/es/payment/product-donation.js +101 -56
- package/es/payment/skeleton/donation.d.ts +1 -0
- package/es/payment/skeleton/donation.js +30 -0
- package/es/theme/index.js +13 -0
- package/es/types/index.d.ts +2 -0
- package/lib/checkout/donate.js +85 -10
- package/lib/checkout/form.d.ts +2 -1
- package/lib/checkout/form.js +39 -49
- package/lib/components/payment-beneficiaries.d.ts +24 -0
- package/lib/components/payment-beneficiaries.js +113 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +8 -0
- package/lib/locales/en.js +13 -1
- package/lib/locales/zh.js +13 -1
- package/lib/payment/donation-form.d.ts +24 -0
- package/lib/payment/donation-form.js +645 -0
- package/lib/payment/error.d.ts +1 -1
- package/lib/payment/error.js +2 -2
- package/lib/payment/form/index.d.ts +9 -3
- package/lib/payment/form/index.js +60 -8
- package/lib/payment/product-donation.js +143 -72
- package/lib/payment/skeleton/donation.d.ts +1 -0
- package/lib/payment/skeleton/donation.js +66 -0
- package/lib/theme/index.js +13 -0
- package/lib/types/index.d.ts +2 -0
- package/package.json +3 -3
- package/src/checkout/donate.tsx +64 -11
- package/src/checkout/form.tsx +17 -31
- package/src/components/payment-beneficiaries.tsx +97 -0
- package/src/index.ts +2 -0
- package/src/locales/en.tsx +12 -0
- package/src/locales/zh.tsx +12 -0
- package/src/payment/donation-form.tsx +647 -0
- package/src/payment/error.tsx +13 -4
- package/src/payment/form/index.tsx +66 -11
- package/src/payment/product-donation.tsx +94 -39
- package/src/payment/skeleton/donation.tsx +35 -0
- package/src/theme/index.tsx +13 -0
- package/src/types/index.ts +2 -0
package/es/checkout/donate.js
CHANGED
|
@@ -27,6 +27,8 @@ import { formatAmount, formatBNStr, formatDateTime, formatError, getCustomerAvat
|
|
|
27
27
|
import CheckoutForm from "./form.js";
|
|
28
28
|
import { PaymentThemeProvider } from "../theme/index.js";
|
|
29
29
|
import { usePaymentContext } from "../contexts/payment.js";
|
|
30
|
+
import Livemode from "../components/livemode.js";
|
|
31
|
+
import { useMobile } from "../hooks/mobile.js";
|
|
30
32
|
const donationCache = {};
|
|
31
33
|
const createOrUpdateDonation = (settings, livemode = true) => {
|
|
32
34
|
const donationKey = `${settings.target}-${livemode}`;
|
|
@@ -232,8 +234,12 @@ function CheckoutDonateInner({
|
|
|
232
234
|
children
|
|
233
235
|
}) {
|
|
234
236
|
const { state, setState, donation, supporters } = useDonation(settings, livemode, mode);
|
|
237
|
+
const customers = uniqBy(supporters?.data?.supporters || [], "customer_did");
|
|
238
|
+
const { t } = useLocaleContext();
|
|
235
239
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
236
240
|
const [popoverOpen, setPopoverOpen] = useState(false);
|
|
241
|
+
const { isMobile } = useMobile();
|
|
242
|
+
const { connect } = usePaymentContext();
|
|
237
243
|
const handlePaid = (...args) => {
|
|
238
244
|
if (onPaid) {
|
|
239
245
|
onPaid(...args);
|
|
@@ -380,23 +386,43 @@ function CheckoutDonateInner({
|
|
|
380
386
|
Dialog,
|
|
381
387
|
{
|
|
382
388
|
open: state.open,
|
|
383
|
-
title:
|
|
389
|
+
title: /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", gap: 0.5, children: [
|
|
390
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h3", sx: { maxWidth: 320, textOverflow: "ellipsis", overflow: "hidden" }, children: settings.title }),
|
|
391
|
+
!donation.data.livemode && /* @__PURE__ */ jsx(Livemode, { sx: { width: "fit-content" } })
|
|
392
|
+
] }),
|
|
384
393
|
maxWidth: "md",
|
|
385
|
-
|
|
394
|
+
toolbar: isMobile ? null : /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", gap: 1, sx: { color: "text.secondary" }, children: [
|
|
395
|
+
/* @__PURE__ */ jsx(AvatarGroup, { total: customers?.length, max: 5, children: customers.map((x) => /* @__PURE__ */ jsx(
|
|
396
|
+
Avatar,
|
|
397
|
+
{
|
|
398
|
+
title: x.customer?.name,
|
|
399
|
+
src: getCustomerAvatar(
|
|
400
|
+
x.customer?.did,
|
|
401
|
+
x?.updated_at ? new Date(x.updated_at).toISOString() : "",
|
|
402
|
+
18
|
|
403
|
+
),
|
|
404
|
+
variant: "circular",
|
|
405
|
+
sx: { width: 18, height: 18 }
|
|
406
|
+
},
|
|
407
|
+
x.id
|
|
408
|
+
)) }),
|
|
409
|
+
customers?.length > 0 && t("payment.checkout.donation.gaveTips", { count: customers?.length })
|
|
410
|
+
] }),
|
|
411
|
+
showCloseButton: false,
|
|
386
412
|
disableEscapeKeyDown: true,
|
|
387
413
|
sx: {
|
|
388
414
|
".MuiDialogContent-root": {
|
|
389
|
-
padding:
|
|
390
|
-
xs: 0,
|
|
391
|
-
md: "0 16px 0"
|
|
392
|
-
},
|
|
415
|
+
padding: "16px 24px",
|
|
393
416
|
borderTop: "1px solid var(--stroke-border-base, #EFF1F5)",
|
|
394
|
-
width:
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
417
|
+
width: "100%"
|
|
418
|
+
},
|
|
419
|
+
".ux-dialog_header": {
|
|
420
|
+
gap: 5
|
|
398
421
|
}
|
|
399
422
|
},
|
|
423
|
+
PaperProps: {
|
|
424
|
+
style: { minHeight: "auto", width: 680 }
|
|
425
|
+
},
|
|
400
426
|
onClose: (e, reason) => setState({ open: reason === "backdropClick" }),
|
|
401
427
|
children: /* @__PURE__ */ jsx(Box, { sx: { height: "100%", width: "100%" }, children: /* @__PURE__ */ jsx(
|
|
402
428
|
CheckoutForm,
|
|
@@ -407,8 +433,27 @@ function CheckoutDonateInner({
|
|
|
407
433
|
action: settings.appearance?.button?.text,
|
|
408
434
|
mode: "inline",
|
|
409
435
|
theme,
|
|
436
|
+
formType: "donation",
|
|
410
437
|
extraParams: {
|
|
411
438
|
livemode
|
|
439
|
+
},
|
|
440
|
+
formRender: {
|
|
441
|
+
cancel: /* @__PURE__ */ jsx(
|
|
442
|
+
Button,
|
|
443
|
+
{
|
|
444
|
+
variant: "outlined",
|
|
445
|
+
size: "large",
|
|
446
|
+
onClick: () => {
|
|
447
|
+
connect.close();
|
|
448
|
+
setState({ open: false });
|
|
449
|
+
},
|
|
450
|
+
children: t("common.cancel")
|
|
451
|
+
}
|
|
452
|
+
),
|
|
453
|
+
onCancel: () => {
|
|
454
|
+
connect.close();
|
|
455
|
+
setState({ open: false });
|
|
456
|
+
}
|
|
412
457
|
}
|
|
413
458
|
}
|
|
414
459
|
) })
|
package/es/checkout/form.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CheckoutProps } from '../types';
|
|
2
|
-
declare function CheckoutForm({ id, mode, onPaid, onError, onChange, goBack, extraParams, action, theme, ...restProps }: CheckoutProps): import("react").JSX.Element;
|
|
2
|
+
declare function CheckoutForm({ id, mode, onPaid, onError, onChange, goBack, extraParams, action, theme, formType, ...restProps }: CheckoutProps): import("react").JSX.Element;
|
|
3
3
|
declare namespace CheckoutForm {
|
|
4
4
|
var defaultProps: {
|
|
5
5
|
onPaid: any;
|
|
@@ -10,6 +10,7 @@ declare namespace CheckoutForm {
|
|
|
10
10
|
mode: string;
|
|
11
11
|
action: string;
|
|
12
12
|
extraParams: {};
|
|
13
|
+
formType: string;
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
16
|
export default CheckoutForm;
|
package/es/checkout/form.js
CHANGED
|
@@ -7,6 +7,7 @@ import api from "../libs/api.js";
|
|
|
7
7
|
import { getPrefix, mergeExtraParams } from "../libs/util.js";
|
|
8
8
|
import Payment from "../payment/index.js";
|
|
9
9
|
import { PaymentThemeProvider } from "../theme/index.js";
|
|
10
|
+
import DonationForm from "../payment/donation-form.js";
|
|
10
11
|
const promises = {};
|
|
11
12
|
const startFromPaymentLink = (id, params) => {
|
|
12
13
|
if (!promises[id]) {
|
|
@@ -32,6 +33,7 @@ export default function CheckoutForm({
|
|
|
32
33
|
extraParams,
|
|
33
34
|
action,
|
|
34
35
|
theme = "default",
|
|
36
|
+
formType = "payment",
|
|
35
37
|
...restProps
|
|
36
38
|
}) {
|
|
37
39
|
if (!id.startsWith("plink_") && !id.startsWith("cs_")) {
|
|
@@ -60,49 +62,26 @@ export default function CheckoutForm({
|
|
|
60
62
|
setState({ appError: err });
|
|
61
63
|
onError?.(err);
|
|
62
64
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
if (theme && typeof theme === "object") {
|
|
85
|
-
return /* @__PURE__ */ jsx(PaymentThemeProvider, { theme, children: /* @__PURE__ */ jsx(
|
|
86
|
-
Payment,
|
|
87
|
-
{
|
|
88
|
-
checkoutSession: data?.checkoutSession,
|
|
89
|
-
paymentMethods: data?.paymentMethods,
|
|
90
|
-
paymentIntent: data?.paymentIntent,
|
|
91
|
-
paymentLink: data?.paymentLink,
|
|
92
|
-
customer: data?.customer,
|
|
93
|
-
completed: state.completed,
|
|
94
|
-
error: apiError,
|
|
95
|
-
onPaid: handlePaid,
|
|
96
|
-
onError: handleError,
|
|
97
|
-
onChange,
|
|
98
|
-
goBack,
|
|
99
|
-
mode,
|
|
100
|
-
action,
|
|
101
|
-
...restProps
|
|
102
|
-
}
|
|
103
|
-
) });
|
|
104
|
-
}
|
|
105
|
-
return /* @__PURE__ */ jsx(PaymentThemeProvider, { children: /* @__PURE__ */ jsx(
|
|
65
|
+
const Checkout = formType === "donation" ? /* @__PURE__ */ jsx(
|
|
66
|
+
DonationForm,
|
|
67
|
+
{
|
|
68
|
+
checkoutSession: data?.checkoutSession,
|
|
69
|
+
paymentMethods: data?.paymentMethods,
|
|
70
|
+
paymentIntent: data?.paymentIntent,
|
|
71
|
+
paymentLink: data?.paymentLink,
|
|
72
|
+
customer: data?.customer,
|
|
73
|
+
completed: state.completed,
|
|
74
|
+
error: apiError,
|
|
75
|
+
onPaid: handlePaid,
|
|
76
|
+
onError: handleError,
|
|
77
|
+
onChange,
|
|
78
|
+
goBack,
|
|
79
|
+
mode,
|
|
80
|
+
action,
|
|
81
|
+
id,
|
|
82
|
+
...restProps
|
|
83
|
+
}
|
|
84
|
+
) : /* @__PURE__ */ jsx(
|
|
106
85
|
Payment,
|
|
107
86
|
{
|
|
108
87
|
checkoutSession: data?.checkoutSession,
|
|
@@ -120,12 +99,20 @@ export default function CheckoutForm({
|
|
|
120
99
|
action,
|
|
121
100
|
...restProps
|
|
122
101
|
}
|
|
123
|
-
)
|
|
102
|
+
);
|
|
103
|
+
if (theme === "inherit") {
|
|
104
|
+
return Checkout;
|
|
105
|
+
}
|
|
106
|
+
if (theme && typeof theme === "object") {
|
|
107
|
+
return /* @__PURE__ */ jsx(PaymentThemeProvider, { theme, children: Checkout });
|
|
108
|
+
}
|
|
109
|
+
return /* @__PURE__ */ jsx(PaymentThemeProvider, { children: Checkout });
|
|
124
110
|
}
|
|
125
111
|
CheckoutForm.defaultProps = {
|
|
126
112
|
onPaid: noop,
|
|
127
113
|
onError: console.error,
|
|
128
114
|
mode: "inline",
|
|
129
115
|
action: "",
|
|
130
|
-
extraParams: {}
|
|
116
|
+
extraParams: {},
|
|
117
|
+
formType: "payment"
|
|
131
118
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface TBeneficiary {
|
|
2
|
+
name: string;
|
|
3
|
+
address: string;
|
|
4
|
+
avatar?: string;
|
|
5
|
+
percent: number;
|
|
6
|
+
amount?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
type?: 'user' | 'dapp';
|
|
9
|
+
}
|
|
10
|
+
interface BenefitsProps {
|
|
11
|
+
data: TBeneficiary[];
|
|
12
|
+
currency: {
|
|
13
|
+
symbol: string;
|
|
14
|
+
decimal: number;
|
|
15
|
+
};
|
|
16
|
+
totalAmount?: string;
|
|
17
|
+
}
|
|
18
|
+
declare function PaymentBeneficiaries({ data, currency, totalAmount }: BenefitsProps): import("react").JSX.Element;
|
|
19
|
+
declare namespace PaymentBeneficiaries {
|
|
20
|
+
var defaultProps: {
|
|
21
|
+
totalAmount: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export default PaymentBeneficiaries;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Avatar, Box, Stack, Typography } from "@mui/material";
|
|
3
|
+
import { BN, fromUnitToToken } from "@ocap/util";
|
|
4
|
+
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
5
|
+
PaymentBeneficiaries.defaultProps = {
|
|
6
|
+
totalAmount: "0"
|
|
7
|
+
};
|
|
8
|
+
export default function PaymentBeneficiaries({ data, currency, totalAmount }) {
|
|
9
|
+
const { t } = useLocaleContext();
|
|
10
|
+
return /* @__PURE__ */ jsxs(Stack, { spacing: 2, children: [
|
|
11
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", color: "text.secondary", children: t("benefits.title", { count: data.length }) }),
|
|
12
|
+
data.map((item) => {
|
|
13
|
+
const amount = item.amount || (totalAmount ? new BN(totalAmount).mul(new BN(Number(item.percent))).div(new BN(100)).toString() : "0");
|
|
14
|
+
return /* @__PURE__ */ jsxs(
|
|
15
|
+
Stack,
|
|
16
|
+
{
|
|
17
|
+
direction: { xs: "column", sm: "row" },
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
justifyContent: "space-between",
|
|
20
|
+
sx: {
|
|
21
|
+
px: 0.5,
|
|
22
|
+
borderRadius: 1,
|
|
23
|
+
bgcolor: "background.paper",
|
|
24
|
+
"&:hover": {
|
|
25
|
+
bgcolor: "action.hover"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1.5, alignItems: "center", sx: { width: { xs: "100%", sm: "auto" } }, children: [
|
|
30
|
+
/* @__PURE__ */ jsx(Avatar, { src: item.avatar, alt: item.name, sx: { width: 32, height: 32 }, variant: "square" }),
|
|
31
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
Typography,
|
|
34
|
+
{
|
|
35
|
+
variant: "subtitle2",
|
|
36
|
+
onClick: () => {
|
|
37
|
+
if (item.url) {
|
|
38
|
+
window.open(item.url, "_blank");
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
sx: {
|
|
42
|
+
cursor: item.url ? "pointer" : "default",
|
|
43
|
+
"&:hover": {
|
|
44
|
+
color: item.url ? "text.link" : "inherit"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
children: item.name
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", sx: { cursor: "pointer" }, children: item.address })
|
|
51
|
+
] })
|
|
52
|
+
] }),
|
|
53
|
+
/* @__PURE__ */ jsxs(Stack, { alignItems: "flex-end", sx: { width: { xs: "100%", sm: "auto" }, mt: { xs: 1, sm: 0 } }, children: [
|
|
54
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "subtitle2", children: [
|
|
55
|
+
fromUnitToToken(amount, currency.decimal),
|
|
56
|
+
" ",
|
|
57
|
+
currency.symbol
|
|
58
|
+
] }),
|
|
59
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "text.secondary", children: [
|
|
60
|
+
Number(item.percent),
|
|
61
|
+
"%"
|
|
62
|
+
] })
|
|
63
|
+
] })
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
item.address
|
|
67
|
+
);
|
|
68
|
+
})
|
|
69
|
+
] });
|
|
70
|
+
}
|
package/es/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ import TruncatedText from './components/truncated-text';
|
|
|
29
29
|
import Link from './components/link';
|
|
30
30
|
import { createLazyComponent } from './components/lazy-loader';
|
|
31
31
|
import OverdueInvoicePayment from './components/over-due-invoice-payment';
|
|
32
|
+
import PaymentBeneficiaries from './components/payment-beneficiaries';
|
|
32
33
|
export { PaymentThemeProvider } from './theme';
|
|
33
34
|
export * from './libs/util';
|
|
34
35
|
export * from './libs/connect';
|
|
@@ -39,4 +40,4 @@ export * from './hooks/mobile';
|
|
|
39
40
|
export * from './hooks/table';
|
|
40
41
|
export * from './hooks/scroll';
|
|
41
42
|
export { translations, createTranslator } from './locales';
|
|
42
|
-
export { createLazyComponent, api, dayjs, FormInput, PhoneInput, AddressForm, StripeForm, Status, Livemode, Switch, ConfirmDialog, CheckoutForm, CheckoutTable, CheckoutDonate, CurrencySelector, Payment, PaymentSummary, PricingTable, ProductSkeleton, Amount, CustomerInvoiceList, CustomerPaymentList, TxLink, TxGas, SafeGuard, PricingItem, CountrySelect, Table, TruncatedText, Link, OverdueInvoicePayment, };
|
|
43
|
+
export { createLazyComponent, api, dayjs, FormInput, PhoneInput, AddressForm, StripeForm, Status, Livemode, Switch, ConfirmDialog, CheckoutForm, CheckoutTable, CheckoutDonate, CurrencySelector, Payment, PaymentSummary, PricingTable, ProductSkeleton, Amount, CustomerInvoiceList, CustomerPaymentList, TxLink, TxGas, SafeGuard, PricingItem, CountrySelect, Table, TruncatedText, Link, OverdueInvoicePayment, PaymentBeneficiaries, };
|
package/es/index.js
CHANGED
|
@@ -29,6 +29,7 @@ import TruncatedText from "./components/truncated-text.js";
|
|
|
29
29
|
import Link from "./components/link.js";
|
|
30
30
|
import { createLazyComponent } from "./components/lazy-loader.js";
|
|
31
31
|
import OverdueInvoicePayment from "./components/over-due-invoice-payment.js";
|
|
32
|
+
import PaymentBeneficiaries from "./components/payment-beneficiaries.js";
|
|
32
33
|
export { PaymentThemeProvider } from "./theme/index.js";
|
|
33
34
|
export * from "./libs/util.js";
|
|
34
35
|
export * from "./libs/connect.js";
|
|
@@ -70,5 +71,6 @@ export {
|
|
|
70
71
|
Table,
|
|
71
72
|
TruncatedText,
|
|
72
73
|
Link,
|
|
73
|
-
OverdueInvoicePayment
|
|
74
|
+
OverdueInvoicePayment,
|
|
75
|
+
PaymentBeneficiaries
|
|
74
76
|
};
|
package/es/locales/en.js
CHANGED
|
@@ -31,6 +31,8 @@ export default flat({
|
|
|
31
31
|
upload: "Upload",
|
|
32
32
|
change: "Change",
|
|
33
33
|
cancel: "Cancel",
|
|
34
|
+
close: "Close",
|
|
35
|
+
back: "Back",
|
|
34
36
|
every: "every",
|
|
35
37
|
per: "per {interval}",
|
|
36
38
|
slash: "/ {interval}",
|
|
@@ -125,7 +127,14 @@ export default flat({
|
|
|
125
127
|
custom: "Custom Amount",
|
|
126
128
|
select: "Select Amount",
|
|
127
129
|
summary: "{total} supporters {totalAmount} {symbol}",
|
|
128
|
-
empty: "No supporters yet"
|
|
130
|
+
empty: "No supporters yet",
|
|
131
|
+
gaveTips: "{count} people gave tips",
|
|
132
|
+
tipAmount: "Tip Amount",
|
|
133
|
+
benefits: {
|
|
134
|
+
one: "{name} will receive all tips",
|
|
135
|
+
multiple: "Tips will be distributed to {count} beneficiaries",
|
|
136
|
+
view: "Click to view details"
|
|
137
|
+
}
|
|
129
138
|
},
|
|
130
139
|
cardPay: "{action} with card",
|
|
131
140
|
empty: "No thing to pay",
|
|
@@ -347,5 +356,8 @@ export default flat({
|
|
|
347
356
|
},
|
|
348
357
|
empty: {
|
|
349
358
|
records: "No matching records found"
|
|
359
|
+
},
|
|
360
|
+
benefits: {
|
|
361
|
+
title: "{count} Beneficiaries"
|
|
350
362
|
}
|
|
351
363
|
});
|
package/es/locales/zh.js
CHANGED
|
@@ -31,6 +31,8 @@ export default flat({
|
|
|
31
31
|
change: "\u66F4\u6362",
|
|
32
32
|
confirm: "\u786E\u8BA4",
|
|
33
33
|
cancel: "\u53D6\u6D88",
|
|
34
|
+
close: "\u5173\u95ED",
|
|
35
|
+
back: "\u8FD4\u56DE",
|
|
34
36
|
every: "\u6BCF",
|
|
35
37
|
per: "\u6BCF{interval}",
|
|
36
38
|
slash: "\u6BCF{interval}",
|
|
@@ -125,7 +127,14 @@ export default flat({
|
|
|
125
127
|
custom: "\u8F93\u5165\u91D1\u989D",
|
|
126
128
|
select: "\u9009\u62E9\u91D1\u989D",
|
|
127
129
|
summary: "\u5171\u6709 {total} \u4EBA\u652F\u6301 {totalAmount} {symbol}",
|
|
128
|
-
empty: "\u2764\uFE0F \u652F\u6301\u4E00\u4E0B"
|
|
130
|
+
empty: "\u2764\uFE0F \u652F\u6301\u4E00\u4E0B",
|
|
131
|
+
gaveTips: "\u5DF2\u6709 {count} \u4EBA\u6253\u8D4F",
|
|
132
|
+
tipAmount: "\u6253\u8D4F\u91D1\u989D",
|
|
133
|
+
benefits: {
|
|
134
|
+
one: "{name} \u5C06\u83B7\u5F97\u5168\u90E8\u6253\u8D4F",
|
|
135
|
+
multiple: "\u6253\u8D4F\u5C06\u6309\u6BD4\u4F8B\u5206\u914D\u7ED9 {count} \u4F4D\u53D7\u76CA\u4EBA",
|
|
136
|
+
view: "\u70B9\u51FB\u67E5\u770B\u8BE6\u60C5"
|
|
137
|
+
}
|
|
129
138
|
},
|
|
130
139
|
cardPay: "\u4F7F\u7528\u5361\u7247{action}",
|
|
131
140
|
empty: "\u6CA1\u6709\u53EF\u652F\u4ED8\u7684\u9879\u76EE",
|
|
@@ -347,5 +356,8 @@ export default flat({
|
|
|
347
356
|
},
|
|
348
357
|
empty: {
|
|
349
358
|
records: "\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u8BB0\u5F55"
|
|
359
|
+
},
|
|
360
|
+
benefits: {
|
|
361
|
+
title: "{count} \u4F4D\u53D7\u76CA\u4EBA"
|
|
350
362
|
}
|
|
351
363
|
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type BoxProps } from '@mui/material';
|
|
2
|
+
import type { LiteralUnion } from 'type-fest';
|
|
3
|
+
import type { CheckoutCallbacks, CheckoutContext } from '../types';
|
|
4
|
+
type Props = CheckoutContext & CheckoutCallbacks & {
|
|
5
|
+
completed?: boolean;
|
|
6
|
+
error?: any;
|
|
7
|
+
showCheckoutSummary?: boolean;
|
|
8
|
+
formRender?: Record<string, any>;
|
|
9
|
+
id: string;
|
|
10
|
+
};
|
|
11
|
+
declare function DonationForm({ checkoutSession, paymentMethods, paymentIntent, paymentLink, customer, completed, error, mode, onPaid, onError, onChange, goBack, action, showCheckoutSummary, formRender, id, }: Props): import("react").JSX.Element;
|
|
12
|
+
declare namespace DonationForm {
|
|
13
|
+
var defaultProps: {
|
|
14
|
+
completed: boolean;
|
|
15
|
+
error: null;
|
|
16
|
+
showCheckoutSummary: boolean;
|
|
17
|
+
formRender: {};
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export default DonationForm;
|
|
21
|
+
type RootProps = {
|
|
22
|
+
mode: LiteralUnion<'standalone' | 'inline' | 'popup', string>;
|
|
23
|
+
} & BoxProps;
|
|
24
|
+
export declare const Root: React.FC<RootProps>;
|