payment-kit 1.14.24 → 1.14.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.
- package/api/src/store/models/types.ts +1 -0
- package/blocklet.yml +1 -1
- package/package.json +4 -4
- package/src/components/event/list.tsx +35 -24
- package/src/components/filter-toolbar.tsx +15 -10
- package/src/components/info-metric.tsx +10 -2
- package/src/components/info-row.tsx +2 -1
- package/src/components/invoice/list.tsx +11 -3
- package/src/components/metadata/editor.tsx +1 -0
- package/src/components/metadata/form.tsx +12 -3
- package/src/components/payment-currency/form.tsx +4 -0
- package/src/components/payment-intent/list.tsx +11 -2
- package/src/components/payment-link/before-pay.tsx +25 -2
- package/src/components/payment-method/arcblock.tsx +4 -0
- package/src/components/payment-method/bitcoin.tsx +4 -0
- package/src/components/payment-method/ethereum.tsx +4 -0
- package/src/components/payouts/list.tsx +12 -2
- package/src/components/pricing-table/price-item.tsx +18 -4
- package/src/components/product/actions.tsx +6 -3
- package/src/components/refund/list.tsx +11 -3
- package/src/components/subscription/description.tsx +3 -2
- package/src/components/subscription/list.tsx +3 -2
- package/src/components/uploader.tsx +65 -28
- package/src/components/webhook/attempts.tsx +40 -33
- package/src/libs/util.ts +17 -2
- package/src/locales/en.tsx +2 -0
- package/src/locales/zh.tsx +2 -0
- package/src/pages/admin/billing/index.tsx +3 -0
- package/src/pages/admin/billing/invoices/detail.tsx +10 -5
- package/src/pages/admin/billing/subscriptions/detail.tsx +10 -5
- package/src/pages/admin/customers/customers/detail.tsx +11 -6
- package/src/pages/admin/customers/index.tsx +3 -0
- package/src/pages/admin/developers/events/detail.tsx +47 -8
- package/src/pages/admin/index.tsx +4 -1
- package/src/pages/admin/payments/index.tsx +3 -0
- package/src/pages/admin/payments/intents/detail.tsx +10 -4
- package/src/pages/admin/payments/payouts/detail.tsx +10 -4
- package/src/pages/admin/payments/refunds/detail.tsx +10 -4
- package/src/pages/admin/products/index.tsx +3 -0
- package/src/pages/admin/products/passports/index.tsx +1 -1
- package/src/pages/admin/products/prices/detail.tsx +10 -5
- package/src/pages/admin/products/products/detail.tsx +18 -11
- package/src/pages/admin/settings/index.tsx +3 -0
- package/src/pages/customer/subscription/embed.tsx +3 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { styled } from '@mui/system';
|
|
1
|
+
import { Avatar, Box, Button } from '@mui/material';
|
|
2
|
+
import { Stack, styled } from '@mui/system';
|
|
4
3
|
import { lazy, useCallback, useEffect, useRef } from 'react';
|
|
4
|
+
import { CloudUpload, Delete, Edit } from '@mui/icons-material';
|
|
5
5
|
|
|
6
6
|
const UploaderComponent = lazy(() => import('@blocklet/uploader/react').then((res) => ({ default: res.Uploader })));
|
|
7
7
|
|
|
@@ -14,7 +14,6 @@ type Props = {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export default function Uploader({ onUploaded, preview, maxFileSize, maxNumberOfFiles, allowedFileExts }: Props) {
|
|
17
|
-
const { t } = useLocaleContext();
|
|
18
17
|
const uploaderRef = useRef<any>(null);
|
|
19
18
|
const handleOpen = useCallback(() => {
|
|
20
19
|
if (!uploaderRef.current) return;
|
|
@@ -34,25 +33,66 @@ export default function Uploader({ onUploaded, preview, maxFileSize, maxNumberOf
|
|
|
34
33
|
|
|
35
34
|
return (
|
|
36
35
|
<>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
36
|
+
{!preview && (
|
|
37
|
+
<Div
|
|
38
|
+
display="flex"
|
|
39
|
+
alignItems="center"
|
|
40
|
+
justifyContent="center"
|
|
41
|
+
onClick={handleOpen}
|
|
42
|
+
sx={{
|
|
43
|
+
position: 'relative',
|
|
44
|
+
cursor: 'pointer',
|
|
45
|
+
}}>
|
|
46
|
+
<CloudUpload style={{ fontSize: 32, color: '#ccc' }} />
|
|
47
|
+
</Div>
|
|
48
|
+
)}
|
|
49
|
+
{preview && (
|
|
50
|
+
<Div
|
|
51
|
+
sx={{
|
|
52
|
+
border: 'none',
|
|
53
|
+
'&:hover': {
|
|
54
|
+
backgroundColor: 'rgba(0, 0, 0, 0.45)',
|
|
55
|
+
},
|
|
56
|
+
}}>
|
|
57
|
+
<Avatar
|
|
58
|
+
src={preview}
|
|
59
|
+
alt="picture"
|
|
60
|
+
variant="square"
|
|
61
|
+
sx={{ width: '100%', height: '100%', borderRadius: '2px' }}
|
|
62
|
+
/>
|
|
63
|
+
<Div
|
|
64
|
+
display="flex"
|
|
65
|
+
alignItems="center"
|
|
66
|
+
justifyContent="center"
|
|
67
|
+
sx={{
|
|
68
|
+
position: 'absolute',
|
|
69
|
+
top: 0,
|
|
70
|
+
left: 0,
|
|
71
|
+
width: '100%',
|
|
72
|
+
height: '100%',
|
|
73
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
74
|
+
opacity: {
|
|
75
|
+
xs: 1,
|
|
76
|
+
md: 0,
|
|
77
|
+
},
|
|
78
|
+
transition: 'opacity 0.3s',
|
|
79
|
+
'&:hover': {
|
|
80
|
+
opacity: 1,
|
|
81
|
+
},
|
|
82
|
+
}}>
|
|
83
|
+
<Stack direction="row">
|
|
84
|
+
<Button variant="text" onClick={handleOpen} startIcon={<Edit />} sx={{ minWidth: 20, color: '#fff' }} />
|
|
85
|
+
<Button
|
|
86
|
+
variant="text"
|
|
87
|
+
onClick={handleRemove}
|
|
88
|
+
startIcon={<Delete />}
|
|
89
|
+
sx={{ minWidth: 20, color: '#fff' }}
|
|
90
|
+
/>
|
|
91
|
+
</Stack>
|
|
92
|
+
</Div>
|
|
93
|
+
</Div>
|
|
94
|
+
)}
|
|
95
|
+
|
|
56
96
|
<UploaderComponent
|
|
57
97
|
// @ts-ignore
|
|
58
98
|
ref={uploaderRef}
|
|
@@ -89,13 +129,10 @@ Uploader.defaultProps = {
|
|
|
89
129
|
};
|
|
90
130
|
|
|
91
131
|
const Div = styled(Box)`
|
|
92
|
-
border: 1px solid #
|
|
132
|
+
border: 1px solid var(--stroke-border-base, #eff1f5);
|
|
93
133
|
border-radius: 4px;
|
|
94
134
|
cursor: pointer;
|
|
95
135
|
width: 120px;
|
|
96
136
|
height: 120px;
|
|
97
|
-
|
|
98
|
-
&:hover {
|
|
99
|
-
background-color: #fafafa;
|
|
100
|
-
}
|
|
137
|
+
position: relative;
|
|
101
138
|
`;
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
import { useInfiniteScroll } from 'ahooks';
|
|
20
20
|
import React, { useEffect, useState } from 'react';
|
|
21
21
|
|
|
22
|
+
import { isEmpty } from 'lodash';
|
|
22
23
|
import { isSuccessAttempt } from '../../libs/util';
|
|
23
24
|
|
|
24
25
|
const fetchData = (params: Record<string, any> = {}): Promise<Paginated<TWebhookAttemptExpanded>> => {
|
|
@@ -88,42 +89,48 @@ export default function WebhookAttempts({ event_id, webhook_endpoint_id, event }
|
|
|
88
89
|
const hasMore = data && data.list.length < data.count;
|
|
89
90
|
|
|
90
91
|
return (
|
|
91
|
-
<Grid container spacing={
|
|
92
|
-
<Grid item xs={4} className="attempt-list">
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
92
|
+
<Grid container spacing={2.5}>
|
|
93
|
+
<Grid item xs={12} md={4} className="attempt-list">
|
|
94
|
+
{isEmpty(Object.keys(groupedAttempts)) ? (
|
|
95
|
+
<Typography color="text.secondary">No Attempt</Typography>
|
|
96
|
+
) : (
|
|
97
|
+
<>
|
|
98
|
+
<List sx={{ maxHeight: '64vh', overflowY: 'scroll' }}>
|
|
99
|
+
{Object.entries(groupedAttempts).map(([date, items]) => (
|
|
100
|
+
<React.Fragment key={date}>
|
|
101
|
+
<ListSubheader>{date}</ListSubheader>
|
|
102
|
+
{items.map((attempt) => (
|
|
103
|
+
<ListItem
|
|
104
|
+
button
|
|
105
|
+
key={attempt.id}
|
|
106
|
+
onClick={() => handleAttemptClick(attempt)}
|
|
107
|
+
selected={selected === attempt}
|
|
108
|
+
secondaryAction={
|
|
109
|
+
<Typography color="text.secondary">{formatTime(attempt.created_at, 'HH:mm:ss A')}</Typography>
|
|
110
|
+
}>
|
|
111
|
+
<ListItemIcon>
|
|
112
|
+
{isSuccessAttempt(attempt.response_status) === false ? (
|
|
113
|
+
<ErrorOutlined color="error" />
|
|
114
|
+
) : (
|
|
115
|
+
<CheckCircleOutlined color="success" />
|
|
116
|
+
)}
|
|
117
|
+
</ListItemIcon>
|
|
118
|
+
<ListItemText primary={<Typography color="text.primary">{attempt.event.type}</Typography>} />
|
|
119
|
+
</ListItem>
|
|
120
|
+
))}
|
|
121
|
+
</React.Fragment>
|
|
115
122
|
))}
|
|
116
|
-
</
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
</List>
|
|
124
|
+
{hasMore && (
|
|
125
|
+
<Button variant="text" type="button" color="inherit" onClick={loadMore} disabled={loadingMore}>
|
|
126
|
+
{loadingMore ? 'Loading more...' : 'Load more'}
|
|
127
|
+
</Button>
|
|
128
|
+
)}
|
|
129
|
+
{!hasMore && <Typography color="text.secondary">No more data</Typography>}
|
|
130
|
+
</>
|
|
123
131
|
)}
|
|
124
|
-
{!hasMore && <Typography color="text.secondary">No more data</Typography>}
|
|
125
132
|
</Grid>
|
|
126
|
-
<Grid item xs={8}>
|
|
133
|
+
<Grid item xs={12} md={8}>
|
|
127
134
|
{selected && (
|
|
128
135
|
<Stack direction="column" spacing={2} sx={{ pt: 3, pl: 3, borderLeft: '1px solid #eee' }}>
|
|
129
136
|
<Typography variant="h6">{event_id ? selected.endpoint.url : selected.event.type}</Typography>
|
package/src/libs/util.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type {
|
|
|
14
14
|
} from '@blocklet/payment-types';
|
|
15
15
|
import { Hasher } from '@ocap/mcrypto';
|
|
16
16
|
import { hexToNumber } from '@ocap/util';
|
|
17
|
-
import { isObject } from 'lodash';
|
|
17
|
+
import { isEmpty, isObject } from 'lodash';
|
|
18
18
|
import cloneDeep from 'lodash/cloneDeep';
|
|
19
19
|
import isEqual from 'lodash/isEqual';
|
|
20
20
|
import { joinURL } from 'ufo';
|
|
@@ -67,7 +67,15 @@ export function formatPaymentLinkPricing(
|
|
|
67
67
|
currency: TPaymentCurrency,
|
|
68
68
|
locale: string = 'en'
|
|
69
69
|
) {
|
|
70
|
-
return formatCheckoutHeadlines(
|
|
70
|
+
return formatCheckoutHeadlines(
|
|
71
|
+
link.line_items,
|
|
72
|
+
currency,
|
|
73
|
+
{
|
|
74
|
+
trialInDays: link.subscription_data?.trial_period_days || 0,
|
|
75
|
+
trialEnd: link.subscription_data?.trial_end || 0,
|
|
76
|
+
},
|
|
77
|
+
locale
|
|
78
|
+
);
|
|
71
79
|
}
|
|
72
80
|
|
|
73
81
|
export function getWebhookStatusColor(status: string) {
|
|
@@ -256,3 +264,10 @@ export function isObjectContent(value: string) {
|
|
|
256
264
|
return false;
|
|
257
265
|
}
|
|
258
266
|
}
|
|
267
|
+
|
|
268
|
+
export function isEmptyExceptNumber(value: any): boolean {
|
|
269
|
+
if (typeof value === 'number') {
|
|
270
|
+
return false;
|
|
271
|
+
}
|
|
272
|
+
return isEmpty(value);
|
|
273
|
+
}
|
package/src/locales/en.tsx
CHANGED
|
@@ -216,6 +216,7 @@ export default flat({
|
|
|
216
216
|
allowPromotionCodes: 'Allow promotion codes',
|
|
217
217
|
requireCrossSell: 'Require cross sell products selected if eligible',
|
|
218
218
|
includeFreeTrial: 'Include a free trial',
|
|
219
|
+
freeTrialDaysPositive: 'Free trial days must be positive',
|
|
219
220
|
includeCustomFields: 'Add custom fields',
|
|
220
221
|
confirmPage: 'Confirmation Page',
|
|
221
222
|
showConfirmPage: 'Show confirmation page',
|
|
@@ -577,6 +578,7 @@ export default flat({
|
|
|
577
578
|
subscriptions: 'No Subscriptions',
|
|
578
579
|
customers: 'No Customers',
|
|
579
580
|
products: 'No Products',
|
|
581
|
+
payouts: 'No Payouts',
|
|
580
582
|
paymentLinks: 'No Payment Links',
|
|
581
583
|
paymentMethods: 'No Payment Methods',
|
|
582
584
|
pricingTables: 'No Pricing Tables',
|
package/src/locales/zh.tsx
CHANGED
|
@@ -211,6 +211,7 @@ export default flat({
|
|
|
211
211
|
requirePhoneNumber: '收集客户的电话号码',
|
|
212
212
|
allowPromotionCodes: '允许促销代码',
|
|
213
213
|
includeFreeTrial: '包含免费试用',
|
|
214
|
+
freeTrialDaysPositive: '免费试用天数必须是正数',
|
|
214
215
|
includeCustomFields: '添加自定义字段',
|
|
215
216
|
requireCrossSell: '用户必须选择交叉销售的商品(如果有的话)',
|
|
216
217
|
confirmPage: '确认页面',
|
|
@@ -567,6 +568,7 @@ export default flat({
|
|
|
567
568
|
subscriptions: '没有订阅记录',
|
|
568
569
|
customers: '没有客户',
|
|
569
570
|
products: '没有产品',
|
|
571
|
+
payouts: '没有出款记录',
|
|
570
572
|
paymentLinks: '没有支付链接',
|
|
571
573
|
paymentMethods: '没有支付方式',
|
|
572
574
|
pricingTables: '没有定价表',
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
formatError,
|
|
11
11
|
formatTime,
|
|
12
12
|
getInvoiceStatusColor,
|
|
13
|
+
useMobile,
|
|
13
14
|
} from '@blocklet/payment-react';
|
|
14
15
|
import type { TInvoice, TInvoiceExpanded } from '@blocklet/payment-types';
|
|
15
16
|
import { ArrowBackOutlined } from '@mui/icons-material';
|
|
@@ -43,6 +44,7 @@ const InfoAlignItems = 'flex-start';
|
|
|
43
44
|
|
|
44
45
|
export default function InvoiceDetail(props: { id: string }) {
|
|
45
46
|
const { t } = useLocaleContext();
|
|
47
|
+
const { isMobile } = useMobile();
|
|
46
48
|
const [state, setState] = useSetState({
|
|
47
49
|
adding: {
|
|
48
50
|
price: false,
|
|
@@ -87,7 +89,7 @@ export default function InvoiceDetail(props: { id: string }) {
|
|
|
87
89
|
setState((prev) => ({ editing: { ...prev.editing, metadata: true } }));
|
|
88
90
|
};
|
|
89
91
|
return (
|
|
90
|
-
<Root direction="column" spacing={
|
|
92
|
+
<Root direction="column" spacing={2.5} sx={{ mb: 4 }}>
|
|
91
93
|
<Box>
|
|
92
94
|
<Stack className="page-header" direction="row" justifyContent="space-between" alignItems="center">
|
|
93
95
|
<Stack
|
|
@@ -179,7 +181,10 @@ export default function InvoiceDetail(props: { id: string }) {
|
|
|
179
181
|
xs: 'column',
|
|
180
182
|
lg: 'row',
|
|
181
183
|
},
|
|
182
|
-
gap:
|
|
184
|
+
gap: {
|
|
185
|
+
xs: 2.5,
|
|
186
|
+
md: 4,
|
|
187
|
+
},
|
|
183
188
|
'.payment-link-column-1': {
|
|
184
189
|
minWidth: {
|
|
185
190
|
xs: '100%',
|
|
@@ -198,8 +203,7 @@ export default function InvoiceDetail(props: { id: string }) {
|
|
|
198
203
|
},
|
|
199
204
|
},
|
|
200
205
|
}}>
|
|
201
|
-
<Box flex={1} className="payment-link-column-1" sx={{ gap:
|
|
202
|
-
{' '}
|
|
206
|
+
<Box flex={1} className="payment-link-column-1" sx={{ gap: 2.5, display: 'flex', flexDirection: 'column' }}>
|
|
203
207
|
<Box className="section">
|
|
204
208
|
<SectionHeader title={t('admin.details')} />
|
|
205
209
|
<Stack
|
|
@@ -349,7 +353,8 @@ export default function InvoiceDetail(props: { id: string }) {
|
|
|
349
353
|
</Box>
|
|
350
354
|
</Box>
|
|
351
355
|
</Box>
|
|
352
|
-
|
|
356
|
+
{isMobile && <Divider />}
|
|
357
|
+
<Box className="payment-link-column-2" sx={{ gap: 2.5, display: 'flex', flexDirection: 'column' }}>
|
|
353
358
|
<Box className="section">
|
|
354
359
|
<SectionHeader title={t('admin.connections')} />
|
|
355
360
|
<Stack>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable react/no-unstable-nested-components */
|
|
2
2
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
3
3
|
import Toast from '@arcblock/ux/lib/Toast';
|
|
4
|
-
import { TxLink, api, formatError, formatSubscriptionProduct, formatTime } from '@blocklet/payment-react';
|
|
4
|
+
import { TxLink, api, formatError, formatSubscriptionProduct, formatTime, useMobile } from '@blocklet/payment-react';
|
|
5
5
|
import type { TProduct, TSubscriptionExpanded } from '@blocklet/payment-types';
|
|
6
6
|
import { ArrowBackOutlined } from '@mui/icons-material';
|
|
7
7
|
import { Alert, Box, Button, CircularProgress, Divider, Stack, Typography } from '@mui/material';
|
|
@@ -33,6 +33,7 @@ const InfoAlignItems = 'flex-start';
|
|
|
33
33
|
|
|
34
34
|
export default function SubscriptionDetail(props: { id: string }) {
|
|
35
35
|
const { t } = useLocaleContext();
|
|
36
|
+
const { isMobile } = useMobile();
|
|
36
37
|
const [state, setState] = useSetState({
|
|
37
38
|
adding: {
|
|
38
39
|
price: false,
|
|
@@ -78,7 +79,7 @@ export default function SubscriptionDetail(props: { id: string }) {
|
|
|
78
79
|
};
|
|
79
80
|
|
|
80
81
|
return (
|
|
81
|
-
<Root direction="column" spacing={
|
|
82
|
+
<Root direction="column" spacing={2.5} sx={{ mb: 4 }}>
|
|
82
83
|
<Box>
|
|
83
84
|
<Stack className="page-header" direction="row" justifyContent="space-between" alignItems="center">
|
|
84
85
|
<Stack
|
|
@@ -158,7 +159,10 @@ export default function SubscriptionDetail(props: { id: string }) {
|
|
|
158
159
|
xs: 'column',
|
|
159
160
|
lg: 'row',
|
|
160
161
|
},
|
|
161
|
-
gap:
|
|
162
|
+
gap: {
|
|
163
|
+
xs: 2.5,
|
|
164
|
+
md: 4,
|
|
165
|
+
},
|
|
162
166
|
'.payment-link-column-1': {
|
|
163
167
|
minWidth: {
|
|
164
168
|
xs: '100%',
|
|
@@ -177,7 +181,7 @@ export default function SubscriptionDetail(props: { id: string }) {
|
|
|
177
181
|
},
|
|
178
182
|
},
|
|
179
183
|
}}>
|
|
180
|
-
<Box flex={1} className="payment-link-column-1" sx={{ gap:
|
|
184
|
+
<Box flex={1} className="payment-link-column-1" sx={{ gap: 2.5, display: 'flex', flexDirection: 'column' }}>
|
|
181
185
|
<Box className="section">
|
|
182
186
|
<SectionHeader title={t('admin.details')}>
|
|
183
187
|
{/* <Button
|
|
@@ -332,7 +336,8 @@ export default function SubscriptionDetail(props: { id: string }) {
|
|
|
332
336
|
</Box>
|
|
333
337
|
</Box>
|
|
334
338
|
</Box>
|
|
335
|
-
|
|
339
|
+
{isMobile && <Divider />}
|
|
340
|
+
<Box className="payment-link-column-2" sx={{ gap: 2.5, display: 'flex', flexDirection: 'column' }}>
|
|
336
341
|
<Box className="section">
|
|
337
342
|
<SectionHeader title={t('common.metadata.label')}>
|
|
338
343
|
<Button
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import DidAddress from '@arcblock/ux/lib/DID';
|
|
3
3
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
4
4
|
import Toast from '@arcblock/ux/lib/Toast';
|
|
5
|
-
import { api, formatBNStr, formatError, formatTime, usePaymentContext } from '@blocklet/payment-react';
|
|
5
|
+
import { api, formatBNStr, formatError, formatTime, useMobile, usePaymentContext } from '@blocklet/payment-react';
|
|
6
6
|
import type { GroupedBN, TCustomerExpanded, TPaymentMethodExpanded } from '@blocklet/payment-types';
|
|
7
7
|
import { ArrowBackOutlined } from '@mui/icons-material';
|
|
8
8
|
import { Alert, Avatar, Box, Button, CircularProgress, Divider, Stack, Typography } from '@mui/material';
|
|
@@ -76,6 +76,7 @@ function getTokenBalances(customer: TCustomerExpanded, paymentMethods: TPaymentM
|
|
|
76
76
|
|
|
77
77
|
export default function CustomerDetail(props: { id: string }) {
|
|
78
78
|
const { t } = useLocaleContext();
|
|
79
|
+
const { isMobile } = useMobile();
|
|
79
80
|
const { settings } = usePaymentContext();
|
|
80
81
|
const [state, setState] = useSetState({
|
|
81
82
|
adding: {
|
|
@@ -146,7 +147,7 @@ export default function CustomerDetail(props: { id: string }) {
|
|
|
146
147
|
};
|
|
147
148
|
|
|
148
149
|
return (
|
|
149
|
-
<Root direction="column" spacing={
|
|
150
|
+
<Root direction="column" spacing={2.5} sx={{ mb: 4 }}>
|
|
150
151
|
<Box>
|
|
151
152
|
<Stack className="page-header" direction="row" justifyContent="space-between" alignItems="center">
|
|
152
153
|
<Stack
|
|
@@ -241,7 +242,10 @@ export default function CustomerDetail(props: { id: string }) {
|
|
|
241
242
|
xs: 'column',
|
|
242
243
|
lg: 'row',
|
|
243
244
|
},
|
|
244
|
-
gap:
|
|
245
|
+
gap: {
|
|
246
|
+
xs: 2.5,
|
|
247
|
+
md: 4,
|
|
248
|
+
},
|
|
245
249
|
'.payment-link-column-1': {
|
|
246
250
|
minWidth: {
|
|
247
251
|
xs: '100%',
|
|
@@ -260,7 +264,7 @@ export default function CustomerDetail(props: { id: string }) {
|
|
|
260
264
|
},
|
|
261
265
|
},
|
|
262
266
|
}}>
|
|
263
|
-
<Box flex={1} className="payment-link-column-1" sx={{ gap:
|
|
267
|
+
<Box flex={1} className="payment-link-column-1" sx={{ gap: 2.5, display: 'flex', flexDirection: 'column' }}>
|
|
264
268
|
<Box className="section">
|
|
265
269
|
<SectionHeader title={t('admin.details')} />
|
|
266
270
|
<Stack>
|
|
@@ -387,10 +391,11 @@ export default function CustomerDetail(props: { id: string }) {
|
|
|
387
391
|
</Box>
|
|
388
392
|
</Box>
|
|
389
393
|
</Box>
|
|
390
|
-
|
|
394
|
+
{isMobile && <Divider />}
|
|
395
|
+
<Box className="payment-link-column-2" sx={{ gap: 2.5, display: 'flex', flexDirection: 'column' }}>
|
|
391
396
|
<Box className="section">
|
|
392
397
|
<SectionHeader title={t('admin.metrics')} />
|
|
393
|
-
<Box className="section-body">
|
|
398
|
+
<Box className="section-body" sx={{ '.info-row-value': { width: '100%' } }}>
|
|
394
399
|
<InfoRow
|
|
395
400
|
label={t('admin.customer.spent')}
|
|
396
401
|
value={<BalanceList data={data.summary?.paid} showLogo />}
|
|
@@ -3,7 +3,7 @@ import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
|
3
3
|
import { api, formatTime } from '@blocklet/payment-react';
|
|
4
4
|
import type { TEventExpanded } from '@blocklet/payment-types';
|
|
5
5
|
import { ArrowBackOutlined } from '@mui/icons-material';
|
|
6
|
-
import { Alert, Box, CircularProgress, Stack, Typography } from '@mui/material';
|
|
6
|
+
import { Alert, Box, CircularProgress, Divider, Stack, Typography } from '@mui/material';
|
|
7
7
|
import { styled } from '@mui/system';
|
|
8
8
|
import { useRequest } from 'ahooks';
|
|
9
9
|
|
|
@@ -31,7 +31,7 @@ export default function EventDetail(props: { id: string }) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
|
-
<Root direction="column" spacing={
|
|
34
|
+
<Root direction="column" spacing={2.5} sx={{ mb: 4 }}>
|
|
35
35
|
<Box>
|
|
36
36
|
<Stack className="page-header" direction="row" justifyContent="space-between" alignItems="center">
|
|
37
37
|
<Stack
|
|
@@ -44,26 +44,65 @@ export default function EventDetail(props: { id: string }) {
|
|
|
44
44
|
{t('admin.events')}
|
|
45
45
|
</Typography>
|
|
46
46
|
</Stack>
|
|
47
|
-
<Copyable text={props.id} style={{ marginLeft: 4 }} />
|
|
48
47
|
</Stack>
|
|
49
|
-
<Box
|
|
48
|
+
<Box
|
|
49
|
+
mt={4}
|
|
50
|
+
mb={3}
|
|
51
|
+
sx={{
|
|
52
|
+
display: 'flex',
|
|
53
|
+
gap: {
|
|
54
|
+
xs: 2,
|
|
55
|
+
sm: 2,
|
|
56
|
+
md: 5,
|
|
57
|
+
},
|
|
58
|
+
flexWrap: 'wrap',
|
|
59
|
+
flexDirection: {
|
|
60
|
+
xs: 'column',
|
|
61
|
+
sm: 'column',
|
|
62
|
+
md: 'row',
|
|
63
|
+
},
|
|
64
|
+
alignItems: {
|
|
65
|
+
xs: 'flex-start',
|
|
66
|
+
sm: 'flex-start',
|
|
67
|
+
md: 'center',
|
|
68
|
+
},
|
|
69
|
+
}}>
|
|
50
70
|
<Stack direction="row" justifyContent="space-between" alignItems="center">
|
|
51
|
-
<Typography variant="
|
|
71
|
+
<Typography variant="h2" fontWeight={600}>
|
|
52
72
|
{data.type}
|
|
53
73
|
</Typography>
|
|
54
74
|
</Stack>
|
|
55
75
|
<Stack
|
|
56
76
|
className="section-body"
|
|
57
|
-
direction="row"
|
|
58
|
-
spacing={3}
|
|
59
77
|
justifyContent="flex-start"
|
|
60
78
|
flexWrap="wrap"
|
|
61
|
-
sx={{
|
|
79
|
+
sx={{
|
|
80
|
+
'hr.MuiDivider-root:last-child': {
|
|
81
|
+
display: 'none',
|
|
82
|
+
},
|
|
83
|
+
flexDirection: {
|
|
84
|
+
xs: 'column',
|
|
85
|
+
sm: 'column',
|
|
86
|
+
md: 'row',
|
|
87
|
+
},
|
|
88
|
+
alignItems: {
|
|
89
|
+
xs: 'flex-start',
|
|
90
|
+
sm: 'flex-start',
|
|
91
|
+
md: 'center',
|
|
92
|
+
},
|
|
93
|
+
gap: {
|
|
94
|
+
xs: 1,
|
|
95
|
+
sm: 1,
|
|
96
|
+
md: 3,
|
|
97
|
+
},
|
|
98
|
+
}}>
|
|
99
|
+
<InfoMetric label={t('common.id')} value={<Copyable text={props.id} style={{ marginLeft: 4 }} />} />
|
|
62
100
|
<InfoMetric label={t('admin.event.pendingWebhooks')} value={data.pending_webhooks} divider />
|
|
63
101
|
<InfoMetric label={t('common.createdAt')} value={formatTime(data.created_at)} divider />
|
|
64
102
|
<InfoMetric label={t('common.updatedAt')} value={formatTime(data.updated_at)} />
|
|
65
103
|
</Stack>
|
|
66
104
|
</Box>
|
|
105
|
+
<Divider />
|
|
67
106
|
</Box>
|
|
68
107
|
<Box className="section">
|
|
69
108
|
<SectionHeader title={t('admin.event.webhooks')} />
|
|
@@ -74,7 +74,7 @@ function Admin() {
|
|
|
74
74
|
return (
|
|
75
75
|
<>
|
|
76
76
|
<ProgressBar pending={isPending} />
|
|
77
|
-
<Stack direction="row" alignItems="center" justifyContent="end" flexWrap="wrap" spacing={1} sx={{ mt: 1, pb:
|
|
77
|
+
<Stack direction="row" alignItems="center" justifyContent="end" flexWrap="wrap" spacing={1} sx={{ mt: 1, pb: 2 }}>
|
|
78
78
|
{/* <Box>{renderNav(group, onTabChange, group1)}</Box> */}
|
|
79
79
|
<Tabs
|
|
80
80
|
tabs={group1}
|
|
@@ -93,6 +93,9 @@ function Admin() {
|
|
|
93
93
|
color: 'text.primary',
|
|
94
94
|
},
|
|
95
95
|
},
|
|
96
|
+
'.MuiTouchRipple-root': {
|
|
97
|
+
display: 'none',
|
|
98
|
+
},
|
|
96
99
|
}}
|
|
97
100
|
/>
|
|
98
101
|
<Stack direction="row" alignItems="center">
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
formatError,
|
|
12
12
|
formatTime,
|
|
13
13
|
getPaymentIntentStatusColor,
|
|
14
|
+
useMobile,
|
|
14
15
|
} from '@blocklet/payment-react';
|
|
15
16
|
import type { TPaymentIntentExpanded } from '@blocklet/payment-types';
|
|
16
17
|
import { ArrowBackOutlined, InfoOutlined } from '@mui/icons-material';
|
|
@@ -41,6 +42,7 @@ const InfoAlignItems = 'flex-start';
|
|
|
41
42
|
|
|
42
43
|
export default function PaymentIntentDetail(props: { id: string }) {
|
|
43
44
|
const { t } = useLocaleContext();
|
|
45
|
+
const { isMobile } = useMobile();
|
|
44
46
|
const [state, setState] = useSetState({
|
|
45
47
|
adding: {
|
|
46
48
|
price: false,
|
|
@@ -90,7 +92,7 @@ export default function PaymentIntentDetail(props: { id: string }) {
|
|
|
90
92
|
setState((prev) => ({ editing: { ...prev.editing, metadata: true } }));
|
|
91
93
|
};
|
|
92
94
|
return (
|
|
93
|
-
<Root direction="column" spacing={
|
|
95
|
+
<Root direction="column" spacing={2.5} mb={4}>
|
|
94
96
|
<Box>
|
|
95
97
|
<Stack className="page-header" direction="row" justifyContent="space-between" alignItems="center">
|
|
96
98
|
<Stack
|
|
@@ -183,7 +185,10 @@ export default function PaymentIntentDetail(props: { id: string }) {
|
|
|
183
185
|
xs: 'column',
|
|
184
186
|
lg: 'row',
|
|
185
187
|
},
|
|
186
|
-
gap:
|
|
188
|
+
gap: {
|
|
189
|
+
xs: 2.5,
|
|
190
|
+
md: 4,
|
|
191
|
+
},
|
|
187
192
|
'.payment-link-column-1': {
|
|
188
193
|
minWidth: {
|
|
189
194
|
xs: '100%',
|
|
@@ -202,7 +207,7 @@ export default function PaymentIntentDetail(props: { id: string }) {
|
|
|
202
207
|
},
|
|
203
208
|
},
|
|
204
209
|
}}>
|
|
205
|
-
<Box flex={1} className="payment-link-column-1" sx={{ gap:
|
|
210
|
+
<Box flex={1} className="payment-link-column-1" sx={{ gap: 2.5, display: 'flex', flexDirection: 'column' }}>
|
|
206
211
|
<Box className="section">
|
|
207
212
|
<SectionHeader title={t('admin.details')} />
|
|
208
213
|
<Stack
|
|
@@ -285,7 +290,8 @@ export default function PaymentIntentDetail(props: { id: string }) {
|
|
|
285
290
|
</Box>
|
|
286
291
|
</Box>
|
|
287
292
|
</Box>
|
|
288
|
-
|
|
293
|
+
{isMobile && <Divider />}
|
|
294
|
+
<Box className="payment-link-column-2" sx={{ gap: 2.5, display: 'flex', flexDirection: 'column' }}>
|
|
289
295
|
<Box className="section">
|
|
290
296
|
<SectionHeader title={t('admin.paymentMethod._name')} />
|
|
291
297
|
<Stack>
|