@blocklet/payment-react 1.13.183 → 1.13.185
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/components/pricing-table.js +2 -1
- package/es/locales/en.js +1 -0
- package/es/locales/zh.js +1 -0
- package/es/util.js +2 -1
- package/lib/components/pricing-table.js +2 -0
- package/lib/locales/en.js +1 -0
- package/lib/locales/zh.js +1 -0
- package/lib/util.js +2 -1
- package/package.json +3 -3
- package/src/components/pricing-table.tsx +2 -1
- package/src/locales/en.tsx +1 -0
- package/src/locales/zh.tsx +1 -0
- package/src/util.ts +3 -1
|
@@ -100,6 +100,7 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
|
|
|
100
100
|
ToggleButtonGroup,
|
|
101
101
|
{
|
|
102
102
|
color: "primary",
|
|
103
|
+
size: "small",
|
|
103
104
|
value: state.interval,
|
|
104
105
|
onChange: (_, value) => {
|
|
105
106
|
if (value !== null) {
|
|
@@ -107,7 +108,7 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
|
|
|
107
108
|
}
|
|
108
109
|
},
|
|
109
110
|
exclusive: true,
|
|
110
|
-
children: Object.keys(recurring).map((x) => /* @__PURE__ */ jsx(ToggleButton, { value: x, sx: { textTransform: "capitalize" }, children: formatRecurring(recurring[x], true, "", locale) }, x))
|
|
111
|
+
children: Object.keys(recurring).map((x) => /* @__PURE__ */ jsx(ToggleButton, { size: "small", value: x, sx: { textTransform: "capitalize" }, children: formatRecurring(recurring[x], true, "", locale) }, x))
|
|
111
112
|
}
|
|
112
113
|
),
|
|
113
114
|
/* @__PURE__ */ jsx(
|
package/es/locales/en.js
CHANGED
|
@@ -162,6 +162,7 @@ export default flat({
|
|
|
162
162
|
cancel: {
|
|
163
163
|
button: "Cancel",
|
|
164
164
|
title: "Cancel your subscription",
|
|
165
|
+
comment: "Any additional feedback?",
|
|
165
166
|
description: "Your subscription will be canceled, but it is still available until the end of your current billing period on {date}",
|
|
166
167
|
feedback: {
|
|
167
168
|
tip: "We would love your feedback, it will help us improve our service",
|
package/es/locales/zh.js
CHANGED
|
@@ -162,6 +162,7 @@ export default flat({
|
|
|
162
162
|
cancel: {
|
|
163
163
|
button: "\u53D6\u6D88",
|
|
164
164
|
title: "\u53D6\u6D88\u60A8\u7684\u8BA2\u9605",
|
|
165
|
+
comment: "\u4F60\u8FD8\u6709\u5176\u4ED6\u53CD\u9988\u4E48\uFF1F",
|
|
165
166
|
description: "\u60A8\u7684\u8BA2\u9605\u5C06\u88AB\u53D6\u6D88\uFF0C\u4F46\u4ECD\u7136\u53EF\u7528\u76F4\u5230\u60A8\u5F53\u524D\u8BA1\u8D39\u5468\u671F\u7ED3\u675F\u4E8E{date}",
|
|
166
167
|
feedback: {
|
|
167
168
|
tip: "\u6211\u4EEC\u5E0C\u671B\u542C\u5230\u60A8\u7684\u53CD\u9988\uFF0C\u8FD9\u5C06\u5E2E\u52A9\u6211\u4EEC\u6539\u8FDB\u6211\u4EEC\u7684\u670D\u52A1",
|
package/es/util.js
CHANGED
|
@@ -139,7 +139,8 @@ export function getPriceUintAmountByCurrency(price, currency) {
|
|
|
139
139
|
if (price.currency_id === currency.id) {
|
|
140
140
|
return price.unit_amount;
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
console.warn(`Currency ${currency.id} not configured for price`, price);
|
|
143
|
+
return "0";
|
|
143
144
|
}
|
|
144
145
|
export function getPriceCurrencyOptions(price) {
|
|
145
146
|
if (Array.isArray(price.currency_options)) {
|
|
@@ -115,6 +115,7 @@ function PricingTable({
|
|
|
115
115
|
},
|
|
116
116
|
children: [Object.keys(recurring).length > 1 && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.ToggleButtonGroup, {
|
|
117
117
|
color: "primary",
|
|
118
|
+
size: "small",
|
|
118
119
|
value: state.interval,
|
|
119
120
|
onChange: (_, value) => {
|
|
120
121
|
if (value !== null) {
|
|
@@ -125,6 +126,7 @@ function PricingTable({
|
|
|
125
126
|
},
|
|
126
127
|
exclusive: true,
|
|
127
128
|
children: Object.keys(recurring).map(x => /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.ToggleButton, {
|
|
129
|
+
size: "small",
|
|
128
130
|
value: x,
|
|
129
131
|
sx: {
|
|
130
132
|
textTransform: "capitalize"
|
package/lib/locales/en.js
CHANGED
|
@@ -169,6 +169,7 @@ module.exports = (0, _flat.default)({
|
|
|
169
169
|
cancel: {
|
|
170
170
|
button: "Cancel",
|
|
171
171
|
title: "Cancel your subscription",
|
|
172
|
+
comment: "Any additional feedback?",
|
|
172
173
|
description: "Your subscription will be canceled, but it is still available until the end of your current billing period on {date}",
|
|
173
174
|
feedback: {
|
|
174
175
|
tip: "We would love your feedback, it will help us improve our service",
|
package/lib/locales/zh.js
CHANGED
|
@@ -169,6 +169,7 @@ module.exports = (0, _flat.default)({
|
|
|
169
169
|
cancel: {
|
|
170
170
|
button: "\u53D6\u6D88",
|
|
171
171
|
title: "\u53D6\u6D88\u60A8\u7684\u8BA2\u9605",
|
|
172
|
+
comment: "\u4F60\u8FD8\u6709\u5176\u4ED6\u53CD\u9988\u4E48\uFF1F",
|
|
172
173
|
description: "\u60A8\u7684\u8BA2\u9605\u5C06\u88AB\u53D6\u6D88\uFF0C\u4F46\u4ECD\u7136\u53EF\u7528\u76F4\u5230\u60A8\u5F53\u524D\u8BA1\u8D39\u5468\u671F\u7ED3\u675F\u4E8E{date}",
|
|
173
174
|
feedback: {
|
|
174
175
|
tip: "\u6211\u4EEC\u5E0C\u671B\u542C\u5230\u60A8\u7684\u53CD\u9988\uFF0C\u8FD9\u5C06\u5E2E\u52A9\u6211\u4EEC\u6539\u8FDB\u6211\u4EEC\u7684\u670D\u52A1",
|
package/lib/util.js
CHANGED
|
@@ -194,7 +194,8 @@ function getPriceUintAmountByCurrency(price, currency) {
|
|
|
194
194
|
if (price.currency_id === currency.id) {
|
|
195
195
|
return price.unit_amount;
|
|
196
196
|
}
|
|
197
|
-
|
|
197
|
+
console.warn(`Currency ${currency.id} not configured for price`, price);
|
|
198
|
+
return "0";
|
|
198
199
|
}
|
|
199
200
|
function getPriceCurrencyOptions(price) {
|
|
200
201
|
if (Array.isArray(price.currency_options)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/payment-react",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.185",
|
|
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.
|
|
93
|
+
"@blocklet/payment-types": "1.13.185",
|
|
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": "
|
|
122
|
+
"gitHead": "4780ee769cd4f0a7e4c415fd2209dea6711a6b74"
|
|
123
123
|
}
|
|
@@ -119,6 +119,7 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
|
|
|
119
119
|
{Object.keys(recurring).length > 1 && (
|
|
120
120
|
<ToggleButtonGroup
|
|
121
121
|
color="primary"
|
|
122
|
+
size="small"
|
|
122
123
|
value={state.interval}
|
|
123
124
|
onChange={(_, value) => {
|
|
124
125
|
if (value !== null) {
|
|
@@ -127,7 +128,7 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
|
|
|
127
128
|
}}
|
|
128
129
|
exclusive>
|
|
129
130
|
{Object.keys(recurring).map((x) => (
|
|
130
|
-
<ToggleButton key={x} value={x} sx={{ textTransform: 'capitalize' }}>
|
|
131
|
+
<ToggleButton size="small" key={x} value={x} sx={{ textTransform: 'capitalize' }}>
|
|
131
132
|
{formatRecurring(recurring[x] as PriceRecurring, true, '', locale)}
|
|
132
133
|
</ToggleButton>
|
|
133
134
|
))}
|
package/src/locales/en.tsx
CHANGED
|
@@ -166,6 +166,7 @@ export default flat({
|
|
|
166
166
|
cancel: {
|
|
167
167
|
button: 'Cancel',
|
|
168
168
|
title: 'Cancel your subscription',
|
|
169
|
+
comment: 'Any additional feedback?',
|
|
169
170
|
description:
|
|
170
171
|
'Your subscription will be canceled, but it is still available until the end of your current billing period on {date}',
|
|
171
172
|
feedback: {
|
package/src/locales/zh.tsx
CHANGED
package/src/util.ts
CHANGED
|
@@ -213,7 +213,9 @@ export function getPriceUintAmountByCurrency(price: TPrice, currency: TPaymentCu
|
|
|
213
213
|
if (price.currency_id === currency.id) {
|
|
214
214
|
return price.unit_amount;
|
|
215
215
|
}
|
|
216
|
-
|
|
216
|
+
|
|
217
|
+
console.warn(`Currency ${currency.id} not configured for price`, price);
|
|
218
|
+
return '0';
|
|
217
219
|
}
|
|
218
220
|
|
|
219
221
|
export function getPriceCurrencyOptions(price: TPrice): PriceCurrency[] {
|