@blocklet/payment-react 1.13.143 → 1.13.145
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/checkout/table.js +2 -16
- package/lib/checkout/table.js +1 -18
- package/package.json +3 -3
- package/src/checkout/table.tsx +2 -13
package/es/checkout/table.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
3
3
|
import Toast from "@arcblock/ux/lib/Toast";
|
|
4
|
-
import { Alert, Stack, Typography } from "@mui/material";
|
|
4
|
+
import { Alert, CircularProgress, Stack, Typography } from "@mui/material";
|
|
5
5
|
import { Box } from "@mui/system";
|
|
6
6
|
import { useRequest } from "ahooks";
|
|
7
7
|
import { useState } from "react";
|
|
8
8
|
import api from "../api.js";
|
|
9
9
|
import Livemode from "../components/livemode.js";
|
|
10
10
|
import PricingTable from "../components/pricing-table.js";
|
|
11
|
-
import ProductSkeleton from "../payment/product-skeleton.js";
|
|
12
11
|
import { mergeExtraParams } from "../util.js";
|
|
13
12
|
import CheckoutForm from "./form.js";
|
|
14
13
|
const fetchData = async (id) => {
|
|
@@ -27,20 +26,7 @@ export default function CheckoutTable({ id, onPaid, onError, mode, extraParams,
|
|
|
27
26
|
return /* @__PURE__ */ jsx(Alert, { severity: "error", children: error.message });
|
|
28
27
|
}
|
|
29
28
|
if (loading || !data) {
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
Stack,
|
|
32
|
-
{
|
|
33
|
-
flexWrap: "wrap",
|
|
34
|
-
direction: "row",
|
|
35
|
-
gap: { xs: 3, sm: 5, md: mode === "checkout" ? 10 : 5 },
|
|
36
|
-
justifyContent: "center",
|
|
37
|
-
children: [
|
|
38
|
-
/* @__PURE__ */ jsx(ProductSkeleton, { count: 2 }, 1),
|
|
39
|
-
/* @__PURE__ */ jsx(ProductSkeleton, { count: 3 }, 2),
|
|
40
|
-
/* @__PURE__ */ jsx(ProductSkeleton, { count: 4 }, 3)
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
);
|
|
29
|
+
return /* @__PURE__ */ jsx(CircularProgress, {});
|
|
44
30
|
}
|
|
45
31
|
if (data.items.length === 0) {
|
|
46
32
|
return /* @__PURE__ */ jsx(Alert, { severity: "warning", children: t("payment.checkout.noPricing") });
|
package/lib/checkout/table.js
CHANGED
|
@@ -14,7 +14,6 @@ var _react = require("react");
|
|
|
14
14
|
var _api = _interopRequireDefault(require("../api"));
|
|
15
15
|
var _livemode = _interopRequireDefault(require("../components/livemode"));
|
|
16
16
|
var _pricingTable = _interopRequireDefault(require("../components/pricing-table"));
|
|
17
|
-
var _productSkeleton = _interopRequireDefault(require("../payment/product-skeleton"));
|
|
18
17
|
var _util = require("../util");
|
|
19
18
|
var _form = _interopRequireDefault(require("./form"));
|
|
20
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -52,23 +51,7 @@ function CheckoutTable({
|
|
|
52
51
|
});
|
|
53
52
|
}
|
|
54
53
|
if (loading || !data) {
|
|
55
|
-
return /* @__PURE__ */(0, _jsxRuntime.
|
|
56
|
-
flexWrap: "wrap",
|
|
57
|
-
direction: "row",
|
|
58
|
-
gap: {
|
|
59
|
-
xs: 3,
|
|
60
|
-
sm: 5,
|
|
61
|
-
md: mode === "checkout" ? 10 : 5
|
|
62
|
-
},
|
|
63
|
-
justifyContent: "center",
|
|
64
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_productSkeleton.default, {
|
|
65
|
-
count: 2
|
|
66
|
-
}, 1), /* @__PURE__ */(0, _jsxRuntime.jsx)(_productSkeleton.default, {
|
|
67
|
-
count: 3
|
|
68
|
-
}, 2), /* @__PURE__ */(0, _jsxRuntime.jsx)(_productSkeleton.default, {
|
|
69
|
-
count: 4
|
|
70
|
-
}, 3)]
|
|
71
|
-
});
|
|
54
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.CircularProgress, {});
|
|
72
55
|
}
|
|
73
56
|
if (data.items.length === 0) {
|
|
74
57
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Alert, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/payment-react",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.145",
|
|
4
4
|
"description": "Reusable react components for payment kit v2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"@babel/core": "^7.23.9",
|
|
90
90
|
"@babel/preset-env": "^7.23.9",
|
|
91
91
|
"@babel/preset-react": "^7.23.3",
|
|
92
|
-
"@blocklet/payment-types": "1.13.
|
|
92
|
+
"@blocklet/payment-types": "1.13.145",
|
|
93
93
|
"@storybook/addon-essentials": "^7.6.13",
|
|
94
94
|
"@storybook/addon-interactions": "^7.6.13",
|
|
95
95
|
"@storybook/addon-links": "^7.6.13",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
"vite-plugin-babel": "^1.2.0",
|
|
119
119
|
"vite-plugin-node-polyfills": "^0.19.0"
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "9ca5d8a2a30ae0da5630b25c409949f978a93190"
|
|
122
122
|
}
|
package/src/checkout/table.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
2
2
|
import Toast from '@arcblock/ux/lib/Toast';
|
|
3
3
|
import type { TPricingTableExpanded } from '@blocklet/payment-types';
|
|
4
|
-
import { Alert, Stack, Typography } from '@mui/material';
|
|
4
|
+
import { Alert, CircularProgress, Stack, Typography } from '@mui/material';
|
|
5
5
|
import { Box } from '@mui/system';
|
|
6
6
|
import { useRequest } from 'ahooks';
|
|
7
7
|
import { useState } from 'react';
|
|
@@ -9,7 +9,6 @@ import { useState } from 'react';
|
|
|
9
9
|
import api from '../api';
|
|
10
10
|
import Livemode from '../components/livemode';
|
|
11
11
|
import PricingTable from '../components/pricing-table';
|
|
12
|
-
import ProductSkeleton from '../payment/product-skeleton';
|
|
13
12
|
import { CheckoutProps } from '../types';
|
|
14
13
|
import { mergeExtraParams } from '../util';
|
|
15
14
|
import CheckoutForm from './form';
|
|
@@ -35,17 +34,7 @@ export default function CheckoutTable({ id, onPaid, onError, mode, extraParams,
|
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
if (loading || !data) {
|
|
38
|
-
return
|
|
39
|
-
<Stack
|
|
40
|
-
flexWrap="wrap"
|
|
41
|
-
direction="row"
|
|
42
|
-
gap={{ xs: 3, sm: 5, md: mode === 'checkout' ? 10 : 5 }}
|
|
43
|
-
justifyContent="center">
|
|
44
|
-
<ProductSkeleton key={1} count={2} />
|
|
45
|
-
<ProductSkeleton key={2} count={3} />
|
|
46
|
-
<ProductSkeleton key={3} count={4} />
|
|
47
|
-
</Stack>
|
|
48
|
-
);
|
|
37
|
+
return <CircularProgress />;
|
|
49
38
|
}
|
|
50
39
|
|
|
51
40
|
if (data.items.length === 0) {
|