payment-kit 1.18.55 → 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.
Files changed (130) hide show
  1. package/.eslintrc.js +6 -0
  2. package/api/src/libs/queue/index.ts +1 -3
  3. package/blocklet.yml +1 -1
  4. package/package.json +57 -58
  5. package/src/components/actions.tsx +22 -9
  6. package/src/components/balance-list.tsx +40 -12
  7. package/src/components/collapse.tsx +22 -14
  8. package/src/components/copyable.tsx +8 -7
  9. package/src/components/currency.tsx +15 -7
  10. package/src/components/customer/actions.tsx +1 -5
  11. package/src/components/customer/form.tsx +3 -1
  12. package/src/components/customer/link.tsx +4 -12
  13. package/src/components/customer/notification-preference.tsx +18 -9
  14. package/src/components/customer/overdraft-protection.tsx +112 -41
  15. package/src/components/drawer-form.tsx +42 -18
  16. package/src/components/error.tsx +1 -5
  17. package/src/components/event/list.tsx +9 -10
  18. package/src/components/filter-toolbar.tsx +20 -19
  19. package/src/components/info-card.tsx +32 -18
  20. package/src/components/info-metric.tsx +16 -6
  21. package/src/components/info-row-group.tsx +1 -7
  22. package/src/components/info-row.tsx +30 -24
  23. package/src/components/invoice/action.tsx +1 -7
  24. package/src/components/invoice/list.tsx +15 -25
  25. package/src/components/invoice/recharge.tsx +5 -7
  26. package/src/components/invoice/table.tsx +17 -12
  27. package/src/components/layout/user.tsx +1 -1
  28. package/src/components/metadata/form.tsx +13 -13
  29. package/src/components/metadata/list.tsx +11 -3
  30. package/src/components/passport/actions.tsx +9 -4
  31. package/src/components/payment-currency/add.tsx +16 -3
  32. package/src/components/payment-currency/form.tsx +12 -6
  33. package/src/components/payment-intent/actions.tsx +24 -16
  34. package/src/components/payment-intent/list.tsx +11 -8
  35. package/src/components/payment-link/actions.tsx +1 -5
  36. package/src/components/payment-link/after-pay.tsx +4 -2
  37. package/src/components/payment-link/before-pay.tsx +14 -4
  38. package/src/components/payment-link/item.tsx +27 -6
  39. package/src/components/payment-link/preview.tsx +9 -9
  40. package/src/components/payment-link/product-select.tsx +17 -3
  41. package/src/components/payment-method/arcblock.tsx +6 -1
  42. package/src/components/payment-method/base.tsx +6 -1
  43. package/src/components/payment-method/bitcoin.tsx +6 -1
  44. package/src/components/payment-method/ethereum.tsx +6 -1
  45. package/src/components/payment-method/evm-rpc-input.tsx +11 -7
  46. package/src/components/payment-method/form.tsx +2 -7
  47. package/src/components/payouts/actions.tsx +1 -5
  48. package/src/components/payouts/list.tsx +11 -9
  49. package/src/components/payouts/portal/list.tsx +11 -9
  50. package/src/components/price/currency-select.tsx +28 -17
  51. package/src/components/price/form.tsx +135 -84
  52. package/src/components/price/upsell-select.tsx +10 -2
  53. package/src/components/price/upsell.tsx +7 -2
  54. package/src/components/pricing-table/actions.tsx +1 -5
  55. package/src/components/pricing-table/customer-settings.tsx +5 -1
  56. package/src/components/pricing-table/payment-settings.tsx +14 -4
  57. package/src/components/pricing-table/preview.tsx +9 -9
  58. package/src/components/pricing-table/price-item.tsx +6 -1
  59. package/src/components/pricing-table/product-item.tsx +6 -1
  60. package/src/components/pricing-table/product-settings.tsx +17 -4
  61. package/src/components/product/actions.tsx +1 -5
  62. package/src/components/product/create.tsx +1 -5
  63. package/src/components/product/cross-sell-select.tsx +5 -1
  64. package/src/components/product/cross-sell.tsx +7 -2
  65. package/src/components/product/features.tsx +13 -3
  66. package/src/components/product/form.tsx +38 -10
  67. package/src/components/progress-bar.tsx +1 -1
  68. package/src/components/refund/actions.tsx +1 -7
  69. package/src/components/refund/list.tsx +12 -17
  70. package/src/components/section/header.tsx +23 -12
  71. package/src/components/subscription/actions/cancel.tsx +22 -5
  72. package/src/components/subscription/actions/index.tsx +9 -10
  73. package/src/components/subscription/actions/pause.tsx +32 -6
  74. package/src/components/subscription/actions/slash-stake.tsx +5 -3
  75. package/src/components/subscription/description.tsx +12 -8
  76. package/src/components/subscription/items/index.tsx +30 -15
  77. package/src/components/subscription/items/usage-records.tsx +19 -5
  78. package/src/components/subscription/list.tsx +5 -7
  79. package/src/components/subscription/metrics.tsx +27 -12
  80. package/src/components/subscription/portal/actions.tsx +76 -70
  81. package/src/components/subscription/portal/cancel.tsx +10 -3
  82. package/src/components/subscription/portal/list.tsx +48 -26
  83. package/src/components/uploader.tsx +5 -13
  84. package/src/components/webhook/attempts.tsx +51 -16
  85. package/src/components/webhook/request-info.tsx +8 -6
  86. package/src/contexts/products.tsx +1 -1
  87. package/src/pages/admin/billing/invoices/detail.tsx +48 -12
  88. package/src/pages/admin/billing/subscriptions/detail.tsx +43 -11
  89. package/src/pages/admin/customers/customers/detail.tsx +53 -12
  90. package/src/pages/admin/customers/customers/index.tsx +6 -1
  91. package/src/pages/admin/developers/events/detail.tsx +36 -10
  92. package/src/pages/admin/developers/webhooks/detail.tsx +41 -11
  93. package/src/pages/admin/index.tsx +15 -2
  94. package/src/pages/admin/overview.tsx +107 -19
  95. package/src/pages/admin/payments/intents/detail.tsx +57 -13
  96. package/src/pages/admin/payments/payouts/detail.tsx +62 -14
  97. package/src/pages/admin/payments/refunds/detail.tsx +57 -13
  98. package/src/pages/admin/products/index.tsx +8 -2
  99. package/src/pages/admin/products/links/create.tsx +22 -4
  100. package/src/pages/admin/products/links/detail.tsx +42 -13
  101. package/src/pages/admin/products/passports/index.tsx +23 -4
  102. package/src/pages/admin/products/prices/actions.tsx +1 -6
  103. package/src/pages/admin/products/prices/detail.tsx +43 -11
  104. package/src/pages/admin/products/prices/list.tsx +7 -2
  105. package/src/pages/admin/products/pricing-tables/create.tsx +45 -12
  106. package/src/pages/admin/products/pricing-tables/detail.tsx +44 -13
  107. package/src/pages/admin/products/products/create.tsx +4 -1
  108. package/src/pages/admin/products/products/detail.tsx +72 -17
  109. package/src/pages/admin/settings/index.tsx +8 -1
  110. package/src/pages/admin/settings/payment-methods/index.tsx +84 -19
  111. package/src/pages/admin/settings/vault-config/edit-form.tsx +42 -28
  112. package/src/pages/admin/settings/vault-config/index.tsx +57 -10
  113. package/src/pages/customer/index.tsx +41 -15
  114. package/src/pages/customer/invoice/detail.tsx +63 -14
  115. package/src/pages/customer/invoice/past-due.tsx +11 -3
  116. package/src/pages/customer/payout/detail.tsx +56 -13
  117. package/src/pages/customer/recharge/account.tsx +80 -20
  118. package/src/pages/customer/recharge/subscription.tsx +86 -25
  119. package/src/pages/customer/refund/list.tsx +60 -24
  120. package/src/pages/customer/subscription/change-payment.tsx +13 -4
  121. package/src/pages/customer/subscription/change-plan.tsx +34 -7
  122. package/src/pages/customer/subscription/detail.tsx +86 -20
  123. package/src/pages/customer/subscription/embed.tsx +24 -4
  124. package/src/pages/home.tsx +26 -4
  125. package/src/pages/integrations/donations/edit-form.tsx +25 -9
  126. package/src/pages/integrations/donations/index.tsx +26 -9
  127. package/src/pages/integrations/donations/preview.tsx +59 -15
  128. package/src/pages/integrations/index.tsx +10 -1
  129. package/src/pages/integrations/overview.tsx +78 -17
  130. package/vite.config.ts +60 -30
@@ -18,11 +18,7 @@ type Props = {
18
18
  variant?: LiteralUnion<'compact' | 'normal', string>;
19
19
  };
20
20
 
21
- PaymentLinkActions.defaultProps = {
22
- variant: 'compact',
23
- };
24
-
25
- export default function PaymentLinkActions({ data, variant, onChange }: Props) {
21
+ export default function PaymentLinkActions({ data, variant = 'compact', onChange }: Props) {
26
22
  const { t } = useLocaleContext();
27
23
  const [state, setState] = useSetState({
28
24
  action: '',
@@ -54,8 +54,10 @@ export default function AfterPay() {
54
54
  error={!!get(errors, field.name)}
55
55
  fullWidth
56
56
  size="small"
57
- inputProps={{
58
- maxLength: 200,
57
+ slotProps={{
58
+ htmlInput: {
59
+ maxLength: 200,
60
+ },
59
61
  }}
60
62
  />
61
63
  )}
@@ -16,7 +16,7 @@ import ProductSelect from './product-select';
16
16
  export default function BeforePay({
17
17
  triggerError = () => {},
18
18
  }: {
19
- triggerError: (keys: { [key: string]: boolean }) => void;
19
+ triggerError?: (keys: { [key: string]: boolean }) => void;
20
20
  }) {
21
21
  const { t } = useLocaleContext();
22
22
  const [params, setParams] = useSearchParams();
@@ -123,12 +123,20 @@ export default function BeforePay({
123
123
  );
124
124
  })}
125
125
  {items.fields.some((_, index) => !isPriceAligned(items.fields as any[], products, index).recurring) && (
126
- <Typography color="error" fontSize="small">
126
+ <Typography
127
+ color="error"
128
+ sx={{
129
+ fontSize: 'small',
130
+ }}>
127
131
  {t('admin.paymentLink.recurringNotAligned')}
128
132
  </Typography>
129
133
  )}
130
134
  {items.fields.some((_, index) => !isPriceAligned(items.fields as any[], products, index).currency) && (
131
- <Typography color="error" fontSize="small">
135
+ <Typography
136
+ color="error"
137
+ sx={{
138
+ fontSize: 'small',
139
+ }}>
132
140
  {t('admin.paymentLink.currencyNotAligned')}
133
141
  </Typography>
134
142
  )}
@@ -248,9 +256,11 @@ export default function BeforePay({
248
256
  <TextField
249
257
  {...field}
250
258
  size="small"
251
- InputProps={{ endAdornment: t('common.days') }}
252
259
  helperText={get(errors, 'subscription_data.trial_period_days')?.message as string}
253
260
  error={!!get(errors, 'subscription_data.trial_period_days')}
261
+ slotProps={{
262
+ input: { endAdornment: t('common.days') },
263
+ }}
254
264
  />
255
265
  )}
256
266
  />
@@ -75,7 +75,11 @@ export default function LineItem({ prefix, product, valid, onUpdate, onRemove }:
75
75
  ]}
76
76
  />
77
77
  </ClickBoundary>
78
- <Stack direction="column" alignItems="flex-start">
78
+ <Stack
79
+ direction="column"
80
+ sx={{
81
+ alignItems: 'flex-start',
82
+ }}>
79
83
  <InfoCard
80
84
  logo={product.images[0]}
81
85
  name={product.name}
@@ -85,10 +89,14 @@ export default function LineItem({ prefix, product, valid, onUpdate, onRemove }:
85
89
  name={getFieldName('quantity')}
86
90
  control={control}
87
91
  render={({ field }) => (
88
- <Stack direction="row" alignItems="center" mt={1}>
92
+ <Stack
93
+ direction="row"
94
+ sx={{
95
+ alignItems: 'center',
96
+ mt: 1,
97
+ }}>
89
98
  <TextField
90
99
  sx={{ width: 80, mr: 1 }}
91
- inputProps={{ style: { padding: '4px 8px' } }}
92
100
  size="small"
93
101
  type="number"
94
102
  {...field}
@@ -98,6 +106,9 @@ export default function LineItem({ prefix, product, valid, onUpdate, onRemove }:
98
106
  field.onChange(intValue);
99
107
  }
100
108
  }}
109
+ slotProps={{
110
+ htmlInput: { style: { padding: '4px 8px' } },
111
+ }}
101
112
  />
102
113
  <FormLabel style={{ marginBottom: 0 }}>{t('common.quantity')}</FormLabel>
103
114
  </Stack>
@@ -118,7 +129,13 @@ export default function LineItem({ prefix, product, valid, onUpdate, onRemove }:
118
129
  />
119
130
  {adjustable && (
120
131
  <>
121
- <Stack direction="row" alignItems="center" mt={1} ml={6}>
132
+ <Stack
133
+ direction="row"
134
+ sx={{
135
+ alignItems: 'center',
136
+ mt: 1,
137
+ ml: 6,
138
+ }}>
122
139
  <Typography sx={{ mr: 0.5 }}>Between</Typography>
123
140
  <Controller
124
141
  name={getFieldName('adjustable_quantity.minimum')}
@@ -131,10 +148,12 @@ export default function LineItem({ prefix, product, valid, onUpdate, onRemove }:
131
148
  render={({ field }) => (
132
149
  <TextField
133
150
  sx={{ width: 40 }}
134
- inputProps={{ style: { padding: '4px 8px' } }}
135
151
  size="small"
136
152
  error={!!adjustableError}
137
153
  {...field}
154
+ slotProps={{
155
+ htmlInput: { style: { padding: '4px 8px' } },
156
+ }}
138
157
  />
139
158
  )}
140
159
  />
@@ -152,10 +171,12 @@ export default function LineItem({ prefix, product, valid, onUpdate, onRemove }:
152
171
  render={({ field }) => (
153
172
  <TextField
154
173
  sx={{ width: 40 }}
155
- inputProps={{ style: { padding: '4px 8px' } }}
156
174
  size="small"
157
175
  error={!!adjustableError}
158
176
  {...field}
177
+ slotProps={{
178
+ htmlInput: { style: { padding: '4px 8px' } },
179
+ }}
159
180
  />
160
181
  )}
161
182
  />
@@ -1,10 +1,16 @@
1
- import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
1
+ import { useEffect, useImperativeHandle, useRef, useState } from 'react';
2
2
  import { useFullscreen, useSize } from 'ahooks';
3
3
  import IframeResizer from 'iframe-resizer-react';
4
4
  import { useTheme } from '@mui/material';
5
5
  import Chrome from './chrome';
6
6
 
7
- const PaymentLinkPreview = forwardRef(({ id, version = 1 }: { id: string; version?: number }, ref) => {
7
+ export default function PaymentLinkPreview({
8
+ ref = undefined,
9
+ id,
10
+ version = 1,
11
+ }: { id: string; version?: number } & {
12
+ ref?: React.RefObject<unknown>;
13
+ }) {
8
14
  const theme = useTheme();
9
15
  const innerRef = useRef(null);
10
16
  const size = useSize(innerRef);
@@ -50,10 +56,4 @@ const PaymentLinkPreview = forwardRef(({ id, version = 1 }: { id: string; versio
50
56
  )}
51
57
  </div>
52
58
  );
53
- });
54
-
55
- PaymentLinkPreview.defaultProps = {
56
- version: 1,
57
- };
58
-
59
- export default PaymentLinkPreview;
59
+ }
@@ -40,7 +40,12 @@ export default function ProductSelect({ mode: initialMode, hasSelected, onSelect
40
40
  const items = (callback?: any) =>
41
41
  filterProducts(products, hasSelected).map((product) => [
42
42
  <ListSubheader key={product.id} sx={{ fontSize: '0.875rem', color: 'text.secondary', lineHeight: '2.1875rem' }}>
43
- <Stack direction="row" alignItems="center" spacing={0.5}>
43
+ <Stack
44
+ direction="row"
45
+ spacing={0.5}
46
+ sx={{
47
+ alignItems: 'center',
48
+ }}>
44
49
  {product.images[0] ? (
45
50
  <Avatar src={product.images[0]} alt={product.name} variant="square" sx={size} />
46
51
  ) : (
@@ -65,8 +70,17 @@ export default function ProductSelect({ mode: initialMode, hasSelected, onSelect
65
70
  callback(price);
66
71
  }
67
72
  }}>
68
- <Typography color="text.primary">{formatPrice(price, currency!)}</Typography>
69
- <Typography color="text.secondary" sx={{ ml: 2 }}>
73
+ <Typography
74
+ sx={{
75
+ color: 'text.primary',
76
+ }}>
77
+ {formatPrice(price, currency!)}
78
+ </Typography>
79
+ <Typography
80
+ sx={{
81
+ color: 'text.secondary',
82
+ ml: 2,
83
+ }}>
70
84
  {getPriceCurrencyOptions(price).length > 1
71
85
  ? ` +${getPriceCurrencyOptions(price).length - 1} more currencies`
72
86
  : ''}
@@ -68,7 +68,12 @@ export default function ArcBlockMethodForm({ checkDisabled }: { checkDisabled: (
68
68
  disabled={checkDisabled('settings.arcblock.explorer_host')}
69
69
  />
70
70
  <Stack direction="column">
71
- <Typography mb={1}>{t('admin.paymentCurrency.logo.label')}</Typography>
71
+ <Typography
72
+ sx={{
73
+ mb: 1,
74
+ }}>
75
+ {t('admin.paymentCurrency.logo.label')}
76
+ </Typography>
72
77
  <Uploader onUploaded={onUploaded} preview={logo} disabled={checkDisabled('logo')} />
73
78
  </Stack>
74
79
  </>
@@ -75,7 +75,12 @@ export default function BaseMethodForm({ checkDisabled }: { checkDisabled: (key:
75
75
  disabled={checkDisabled('settings.base.confirmation')}
76
76
  />
77
77
  <Stack direction="column">
78
- <Typography mb={1}>{t('admin.paymentCurrency.logo.label')}</Typography>
78
+ <Typography
79
+ sx={{
80
+ mb: 1,
81
+ }}>
82
+ {t('admin.paymentCurrency.logo.label')}
83
+ </Typography>
79
84
  <Uploader onUploaded={onUploaded} preview={logo} disabled={checkDisabled('logo')} />
80
85
  </Stack>
81
86
  </>
@@ -68,7 +68,12 @@ export default function BitcoinMethodForm({ checkDisabled }: { checkDisabled: (k
68
68
  disabled={checkDisabled('settings.bitcoin.explorer_host')}
69
69
  />
70
70
  <Stack direction="column">
71
- <Typography mb={1}>{t('admin.paymentCurrency.logo.label')}</Typography>
71
+ <Typography
72
+ sx={{
73
+ mb: 1,
74
+ }}>
75
+ {t('admin.paymentCurrency.logo.label')}
76
+ </Typography>
72
77
  <Uploader onUploaded={onUploaded} preview={logo} disabled={checkDisabled('logo')} />
73
78
  </Stack>
74
79
  </>
@@ -75,7 +75,12 @@ export default function EthereumMethodForm({ checkDisabled }: { checkDisabled: (
75
75
  disabled={checkDisabled('settings.ethereum.confirmation')}
76
76
  />
77
77
  <Stack direction="column">
78
- <Typography mb={1}>{t('admin.paymentCurrency.logo.label')}</Typography>
78
+ <Typography
79
+ sx={{
80
+ mb: 1,
81
+ }}>
82
+ {t('admin.paymentCurrency.logo.label')}
83
+ </Typography>
79
84
  <Uploader onUploaded={onUploaded} preview={logo} disabled={checkDisabled('logo')} />
80
85
  </Stack>
81
86
  </>
@@ -13,11 +13,7 @@ interface Props {
13
13
  disabled?: boolean;
14
14
  }
15
15
 
16
- EvmRpcInput.defaultProps = {
17
- disabled: false,
18
- };
19
-
20
- export default function EvmRpcInput({ name, label, placeholder, disabled }: Props) {
16
+ export default function EvmRpcInput({ name, label, placeholder, disabled = false }: Props) {
21
17
  const { t } = useLocaleContext();
22
18
  const { control } = useFormContext();
23
19
  const apiHost = useWatch({
@@ -42,14 +38,22 @@ export default function EvmRpcInput({ name, label, placeholder, disabled }: Prop
42
38
  {status.loading ? (
43
39
  <>
44
40
  <CircularProgress size={14} />
45
- <Typography variant="caption" color="text.secondary">
41
+ <Typography
42
+ variant="caption"
43
+ sx={{
44
+ color: 'text.secondary',
45
+ }}>
46
46
  {t('admin.paymentMethod.evm.checking')}
47
47
  </Typography>
48
48
  </>
49
49
  ) : status.connected ? (
50
50
  <>
51
51
  <CheckCircleOutline sx={{ fontSize: 14 }} color="success" />
52
- <Typography variant="caption" color="text.secondary">
52
+ <Typography
53
+ variant="caption"
54
+ sx={{
55
+ color: 'text.secondary',
56
+ }}>
53
57
  {t('admin.paymentMethod.evm.connected')} | {t('admin.paymentMethod.evm.blockHeight')}:{' '}
54
58
  {status.blockNumber?.toLocaleString()}
55
59
  </Typography>
@@ -9,14 +9,9 @@ import EthereumMethodForm from './ethereum';
9
9
  import StripeMethodForm from './stripe';
10
10
  import BaseMethodForm from './base';
11
11
 
12
- PaymentMethodForm.defaultProps = {
13
- action: 'create',
14
- editableKeys: [],
15
- };
16
-
17
12
  export default function PaymentMethodForm({
18
- action,
19
- editableKeys,
13
+ action = 'create',
14
+ editableKeys = [],
20
15
  }: {
21
16
  action?: 'create' | 'edit';
22
17
  editableKeys?: string[];
@@ -11,11 +11,7 @@ type Props = {
11
11
  variant?: LiteralUnion<'compact' | 'normal', string>;
12
12
  };
13
13
 
14
- PayoutActions.defaultProps = {
15
- variant: 'compact',
16
- };
17
-
18
- export default function PayoutActions({ data, variant }: Props) {
14
+ export default function PayoutActions({ data, variant = 'compact' }: Props) {
19
15
  const { t } = useLocaleContext();
20
16
  const navigate = useNavigate();
21
17
  const actions = [
@@ -70,17 +70,15 @@ const getListKey = (props: ListProps) => {
70
70
  return 'payouts';
71
71
  };
72
72
 
73
- PayoutList.defaultProps = {
74
- features: {
73
+ export default function PayoutList({
74
+ customer_id = '',
75
+ payment_intent_id = '',
76
+ status = '',
77
+ features = {
75
78
  customer: true,
76
79
  filter: true,
77
80
  },
78
- status: '',
79
- customer_id: '',
80
- payment_intent_id: '',
81
- };
82
-
83
- export default function PayoutList({ customer_id, payment_intent_id, status, features }: ListProps) {
81
+ }: ListProps) {
84
82
  const { t } = useLocaleContext();
85
83
 
86
84
  const listKey = getListKey({ customer_id, payment_intent_id });
@@ -120,7 +118,11 @@ export default function PayoutList({ customer_id, payment_intent_id, status, fea
120
118
  const item = data.list[index] as TPayoutExpanded;
121
119
  return (
122
120
  <Link to={`/admin/payments/${item.id}`}>
123
- <Typography component="strong" fontWeight={600}>
121
+ <Typography
122
+ component="strong"
123
+ sx={{
124
+ fontWeight: 600,
125
+ }}>
124
126
  {formatBNStr(item.amount, item?.paymentCurrency.decimal)}
125
127
  &nbsp;
126
128
  {item?.paymentCurrency.symbol}
@@ -57,14 +57,12 @@ const getListKey = (props: ListProps) => {
57
57
  return 'payouts-mine';
58
58
  };
59
59
 
60
- CustomerRevenueList.defaultProps = {
61
- status: '',
62
- currency_id: '',
63
- customer_id: '',
64
- setHasRevenues: () => {},
65
- };
66
-
67
- export default function CustomerRevenueList({ currency_id, status, customer_id, setHasRevenues }: ListProps) {
60
+ export default function CustomerRevenueList({
61
+ currency_id = '',
62
+ status = '',
63
+ customer_id = '',
64
+ setHasRevenues = () => {},
65
+ }: ListProps) {
68
66
  const { t } = useLocaleContext();
69
67
  const { isMobile } = useMobile('sm');
70
68
 
@@ -107,7 +105,11 @@ export default function CustomerRevenueList({ currency_id, status, customer_id,
107
105
  const item = data.list[index] as TPayoutExpanded;
108
106
  return (
109
107
  <Link to={`/customer/payout/${item.id}`}>
110
- <Typography component="strong" fontWeight={600}>
108
+ <Typography
109
+ component="strong"
110
+ sx={{
111
+ fontWeight: 600,
112
+ }}>
111
113
  {formatBNStr(item.amount, item?.paymentCurrency.decimal)}
112
114
  &nbsp;
113
115
  {item?.paymentCurrency.symbol}
@@ -19,20 +19,14 @@ type Props = {
19
19
  selectSX?: SxProps;
20
20
  };
21
21
 
22
- CurrencySelect.defaultProps = {
23
- width: '100%',
24
- disabled: false,
25
- selectSX: {},
26
- };
27
-
28
22
  export default function CurrencySelect({
29
23
  mode: initialMode,
30
24
  hasSelected,
31
25
  onSelect,
32
26
  value,
33
- width,
34
- disabled,
35
- selectSX,
27
+ width = '100%',
28
+ disabled = false,
29
+ selectSX = {},
36
30
  }: Props) {
37
31
  const { t } = useLocaleContext();
38
32
  const { settings } = usePaymentContext();
@@ -59,14 +53,17 @@ export default function CurrencySelect({
59
53
  if (mode === 'selected') {
60
54
  return (
61
55
  <Typography
62
- fontSize="12px"
63
56
  onClick={() => {
64
57
  if (canSelect) {
65
58
  setMode('selecting');
66
59
  }
67
60
  }}
68
- sx={{ cursor: canSelect ? 'pointer' : 'default', display: 'inline-flex' }}>
69
- {selectedCurrency?.symbol} ({selectedPaymentMethod?.name})
61
+ sx={{
62
+ fontSize: '12px',
63
+ cursor: canSelect ? 'pointer' : 'default',
64
+ display: 'inline-flex',
65
+ }}>
66
+ {selectedCurrency?.symbol}({selectedPaymentMethod?.name})
70
67
  {canSelect && <ArrowDropDown sx={{ color: 'text.secondary', fontSize: 21 }} />}
71
68
  </Typography>
72
69
  );
@@ -99,9 +96,20 @@ export default function CurrencySelect({
99
96
  </ListSubheader>,
100
97
  ...method.payment_currencies.map((currency) => (
101
98
  <MenuItem key={currency.id} sx={{ pl: 3 }} value={currency.id}>
102
- <Stack direction="row" justifyContent="space-between" sx={{ width: '100%' }} gap={2}>
99
+ <Stack
100
+ direction="row"
101
+ sx={{
102
+ justifyContent: 'space-between',
103
+ gap: 2,
104
+ width: '100%',
105
+ }}>
103
106
  <Currency logo={currency.logo} name={currency.name} />
104
- <Typography fontWeight="bold">{currency.symbol}</Typography>
107
+ <Typography
108
+ sx={{
109
+ fontWeight: 'bold',
110
+ }}>
111
+ {currency.symbol}
112
+ </Typography>
105
113
  </Stack>
106
114
  </MenuItem>
107
115
  )),
@@ -113,10 +121,13 @@ export default function CurrencySelect({
113
121
  return (
114
122
  <span>
115
123
  <Stack
116
- sx={{ cursor: 'pointer', display: 'inline-flex' }}
117
124
  direction="row"
118
- alignItems="center"
119
- onClick={() => setMode('selecting')}>
125
+ onClick={() => setMode('selecting')}
126
+ sx={{
127
+ alignItems: 'center',
128
+ cursor: 'pointer',
129
+ display: 'inline-flex',
130
+ }}>
120
131
  <AddOutlined color="primary" />
121
132
  <Typography color="primary">{t('admin.price.currency.add')}</Typography>
122
133
  </Stack>