@blocklet/payment-react 1.13.185 → 1.13.187

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.
@@ -40,7 +40,7 @@ export default function CustomerInvoiceList({
40
40
  const { data, loadMore, loadingMore, loading } = useInfiniteScroll(
41
41
  (d) => {
42
42
  const page = d ? Math.ceil(d.list.length / size) + 1 : 1;
43
- return fetchData({ page, pageSize: size, status, customer_id, currency_id, subscription_id });
43
+ return fetchData({ page, pageSize: size, status, customer_id, currency_id, subscription_id, ignoreZero: true });
44
44
  },
45
45
  {
46
46
  reloadDeps: [customer_id]
@@ -135,7 +135,7 @@ export default function MiniInvoiceList() {
135
135
  variant: "contained",
136
136
  sx: { color: "#fff!important", width: subscription.service_actions?.length ? "auto" : "100%" },
137
137
  href: joinURL(window.location.origin, getPrefix(), `/customer/subscription/${subscription.id}`),
138
- children: t("payment.customer.subscriptions.title")
138
+ children: t("payment.customer.subscriptions.view")
139
139
  }
140
140
  )
141
141
  ] })
package/es/locales/en.js CHANGED
@@ -242,6 +242,7 @@ export default flat({
242
242
  plan: "Plan",
243
243
  nextInvoice: "Next Invoice",
244
244
  title: "Manage subscriptions",
245
+ view: "View Subscription",
245
246
  current: "Current subscription",
246
247
  empty: "There are no subscriptions here",
247
248
  changePayment: "Change payment method"
package/es/locales/zh.js CHANGED
@@ -63,13 +63,13 @@ export default flat({
63
63
  week: "\u5468",
64
64
  month: "\u6708",
65
65
  year: "\u5E74",
66
- hourly: "\u6309\u5C0F\u65F6",
67
- daily: "\u6309\u5929",
68
- weekly: "\u6309\u5468",
69
- monthly: "\u6309\u6708",
70
- yearly: "\u6309\u5E74",
71
- month3: "\u6309\u5B63\u5EA6",
72
- month6: "\u6309\u534A\u5E74",
66
+ hourly: "\u6BCF\u5C0F\u65F6",
67
+ daily: "\u6BCF\u5929",
68
+ weekly: "\u6BCF\u5468",
69
+ monthly: "\u6BCF\u6708",
70
+ yearly: "\u6BCF\u5E74",
71
+ month3: "\u6BCF\u5B63\u5EA6",
72
+ month6: "\u6BCF\u534A\u5E74",
73
73
  recurring: "\u6BCF{count}{interval}",
74
74
  hours: "\u5C0F\u65F6",
75
75
  days: "\u5929",
@@ -242,6 +242,7 @@ export default flat({
242
242
  plan: "\u8BA2\u9605",
243
243
  nextInvoice: "\u4E0B\u4E00\u5F20\u8D26\u5355",
244
244
  title: "\u8BA2\u9605\u7BA1\u7406",
245
+ view: "\u7BA1\u7406\u8BA2\u9605",
245
246
  current: "\u5F53\u524D\u8BA2\u9605",
246
247
  empty: "\u6CA1\u6709\u4EFB\u4F55\u8BA2\u9605",
247
248
  changePayment: "\u5207\u6362\u652F\u4ED8\u65B9\u5F0F"
package/es/util.js CHANGED
@@ -125,6 +125,14 @@ export function formatRecurring(recurring, translate = true, separator = "per",
125
125
  const interval = t(`common.${recurring.interval}`, locale);
126
126
  return translate ? t(`common.${intervals[recurring.interval]}`, locale) : separator ? t(`common.${separator}`, locale, { interval }) : interval;
127
127
  }
128
+ if (recurring.interval === "month") {
129
+ if (recurring.interval_count === 3) {
130
+ return t("common.month3", locale);
131
+ }
132
+ if (recurring.interval_count === 6) {
133
+ return t("common.month6", locale);
134
+ }
135
+ }
128
136
  return t("common.recurring", locale, {
129
137
  count: recurring.interval_count,
130
138
  interval: t(`common.${recurring.interval}s`, locale)
@@ -59,7 +59,8 @@ function CustomerInvoiceList({
59
59
  status,
60
60
  customer_id,
61
61
  currency_id,
62
- subscription_id
62
+ subscription_id,
63
+ ignoreZero: true
63
64
  });
64
65
  }, {
65
66
  reloadDeps: [customer_id]
@@ -212,7 +212,7 @@ function MiniInvoiceList() {
212
212
  width: subscription.service_actions?.length ? "auto" : "100%"
213
213
  },
214
214
  href: (0, _ufo.joinURL)(window.location.origin, (0, _util.getPrefix)(), `/customer/subscription/${subscription.id}`),
215
- children: t("payment.customer.subscriptions.title")
215
+ children: t("payment.customer.subscriptions.view")
216
216
  })]
217
217
  })]
218
218
  })]
package/lib/locales/en.js CHANGED
@@ -249,6 +249,7 @@ module.exports = (0, _flat.default)({
249
249
  plan: "Plan",
250
250
  nextInvoice: "Next Invoice",
251
251
  title: "Manage subscriptions",
252
+ view: "View Subscription",
252
253
  current: "Current subscription",
253
254
  empty: "There are no subscriptions here",
254
255
  changePayment: "Change payment method"
package/lib/locales/zh.js CHANGED
@@ -70,13 +70,13 @@ module.exports = (0, _flat.default)({
70
70
  week: "\u5468",
71
71
  month: "\u6708",
72
72
  year: "\u5E74",
73
- hourly: "\u6309\u5C0F\u65F6",
74
- daily: "\u6309\u5929",
75
- weekly: "\u6309\u5468",
76
- monthly: "\u6309\u6708",
77
- yearly: "\u6309\u5E74",
78
- month3: "\u6309\u5B63\u5EA6",
79
- month6: "\u6309\u534A\u5E74",
73
+ hourly: "\u6BCF\u5C0F\u65F6",
74
+ daily: "\u6BCF\u5929",
75
+ weekly: "\u6BCF\u5468",
76
+ monthly: "\u6BCF\u6708",
77
+ yearly: "\u6BCF\u5E74",
78
+ month3: "\u6BCF\u5B63\u5EA6",
79
+ month6: "\u6BCF\u534A\u5E74",
80
80
  recurring: "\u6BCF{count}{interval}",
81
81
  hours: "\u5C0F\u65F6",
82
82
  days: "\u5929",
@@ -249,6 +249,7 @@ module.exports = (0, _flat.default)({
249
249
  plan: "\u8BA2\u9605",
250
250
  nextInvoice: "\u4E0B\u4E00\u5F20\u8D26\u5355",
251
251
  title: "\u8BA2\u9605\u7BA1\u7406",
252
+ view: "\u7BA1\u7406\u8BA2\u9605",
252
253
  current: "\u5F53\u524D\u8BA2\u9605",
253
254
  empty: "\u6CA1\u6709\u4EFB\u4F55\u8BA2\u9605",
254
255
  changePayment: "\u5207\u6362\u652F\u4ED8\u65B9\u5F0F"
package/lib/util.js CHANGED
@@ -180,6 +180,14 @@ function formatRecurring(recurring, translate = true, separator = "per", locale
180
180
  interval
181
181
  }) : interval;
182
182
  }
183
+ if (recurring.interval === "month") {
184
+ if (recurring.interval_count === 3) {
185
+ return (0, _locales.t)("common.month3", locale);
186
+ }
187
+ if (recurring.interval_count === 6) {
188
+ return (0, _locales.t)("common.month6", locale);
189
+ }
190
+ }
183
191
  return (0, _locales.t)("common.recurring", locale, {
184
192
  count: recurring.interval_count,
185
193
  interval: (0, _locales.t)(`common.${recurring.interval}s`, locale)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/payment-react",
3
- "version": "1.13.185",
3
+ "version": "1.13.187",
4
4
  "description": "Reusable react components for payment kit v2",
5
5
  "keywords": [
6
6
  "react",
@@ -90,7 +90,7 @@
90
90
  "@babel/core": "^7.23.9",
91
91
  "@babel/preset-env": "^7.23.9",
92
92
  "@babel/preset-react": "^7.23.3",
93
- "@blocklet/payment-types": "1.13.185",
93
+ "@blocklet/payment-types": "1.13.187",
94
94
  "@storybook/addon-essentials": "^7.6.13",
95
95
  "@storybook/addon-interactions": "^7.6.13",
96
96
  "@storybook/addon-links": "^7.6.13",
@@ -119,5 +119,5 @@
119
119
  "vite-plugin-babel": "^1.2.0",
120
120
  "vite-plugin-node-polyfills": "^0.19.0"
121
121
  },
122
- "gitHead": "4780ee769cd4f0a7e4c415fd2209dea6711a6b74"
122
+ "gitHead": "1eba252975f6a974397c878738badaca8388bb7a"
123
123
  }
@@ -56,7 +56,7 @@ export default function CustomerInvoiceList({
56
56
  const { data, loadMore, loadingMore, loading } = useInfiniteScroll<Paginated<TInvoiceExpanded>>(
57
57
  (d) => {
58
58
  const page = d ? Math.ceil(d.list.length / size) + 1 : 1;
59
- return fetchData({ page, pageSize: size, status, customer_id, currency_id, subscription_id });
59
+ return fetchData({ page, pageSize: size, status, customer_id, currency_id, subscription_id, ignoreZero: true });
60
60
  },
61
61
  {
62
62
  reloadDeps: [customer_id],
@@ -170,7 +170,7 @@ export default function MiniInvoiceList() {
170
170
  variant="contained"
171
171
  sx={{ color: '#fff!important', width: subscription.service_actions?.length ? 'auto' : '100%' }}
172
172
  href={joinURL(window.location.origin, getPrefix(), `/customer/subscription/${subscription.id}`)}>
173
- {t('payment.customer.subscriptions.title')}
173
+ {t('payment.customer.subscriptions.view')}
174
174
  </Button>
175
175
  </Stack>
176
176
  </Box>
@@ -251,6 +251,7 @@ export default flat({
251
251
  plan: 'Plan',
252
252
  nextInvoice: 'Next Invoice',
253
253
  title: 'Manage subscriptions',
254
+ view: 'View Subscription',
254
255
  current: 'Current subscription',
255
256
  empty: 'There are no subscriptions here',
256
257
  changePayment: 'Change payment method',
@@ -64,13 +64,13 @@ export default flat({
64
64
  week: '周',
65
65
  month: '月',
66
66
  year: '年',
67
- hourly: '按小时',
68
- daily: '按天',
69
- weekly: '按周',
70
- monthly: '按月',
71
- yearly: '按年',
72
- month3: '按季度',
73
- month6: '按半年',
67
+ hourly: '每小时',
68
+ daily: '每天',
69
+ weekly: '每周',
70
+ monthly: '每月',
71
+ yearly: '每年',
72
+ month3: '每季度',
73
+ month6: '每半年',
74
74
  recurring: '每{count}{interval}',
75
75
  hours: '小时',
76
76
  days: '天',
@@ -244,6 +244,7 @@ export default flat({
244
244
  plan: '订阅',
245
245
  nextInvoice: '下一张账单',
246
246
  title: '订阅管理',
247
+ view: '管理订阅',
247
248
  current: '当前订阅',
248
249
  empty: '没有任何订阅',
249
250
  changePayment: '切换支付方式',
package/src/util.ts CHANGED
@@ -197,6 +197,15 @@ export function formatRecurring(
197
197
  return translate ? t(`common.${intervals[recurring.interval]}`, locale) : separator ? t(`common.${separator}`, locale, { interval }) : interval; // prettier-ignore
198
198
  }
199
199
 
200
+ if (recurring.interval === 'month') {
201
+ if (recurring.interval_count === 3) {
202
+ return t('common.month3', locale);
203
+ }
204
+ if (recurring.interval_count === 6) {
205
+ return t('common.month6', locale);
206
+ }
207
+ }
208
+
200
209
  return t('common.recurring', locale, {
201
210
  count: recurring.interval_count,
202
211
  interval: t(`common.${recurring.interval}s`, locale),