payment-kit 1.18.7 → 1.18.9
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/blocklet.yml +1 -1
- package/package.json +17 -17
- package/src/components/filter-toolbar.tsx +10 -10
- package/src/components/layout/admin.tsx +1 -0
- package/src/components/payment-link/product-select.tsx +1 -1
- package/src/components/price/currency-select.tsx +3 -1
- package/src/components/price/form.tsx +1 -1
- package/src/components/section/header.tsx +1 -1
- package/src/global.css +4 -4
- package/src/pages/admin/developers/webhooks/detail.tsx +1 -1
- package/src/pages/admin/overview.tsx +3 -3
- package/src/pages/admin/payments/intents/detail.tsx +1 -1
- package/src/pages/admin/payments/payouts/detail.tsx +1 -1
- package/src/pages/admin/payments/refunds/detail.tsx +1 -1
- package/src/pages/admin/products/products/detail.tsx +1 -1
- package/src/pages/customer/payout/detail.tsx +1 -1
- package/src/pages/customer/subscription/change-payment.tsx +7 -1
- package/src/pages/integrations/donations/index.tsx +1 -1
- package/src/pages/integrations/donations/preview.tsx +73 -52
package/blocklet.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payment-kit",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.9",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "blocklet dev --open",
|
|
6
6
|
"eject": "vite eject",
|
|
@@ -44,29 +44,29 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@abtnode/cron": "^1.16.38",
|
|
47
|
-
"@arcblock/did": "^1.19.
|
|
47
|
+
"@arcblock/did": "^1.19.10",
|
|
48
48
|
"@arcblock/did-auth-storage-nedb": "^1.7.1",
|
|
49
|
-
"@arcblock/did-connect": "^2.11.
|
|
50
|
-
"@arcblock/did-util": "^1.19.
|
|
51
|
-
"@arcblock/jwt": "^1.19.
|
|
52
|
-
"@arcblock/ux": "^2.11.
|
|
53
|
-
"@arcblock/validator": "^1.19.
|
|
49
|
+
"@arcblock/did-connect": "^2.11.44",
|
|
50
|
+
"@arcblock/did-util": "^1.19.10",
|
|
51
|
+
"@arcblock/jwt": "^1.19.10",
|
|
52
|
+
"@arcblock/ux": "^2.11.44",
|
|
53
|
+
"@arcblock/validator": "^1.19.10",
|
|
54
54
|
"@blocklet/js-sdk": "^1.16.38",
|
|
55
55
|
"@blocklet/logger": "^1.16.38",
|
|
56
|
-
"@blocklet/payment-react": "1.18.
|
|
56
|
+
"@blocklet/payment-react": "1.18.9",
|
|
57
57
|
"@blocklet/sdk": "^1.16.38",
|
|
58
|
-
"@blocklet/ui-react": "^2.11.
|
|
58
|
+
"@blocklet/ui-react": "^2.11.44",
|
|
59
59
|
"@blocklet/uploader": "^0.1.70",
|
|
60
60
|
"@blocklet/xss": "^0.1.25",
|
|
61
61
|
"@mui/icons-material": "^5.16.6",
|
|
62
62
|
"@mui/lab": "^5.0.0-alpha.173",
|
|
63
63
|
"@mui/material": "^5.16.6",
|
|
64
64
|
"@mui/system": "^5.16.6",
|
|
65
|
-
"@ocap/asset": "^1.19.
|
|
66
|
-
"@ocap/client": "^1.19.
|
|
67
|
-
"@ocap/mcrypto": "^1.19.
|
|
68
|
-
"@ocap/util": "^1.19.
|
|
69
|
-
"@ocap/wallet": "^1.19.
|
|
65
|
+
"@ocap/asset": "^1.19.10",
|
|
66
|
+
"@ocap/client": "^1.19.10",
|
|
67
|
+
"@ocap/mcrypto": "^1.19.10",
|
|
68
|
+
"@ocap/util": "^1.19.10",
|
|
69
|
+
"@ocap/wallet": "^1.19.10",
|
|
70
70
|
"@stripe/react-stripe-js": "^2.7.3",
|
|
71
71
|
"@stripe/stripe-js": "^2.4.0",
|
|
72
72
|
"ahooks": "^3.8.0",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"devDependencies": {
|
|
122
122
|
"@abtnode/types": "^1.16.38",
|
|
123
123
|
"@arcblock/eslint-config-ts": "^0.3.3",
|
|
124
|
-
"@blocklet/payment-types": "1.18.
|
|
124
|
+
"@blocklet/payment-types": "1.18.9",
|
|
125
125
|
"@types/cookie-parser": "^1.4.7",
|
|
126
126
|
"@types/cors": "^2.8.17",
|
|
127
127
|
"@types/debug": "^4.1.12",
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"vite": "^5.3.5",
|
|
152
152
|
"vite-node": "^2.0.4",
|
|
153
153
|
"vite-plugin-babel-import": "^2.0.5",
|
|
154
|
-
"vite-plugin-blocklet": "^0.9.
|
|
154
|
+
"vite-plugin-blocklet": "^0.9.21",
|
|
155
155
|
"vite-plugin-node-polyfills": "^0.21.0",
|
|
156
156
|
"vite-plugin-svgr": "^4.2.0",
|
|
157
157
|
"vite-tsconfig-paths": "^4.3.2",
|
|
@@ -167,5 +167,5 @@
|
|
|
167
167
|
"parser": "typescript"
|
|
168
168
|
}
|
|
169
169
|
},
|
|
170
|
-
"gitHead": "
|
|
170
|
+
"gitHead": "e1e02357e4ef1294a788595d34b2f3e8ef6046b3"
|
|
171
171
|
}
|
|
@@ -126,7 +126,7 @@ function SearchStatus({
|
|
|
126
126
|
<Button className="option-btn" variant="text">
|
|
127
127
|
{search!.status ? (
|
|
128
128
|
<Close
|
|
129
|
-
sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.
|
|
129
|
+
sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.05rem' }}
|
|
130
130
|
onClick={(e) => {
|
|
131
131
|
e.stopPropagation();
|
|
132
132
|
setSearch({
|
|
@@ -136,7 +136,7 @@ function SearchStatus({
|
|
|
136
136
|
}}
|
|
137
137
|
/>
|
|
138
138
|
) : (
|
|
139
|
-
<Add sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.
|
|
139
|
+
<Add sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.05rem' }} />
|
|
140
140
|
)}
|
|
141
141
|
{t('common.status')}
|
|
142
142
|
<span>{formatStatus ? formatStatus(search!.status) : search!.status}</span>
|
|
@@ -192,7 +192,7 @@ function SearchCurrency({ setSearch, search }: Pick<Props, 'setSearch' | 'search
|
|
|
192
192
|
<Button className="option-btn" variant="text">
|
|
193
193
|
{search!.currency_id ? (
|
|
194
194
|
<Close
|
|
195
|
-
sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.
|
|
195
|
+
sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.05rem' }}
|
|
196
196
|
onClick={(e) => {
|
|
197
197
|
e.stopPropagation();
|
|
198
198
|
setSearch({
|
|
@@ -202,7 +202,7 @@ function SearchCurrency({ setSearch, search }: Pick<Props, 'setSearch' | 'search
|
|
|
202
202
|
}}
|
|
203
203
|
/>
|
|
204
204
|
) : (
|
|
205
|
-
<Add sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.
|
|
205
|
+
<Add sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.05rem' }} />
|
|
206
206
|
)}
|
|
207
207
|
{t('common.currency')}
|
|
208
208
|
<span>{Object.keys(currencies).find((x) => currencies[x] === search!.currency_id)}</span>
|
|
@@ -260,7 +260,7 @@ function SearchCustomers({ setSearch, search }: Pick<Props, 'setSearch' | 'searc
|
|
|
260
260
|
<Button className="option-btn" variant="text">
|
|
261
261
|
{search!.customer_id ? (
|
|
262
262
|
<Close
|
|
263
|
-
sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.
|
|
263
|
+
sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.05rem' }}
|
|
264
264
|
onClick={(e) => {
|
|
265
265
|
e.stopPropagation();
|
|
266
266
|
setSearch({
|
|
@@ -270,7 +270,7 @@ function SearchCustomers({ setSearch, search }: Pick<Props, 'setSearch' | 'searc
|
|
|
270
270
|
}}
|
|
271
271
|
/>
|
|
272
272
|
) : (
|
|
273
|
-
<Add sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.
|
|
273
|
+
<Add sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.05rem' }} />
|
|
274
274
|
)}
|
|
275
275
|
{t('common.customer')}
|
|
276
276
|
<span>{customers.find((x) => x.id === search!.customer_id)?.name}</span>
|
|
@@ -373,7 +373,7 @@ function SearchProducts({ setSearch, search }: Pick<Props, 'setSearch' | 'search
|
|
|
373
373
|
}}>
|
|
374
374
|
{display ? (
|
|
375
375
|
<Close
|
|
376
|
-
sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.
|
|
376
|
+
sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.05rem' }}
|
|
377
377
|
onClick={(e) => {
|
|
378
378
|
e.stopPropagation();
|
|
379
379
|
setSearch({
|
|
@@ -385,7 +385,7 @@ function SearchProducts({ setSearch, search }: Pick<Props, 'setSearch' | 'search
|
|
|
385
385
|
}}
|
|
386
386
|
/>
|
|
387
387
|
) : (
|
|
388
|
-
<Add sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.
|
|
388
|
+
<Add sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.05rem' }} />
|
|
389
389
|
)}
|
|
390
390
|
{t('admin.subscription.product')}
|
|
391
391
|
<span>{display}</span>
|
|
@@ -424,7 +424,7 @@ function SearchDonation({ donation = [], search, setSearch }: Pick<Props, 'donat
|
|
|
424
424
|
<Button className="option-btn" variant="text">
|
|
425
425
|
{search!.donation ? (
|
|
426
426
|
<Close
|
|
427
|
-
sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.
|
|
427
|
+
sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.05rem' }}
|
|
428
428
|
onClick={(e) => {
|
|
429
429
|
e.stopPropagation();
|
|
430
430
|
setSearch({
|
|
@@ -434,7 +434,7 @@ function SearchDonation({ donation = [], search, setSearch }: Pick<Props, 'donat
|
|
|
434
434
|
}}
|
|
435
435
|
/>
|
|
436
436
|
) : (
|
|
437
|
-
<Add sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.
|
|
437
|
+
<Add sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.05rem' }} />
|
|
438
438
|
)}
|
|
439
439
|
{t('common.donation')}
|
|
440
440
|
<span>{search!.donation}</span>
|
|
@@ -39,7 +39,7 @@ export default function ProductSelect({ mode: initialMode, hasSelected, onSelect
|
|
|
39
39
|
|
|
40
40
|
const items = (callback?: any) =>
|
|
41
41
|
filterProducts(products, hasSelected).map((product) => [
|
|
42
|
-
<ListSubheader key={product.id} sx={{ fontSize: '
|
|
42
|
+
<ListSubheader key={product.id} sx={{ fontSize: '0.875rem', color: 'text.secondary', lineHeight: '2.1875rem' }}>
|
|
43
43
|
<Stack direction="row" alignItems="center" spacing={0.5}>
|
|
44
44
|
{product.images[0] ? (
|
|
45
45
|
<Avatar src={product.images[0]} alt={product.name} variant="square" sx={size} />
|
|
@@ -92,7 +92,9 @@ export default function CurrencySelect({
|
|
|
92
92
|
disabled={disabled}
|
|
93
93
|
onClose={() => setMode(initialMode)}>
|
|
94
94
|
{extraCurrencies.map((method) => [
|
|
95
|
-
<ListSubheader
|
|
95
|
+
<ListSubheader
|
|
96
|
+
key={method.id}
|
|
97
|
+
sx={{ fontSize: '0.875rem', color: 'text.secondary', lineHeight: '2.1875rem' }}>
|
|
96
98
|
{method.name}
|
|
97
99
|
</ListSubheader>,
|
|
98
100
|
...method.payment_currencies.map((currency) => (
|
|
@@ -425,7 +425,7 @@ export default function PriceForm({ prefix, simple }: PriceFormProps) {
|
|
|
425
425
|
<MenuItem value="month_2">{t('common.custom')}</MenuItem>
|
|
426
426
|
</Select>
|
|
427
427
|
{get(errors, getFieldName('recurring.interval_config'))?.message && (
|
|
428
|
-
<Typography color="error" sx={{ fontSize: '0.
|
|
428
|
+
<Typography color="error" sx={{ fontSize: '0.65625rem', mt: 0.5, ml: 1.75 }}>
|
|
429
429
|
{/* @ts-ignore */}
|
|
430
430
|
{get(errors, getFieldName('recurring.interval_config')).message}
|
|
431
431
|
</Typography>
|
package/src/global.css
CHANGED
|
@@ -2,7 +2,6 @@ html,
|
|
|
2
2
|
body {
|
|
3
3
|
padding: 0;
|
|
4
4
|
margin: 0;
|
|
5
|
-
font-size: 14px;
|
|
6
5
|
}
|
|
7
6
|
|
|
8
7
|
a:has(> div) {
|
|
@@ -11,8 +10,8 @@ a:has(> div) {
|
|
|
11
10
|
|
|
12
11
|
.MuiButton-sizeSmall {
|
|
13
12
|
font-weight: 500;
|
|
14
|
-
font-size:
|
|
15
|
-
line-height: 1.
|
|
13
|
+
font-size: 0.875rem;
|
|
14
|
+
line-height: 1.3125rem;
|
|
16
15
|
border-color: #ccc;
|
|
17
16
|
}
|
|
18
17
|
|
|
@@ -21,6 +20,7 @@ a:has(> div) {
|
|
|
21
20
|
margin-right: 24px;
|
|
22
21
|
min-height: 32px;
|
|
23
22
|
min-width: auto;
|
|
23
|
+
font-size: 0.875rem;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.MuiTabs-root {
|
|
@@ -53,7 +53,7 @@ a:has(> div) {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.MuiTableCell-root {
|
|
56
|
-
font-size:
|
|
56
|
+
font-size: 0.875rem !important;
|
|
57
57
|
padding-top: 8px;
|
|
58
58
|
padding-bottom: 8px;
|
|
59
59
|
padding-right: 24px;
|
|
@@ -77,7 +77,7 @@ export default function WebhookDetail(props: { id: string }) {
|
|
|
77
77
|
title={
|
|
78
78
|
<ul style={{ padding: 0, margin: 0 }}>
|
|
79
79
|
{data.enabled_events.map((x) => (
|
|
80
|
-
<li key={x} style={{ fontSize: '0.
|
|
80
|
+
<li key={x} style={{ fontSize: '0.7875rem' }}>
|
|
81
81
|
{x}
|
|
82
82
|
</li>
|
|
83
83
|
))}
|
|
@@ -298,7 +298,7 @@ export default function Overview() {
|
|
|
298
298
|
sx={{ width: 36, height: 36 }}
|
|
299
299
|
/>
|
|
300
300
|
<Box flex={1}>
|
|
301
|
-
<Typography variant="h5" component="div" sx={{ fontSize: '
|
|
301
|
+
<Typography variant="h5" component="div" sx={{ fontSize: '1.75rem' }}>
|
|
302
302
|
{formatBNStr(
|
|
303
303
|
summary.data?.balances?.[currencyId] as string,
|
|
304
304
|
currencies[currencyId]?.decimal as number
|
|
@@ -338,7 +338,7 @@ export default function Overview() {
|
|
|
338
338
|
variant="outlined"
|
|
339
339
|
sx={{ padding: 1, width: 0.48 }}>
|
|
340
340
|
<Box>
|
|
341
|
-
<Typography component="div" sx={{ fontSize: '
|
|
341
|
+
<Typography component="div" sx={{ fontSize: '1.75rem' }}>
|
|
342
342
|
{metric.count}
|
|
343
343
|
</Typography>
|
|
344
344
|
<Typography sx={{ fontSize: 14 }} color="text.secondary">
|
|
@@ -366,7 +366,7 @@ export default function Overview() {
|
|
|
366
366
|
variant="outlined"
|
|
367
367
|
sx={{ padding: 1, width: 0.48 }}>
|
|
368
368
|
<Box>
|
|
369
|
-
<Typography component="div" sx={{ fontSize: '
|
|
369
|
+
<Typography component="div" sx={{ fontSize: '1.75rem' }}>
|
|
370
370
|
{metric.count}
|
|
371
371
|
</Typography>
|
|
372
372
|
<Typography sx={{ fontSize: 14 }} color="text.secondary">
|
|
@@ -139,7 +139,7 @@ export default function PaymentIntentDetail(props: { id: string }) {
|
|
|
139
139
|
sx={{ width: '52px', height: '52px', borderRadius: 'var(--radius-s, 4px)' }}
|
|
140
140
|
/>
|
|
141
141
|
<Stack direction="column" alignItems="flex-start" justifyContent="space-around">
|
|
142
|
-
<Amount amount={received} sx={{ my: 0, fontSize: '
|
|
142
|
+
<Amount amount={received} sx={{ my: 0, fontSize: '1.75rem', lineHeight: '32px' }} />
|
|
143
143
|
<Copyable text={props.id} />
|
|
144
144
|
</Stack>
|
|
145
145
|
</Stack>
|
|
@@ -159,7 +159,7 @@ export default function PayoutDetail(props: { id: string }) {
|
|
|
159
159
|
sx={{ width: '52px', height: '52px', borderRadius: 'var(--radius-s, 4px)' }}
|
|
160
160
|
/>
|
|
161
161
|
<Stack direction="column" alignItems="flex-start" justifyContent="space-around">
|
|
162
|
-
<Amount amount={total} sx={{ my: 0, fontSize: '
|
|
162
|
+
<Amount amount={total} sx={{ my: 0, fontSize: '1.75rem', lineHeight: '32px' }} />
|
|
163
163
|
<Copyable text={props.id} />
|
|
164
164
|
</Stack>
|
|
165
165
|
</Stack>
|
|
@@ -137,7 +137,7 @@ export default function RefundDetail(props: { id: string }) {
|
|
|
137
137
|
sx={{ width: '52px', height: '52px', borderRadius: 'var(--radius-s, 4px)' }}
|
|
138
138
|
/>
|
|
139
139
|
<Stack direction="column" alignItems="flex-start" justifyContent="space-around">
|
|
140
|
-
<Amount amount={amount} sx={{ my: 0, fontSize: '
|
|
140
|
+
<Amount amount={amount} sx={{ my: 0, fontSize: '1.75rem', lineHeight: '32px' }} />
|
|
141
141
|
<Copyable text={props.id} />
|
|
142
142
|
</Stack>
|
|
143
143
|
</Stack>
|
|
@@ -113,7 +113,7 @@ export default function PayoutDetail() {
|
|
|
113
113
|
sx={{ width: '52px', height: '52px', borderRadius: 'var(--radius-s, 4px)' }}
|
|
114
114
|
/>
|
|
115
115
|
<Stack direction="column" alignItems="flex-start" justifyContent="space-around">
|
|
116
|
-
<Amount amount={total} sx={{ my: 0, fontSize: '
|
|
116
|
+
<Amount amount={total} sx={{ my: 0, fontSize: '1.75rem', lineHeight: '32px' }} />
|
|
117
117
|
</Stack>
|
|
118
118
|
</Stack>
|
|
119
119
|
</Stack>
|
|
@@ -270,7 +270,13 @@ function CustomerSubscriptionChangePayment({ subscription, customer, onComplete
|
|
|
270
270
|
{state.paying ? t('payment.checkout.processing') : t('payment.customer.changePayment.submit')}
|
|
271
271
|
</LoadingButton>
|
|
272
272
|
<Typography
|
|
273
|
-
sx={{
|
|
273
|
+
sx={{
|
|
274
|
+
mt: 1,
|
|
275
|
+
color: 'text.secondary',
|
|
276
|
+
fontSize: '0.7875rem',
|
|
277
|
+
lineHeight: '0.9625rem',
|
|
278
|
+
textAlign: 'center',
|
|
279
|
+
}}>
|
|
274
280
|
{t('payment.customer.changePayment.confirm', {
|
|
275
281
|
payee,
|
|
276
282
|
symbol: findCurrency(settings.paymentMethods, selectedCurrencyId)?.symbol,
|
|
@@ -269,7 +269,7 @@ export default function DonationList() {
|
|
|
269
269
|
|
|
270
270
|
return (
|
|
271
271
|
<>
|
|
272
|
-
<Stack direction="row" alignItems="center" gap={1} flexWrap="wrap"
|
|
272
|
+
<Stack direction="row" alignItems="center" gap={1} flexWrap="wrap">
|
|
273
273
|
<Typography variant="h6">{t('admin.donate.intro')}</Typography>
|
|
274
274
|
<Button variant="text" size="small" onClick={() => setShowExample(true)} sx={{ color: 'text.link' }}>
|
|
275
275
|
{t('admin.donate.usage.viewExample')}
|
|
@@ -3,6 +3,50 @@ import { Box, Typography, Button, TextField, Stack, Paper, Divider } from '@mui/
|
|
|
3
3
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
4
4
|
import type { TSetting } from '@blocklet/payment-types';
|
|
5
5
|
|
|
6
|
+
function PreviewAvatars({ count }: { count: number }) {
|
|
7
|
+
return (
|
|
8
|
+
<Stack flexDirection="row" justifyContent="center" alignItems="center">
|
|
9
|
+
{/* Avatar Group */}
|
|
10
|
+
<Box sx={{ display: 'flex', position: 'relative' }}>
|
|
11
|
+
{Array(Math.min(count, 5))
|
|
12
|
+
.fill(0)
|
|
13
|
+
.map((_, i) => (
|
|
14
|
+
<Box
|
|
15
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
16
|
+
key={i}
|
|
17
|
+
sx={{
|
|
18
|
+
width: '24px',
|
|
19
|
+
height: '24px',
|
|
20
|
+
borderRadius: '50%',
|
|
21
|
+
bgcolor: '#e0e0e0',
|
|
22
|
+
border: '2px solid #fff',
|
|
23
|
+
position: 'relative',
|
|
24
|
+
marginLeft: i === 0 ? 0 : '-8px',
|
|
25
|
+
zIndex: count - i,
|
|
26
|
+
}}
|
|
27
|
+
/>
|
|
28
|
+
))}
|
|
29
|
+
</Box>
|
|
30
|
+
|
|
31
|
+
{/* Counter Box */}
|
|
32
|
+
<Box
|
|
33
|
+
sx={{
|
|
34
|
+
fontSize: '14px',
|
|
35
|
+
color: 'text.secondary',
|
|
36
|
+
pl: 1.5,
|
|
37
|
+
pr: 1,
|
|
38
|
+
ml: -1,
|
|
39
|
+
borderRadius: '8px',
|
|
40
|
+
backgroundColor: '#f4f4f5',
|
|
41
|
+
height: '24px',
|
|
42
|
+
display: 'flex',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
}}>
|
|
45
|
+
{`${count} supporter${count > 1 ? 's' : ''} (XX ABT)`}
|
|
46
|
+
</Box>
|
|
47
|
+
</Stack>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
6
50
|
export default function DonationPreview({ config }: { config: TSetting['settings'] }) {
|
|
7
51
|
const { t } = useLocaleContext();
|
|
8
52
|
const hasPresets = config.settings.amount.presets?.length > 0;
|
|
@@ -41,43 +85,12 @@ export default function DonationPreview({ config }: { config: TSetting['settings
|
|
|
41
85
|
{t('admin.donate.btn.preview')}
|
|
42
86
|
</Typography>
|
|
43
87
|
<Stack spacing={2} alignItems="center">
|
|
44
|
-
<Button variant="
|
|
88
|
+
<Button variant="outlined" color="primary">
|
|
45
89
|
{config.settings.btnText}
|
|
46
90
|
</Button>
|
|
47
|
-
|
|
91
|
+
<PreviewAvatars count={3} />
|
|
48
92
|
<Box sx={{ width: '100%', maxWidth: 300 }}>
|
|
49
|
-
|
|
50
|
-
total XX ABT
|
|
51
|
-
</Typography>
|
|
52
|
-
{config.settings.historyType === 'avatar' ? (
|
|
53
|
-
<Box
|
|
54
|
-
sx={{
|
|
55
|
-
height: 40,
|
|
56
|
-
position: 'relative',
|
|
57
|
-
display: 'flex',
|
|
58
|
-
alignItems: 'center',
|
|
59
|
-
justifyContent: 'center',
|
|
60
|
-
}}>
|
|
61
|
-
{Array(5)
|
|
62
|
-
.fill(0)
|
|
63
|
-
.map((_, i) => (
|
|
64
|
-
<Box
|
|
65
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
66
|
-
key={i}
|
|
67
|
-
sx={{
|
|
68
|
-
width: 32,
|
|
69
|
-
height: 32,
|
|
70
|
-
borderRadius: '50%',
|
|
71
|
-
bgcolor: '#e0e0e0',
|
|
72
|
-
position: 'absolute',
|
|
73
|
-
left: `calc(50% - 16px + ${i * 24}px - ${2 * 24}px)`,
|
|
74
|
-
opacity: 1 - i * 0.1,
|
|
75
|
-
border: '2px solid #fff',
|
|
76
|
-
}}
|
|
77
|
-
/>
|
|
78
|
-
))}
|
|
79
|
-
</Box>
|
|
80
|
-
) : (
|
|
93
|
+
{config.settings.historyType === 'table' && (
|
|
81
94
|
<Box
|
|
82
95
|
sx={{
|
|
83
96
|
borderRadius: 1,
|
|
@@ -96,30 +109,38 @@ export default function DonationPreview({ config }: { config: TSetting['settings
|
|
|
96
109
|
sx={{
|
|
97
110
|
display: 'flex',
|
|
98
111
|
justifyContent: 'center',
|
|
99
|
-
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
gap: 1,
|
|
100
114
|
opacity: 1 - i * 0.2,
|
|
101
115
|
width: '100%',
|
|
102
116
|
maxWidth: 240,
|
|
103
117
|
}}>
|
|
118
|
+
<Box display="flex" alignItems="center" gap={0.5} width="75%">
|
|
119
|
+
<Box
|
|
120
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
121
|
+
key={i}
|
|
122
|
+
sx={{
|
|
123
|
+
width: '16px',
|
|
124
|
+
height: '16px',
|
|
125
|
+
borderRadius: '50%',
|
|
126
|
+
bgcolor: '#e0e0e0',
|
|
127
|
+
border: '2px solid #fff',
|
|
128
|
+
position: 'relative',
|
|
129
|
+
}}
|
|
130
|
+
/>
|
|
131
|
+
<Box
|
|
132
|
+
sx={{
|
|
133
|
+
width: '100%',
|
|
134
|
+
height: 8,
|
|
135
|
+
borderRadius: 1,
|
|
136
|
+
bgcolor: '#e0e0e0',
|
|
137
|
+
}}
|
|
138
|
+
/>
|
|
139
|
+
</Box>
|
|
140
|
+
|
|
104
141
|
<Box
|
|
105
142
|
sx={{
|
|
106
|
-
width: '
|
|
107
|
-
height: 8,
|
|
108
|
-
borderRadius: 1,
|
|
109
|
-
bgcolor: '#e0e0e0',
|
|
110
|
-
}}
|
|
111
|
-
/>
|
|
112
|
-
<Box
|
|
113
|
-
sx={{
|
|
114
|
-
width: '20%',
|
|
115
|
-
height: 8,
|
|
116
|
-
borderRadius: 1,
|
|
117
|
-
bgcolor: '#e0e0e0',
|
|
118
|
-
}}
|
|
119
|
-
/>
|
|
120
|
-
<Box
|
|
121
|
-
sx={{
|
|
122
|
-
width: '15%',
|
|
143
|
+
width: '25%',
|
|
123
144
|
height: 8,
|
|
124
145
|
borderRadius: 1,
|
|
125
146
|
bgcolor: '#e0e0e0',
|