@arcblock/did-playground 2.7.3 → 2.7.5
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/lib/Action/index.js +3 -4
- package/package.json +7 -7
- package/src/Action/index.js +4 -2
package/lib/Action/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var
|
|
9
|
+
var _ahooks = require("ahooks");
|
|
10
10
|
var _useBrowser = _interopRequireDefault(require("@arcblock/react-hooks/lib/useBrowser"));
|
|
11
11
|
var _Theme = require("@arcblock/ux/lib/Theme");
|
|
12
12
|
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
@@ -75,11 +75,10 @@ function PlaygroundAction(props) {
|
|
|
75
75
|
const [open, setOpen] = (0, _react.useState)(false);
|
|
76
76
|
const [loading, setLoading] = (0, _react.useState)(false);
|
|
77
77
|
const [dynamicParams, setDynamicParams] = (0, _react.useState)({});
|
|
78
|
-
const
|
|
79
|
-
width
|
|
80
|
-
} = (0, _useWindowSize.default)();
|
|
78
|
+
const size = (0, _ahooks.useSize)(document.body);
|
|
81
79
|
const [success, setSuccess] = (0, _react.useState)(false);
|
|
82
80
|
const [showFrame, setShowFrame] = (0, _react.useState)(success && successUrl && successTarget === 'frame');
|
|
81
|
+
const width = (size === null || size === void 0 ? void 0 : size.width) || 0;
|
|
83
82
|
|
|
84
83
|
// 当打开或关闭组件时,重置部分状态
|
|
85
84
|
(0, _react.useEffect)(() => () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/did-playground",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.5",
|
|
4
4
|
"description": "React components that works with wallet-playground",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
"url": "https://github.com/ArcBlock/wallet-playground/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@arcblock/did-connect": "^2.7.
|
|
34
|
-
"@arcblock/react-hooks": "^2.7.
|
|
35
|
-
"@arcblock/ux": "^2.7.
|
|
33
|
+
"@arcblock/did-connect": "^2.7.5",
|
|
34
|
+
"@arcblock/react-hooks": "^2.7.5",
|
|
35
|
+
"@arcblock/ux": "^2.7.5",
|
|
36
36
|
"@emotion/react": "^11.10.4",
|
|
37
37
|
"@emotion/styled": "^11.10.4",
|
|
38
38
|
"@mui/material": "^5.10.8",
|
|
39
|
+
"ahooks": "^3.7.8",
|
|
39
40
|
"axios": "^0.27.2",
|
|
40
41
|
"core-js": "^3.25.5",
|
|
41
|
-
"mustache": "^4.2.0"
|
|
42
|
-
"react-use": "^17.4.0"
|
|
42
|
+
"mustache": "^4.2.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": ">=18.1.0"
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "5821ccc5b51c313ef45426587eb2357ffe951834"
|
|
57
57
|
}
|
package/src/Action/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext, useState, useEffect } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
3
|
+
import { useSize } from 'ahooks';
|
|
4
4
|
import useBrowser from '@arcblock/react-hooks/lib/useBrowser';
|
|
5
5
|
import { styled, useTheme } from '@arcblock/ux/lib/Theme';
|
|
6
6
|
|
|
@@ -63,10 +63,12 @@ function PlaygroundAction(props) {
|
|
|
63
63
|
const [open, setOpen] = useState(false);
|
|
64
64
|
const [loading, setLoading] = useState(false);
|
|
65
65
|
const [dynamicParams, setDynamicParams] = useState({});
|
|
66
|
-
const
|
|
66
|
+
const size = useSize(document.body);
|
|
67
67
|
const [success, setSuccess] = useState(false);
|
|
68
68
|
const [showFrame, setShowFrame] = useState(success && successUrl && successTarget === 'frame');
|
|
69
69
|
|
|
70
|
+
const width = size?.width || 0;
|
|
71
|
+
|
|
70
72
|
// 当打开或关闭组件时,重置部分状态
|
|
71
73
|
useEffect(
|
|
72
74
|
() => () => {
|