@arcblock/ux 2.1.43 → 2.1.46
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/CodeBlock/index.js +1 -2
- package/lib/CountDown/index.js +1 -1
- package/lib/Footer/index.js +4 -3
- package/lib/InfoRow/index.js +1 -1
- package/lib/Locale/context.js +7 -2
- package/lib/Metric/index.js +2 -2
- package/lib/NFTDisplay/index.js +11 -5
- package/lib/PricingTable/PricingPlan.js +2 -2
- package/lib/PricingTable/index.js +5 -2
- package/lib/Screenshot/index.js +3 -1
- package/lib/Tabs/index.js +1 -1
- package/lib/Video/index.js +1 -1
- package/lib/Wallet/Action.js +1 -1
- package/package.json +4 -4
- package/src/CodeBlock/index.js +2 -2
- package/src/CountDown/index.js +1 -1
- package/src/Footer/index.js +4 -3
- package/src/InfoRow/index.js +1 -1
- package/src/Locale/context.js +6 -2
- package/src/Metric/index.js +2 -2
- package/src/NFTDisplay/index.js +9 -4
- package/src/PricingTable/PricingPlan.js +2 -2
- package/src/PricingTable/index.js +3 -2
- package/src/Screenshot/index.js +5 -2
- package/src/Tabs/index.js +1 -1
- package/src/Video/index.js +1 -1
- package/src/Wallet/Action.js +1 -1
package/lib/CodeBlock/index.js
CHANGED
|
@@ -148,7 +148,6 @@ function CodeBlock(_ref) {
|
|
|
148
148
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_IconButton.default, {
|
|
149
149
|
className: "copy-button",
|
|
150
150
|
onClick: onCopy,
|
|
151
|
-
tabIndex: "-1",
|
|
152
151
|
color: "primary",
|
|
153
152
|
disabled: copied,
|
|
154
153
|
children: [!copied && /*#__PURE__*/(0, _jsxRuntime.jsx)(_FileCopy.default, {
|
|
@@ -181,4 +180,4 @@ const fontFamily = 'source-code-pro, Menlo, Monaco, Consolas, Courier New, monos
|
|
|
181
180
|
const Pre = _styledComponents.default.pre.withConfig({
|
|
182
181
|
displayName: "CodeBlock__Pre",
|
|
183
182
|
componentId: "sc-1bpapaq-0"
|
|
184
|
-
})(["font-family:", ";display:block;font-size:14px;line-height:1.42857143;margin:0 0 32px;word-break:break-word;word-wrap:break-word;text-align:left;border-radius:5px;border:1px solid #dedede;background:#222;color:#fff;position:relative;.codeblock__inner{display:block;width:100%;max-height:46.25rem;overflow:scroll;}.copy-button{display:none;position:absolute;top:8px;right:24px;padding:4px;border-radius:4px;&,&:hover,&.Mui-disabled{background:", ";}}&:hover{.copy-button{display:
|
|
183
|
+
})(["font-family:", ";display:block;font-size:14px;line-height:1.42857143;margin:0 0 32px;word-break:break-word;word-wrap:break-word;text-align:left;border-radius:5px;border:1px solid #dedede;background:#222;color:#fff;position:relative;.codeblock__inner{display:block;width:100%;max-height:46.25rem;overflow:scroll;}.copy-button{display:none;position:absolute;top:8px;right:24px;padding:4px;border-radius:4px;&,&:hover,&.Mui-disabled{background:", ";}}&:hover{.copy-button{display:flex;}}code{counter-reset:line;counter-increment:line;padding:16px;font-family:", ";color:#fff;*{font-family:", ";}}.hljs *{white-space:normal;}"], fontFamily, _Colors.default.primary.main, fontFamily, fontFamily);
|
package/lib/CountDown/index.js
CHANGED
|
@@ -83,8 +83,8 @@ function FixWidthNumber(_ref) {
|
|
|
83
83
|
|
|
84
84
|
class CountDown extends _react.Component {
|
|
85
85
|
constructor(props) {
|
|
86
|
+
super(props);
|
|
86
87
|
const newProps = (0, _Util.mergeProps)(props, CountDown, ['dark', 'endTime', 'style']);
|
|
87
|
-
super(newProps);
|
|
88
88
|
this.state = getRemaining(newProps.endTime);
|
|
89
89
|
this.timer = null;
|
|
90
90
|
}
|
package/lib/Footer/index.js
CHANGED
|
@@ -31,8 +31,9 @@ function Footer(props) {
|
|
|
31
31
|
brand,
|
|
32
32
|
dark
|
|
33
33
|
} = newProps;
|
|
34
|
-
const
|
|
35
|
-
const
|
|
34
|
+
const endYearString = "".concat(new Date().getFullYear());
|
|
35
|
+
const copyStartString = "".concat(copyStart);
|
|
36
|
+
const copyYear = endYearString === copyStartString ? endYearString : "".concat(copyStartString, "-").concat(endYearString);
|
|
36
37
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Container, {
|
|
37
38
|
className: className,
|
|
38
39
|
style: style,
|
|
@@ -73,7 +74,7 @@ function Footer(props) {
|
|
|
73
74
|
Footer.propTypes = {
|
|
74
75
|
dark: _propTypes.default.bool,
|
|
75
76
|
className: _propTypes.default.string,
|
|
76
|
-
copyStart: _propTypes.default.string,
|
|
77
|
+
copyStart: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
77
78
|
brand: _propTypes.default.string,
|
|
78
79
|
style: _propTypes.default.object
|
|
79
80
|
};
|
package/lib/InfoRow/index.js
CHANGED
|
@@ -74,7 +74,7 @@ InfoRow.defaultProps = {
|
|
|
74
74
|
const resetName = name.split(' ').map(x => (0, _upperFirst.default)((0, _camelCase.default)(x))).join(' ');
|
|
75
75
|
return typeof name === 'string' ? resetName : name;
|
|
76
76
|
},
|
|
77
|
-
valueComponent: '
|
|
77
|
+
valueComponent: 'div',
|
|
78
78
|
layout: 'horizontal'
|
|
79
79
|
};
|
|
80
80
|
|
package/lib/Locale/context.js
CHANGED
|
@@ -83,8 +83,13 @@ const create = () => {
|
|
|
83
83
|
|
|
84
84
|
const [currentLocale, setCurrentLocale] = (0, _react.useState)(getLocale(locale));
|
|
85
85
|
(0, _react.useEffect)(() => {
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
const tmpLocale = getLocale(locale);
|
|
87
|
+
|
|
88
|
+
if (tmpLocale !== currentLocale) {
|
|
89
|
+
setCurrentLocale(tmpLocale);
|
|
90
|
+
setLocale(tmpLocale);
|
|
91
|
+
}
|
|
92
|
+
}, [currentLocale, locale]);
|
|
88
93
|
|
|
89
94
|
const changeLocale = newLocale => {
|
|
90
95
|
setCurrentLocale(newLocale);
|
package/lib/Metric/index.js
CHANGED
|
@@ -31,7 +31,7 @@ function Metric(_ref) {
|
|
|
31
31
|
className: "metric__image",
|
|
32
32
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_image.default, {
|
|
33
33
|
name: icon,
|
|
34
|
-
alt: name,
|
|
34
|
+
alt: typeof name === 'string' ? name : '',
|
|
35
35
|
size: 30,
|
|
36
36
|
prefix: prefix,
|
|
37
37
|
color: "#222222"
|
|
@@ -59,7 +59,7 @@ function Metric(_ref) {
|
|
|
59
59
|
Metric.propTypes = {
|
|
60
60
|
icon: _propTypes.default.string.isRequired,
|
|
61
61
|
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
62
|
-
name: _propTypes.default.
|
|
62
|
+
name: _propTypes.default.node.isRequired,
|
|
63
63
|
animated: _propTypes.default.bool,
|
|
64
64
|
url: _propTypes.default.string,
|
|
65
65
|
LinkComponent: _propTypes.default.any,
|
package/lib/NFTDisplay/index.js
CHANGED
|
@@ -114,9 +114,10 @@ function NFTDisplay(_ref) {
|
|
|
114
114
|
children: children
|
|
115
115
|
}));
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
const parsed = (0, _react.useRef)(data); // 如果是 raw data 先解析
|
|
117
|
+
const parsed = (0, _react.useRef)(data);
|
|
119
118
|
|
|
119
|
+
try {
|
|
120
|
+
// 如果是 raw data 先解析
|
|
120
121
|
if (typeof parsed.current === 'string') {
|
|
121
122
|
parsed.current = JSON.parse(data); // console.log('[debug] parse data')
|
|
122
123
|
}
|
|
@@ -208,7 +209,7 @@ function NFTDisplay(_ref) {
|
|
|
208
209
|
const svg = _buffer.Buffer.from(buffer).toString('utf8');
|
|
209
210
|
|
|
210
211
|
if (checkSvg && !(0, _isSvg.default)(svg)) {
|
|
211
|
-
throw new Error(
|
|
212
|
+
throw new Error('Invalid SVG of type svg_gzipped');
|
|
212
213
|
}
|
|
213
214
|
|
|
214
215
|
const Embedder = getSvgEmbedder(preferredSvgEmbedder);
|
|
@@ -220,7 +221,7 @@ function NFTDisplay(_ref) {
|
|
|
220
221
|
case 'svg':
|
|
221
222
|
{
|
|
222
223
|
if (checkSvg && !(0, _isSvg.default)(content)) {
|
|
223
|
-
throw new Error(
|
|
224
|
+
throw new Error('Invalid SVG of type svg');
|
|
224
225
|
}
|
|
225
226
|
|
|
226
227
|
const Embedder = getSvgEmbedder(preferredSvgEmbedder);
|
|
@@ -246,7 +247,12 @@ function NFTDisplay(_ref) {
|
|
|
246
247
|
children: [(state.loading || !minimumLoadingReady) && (renderLoading ? renderLoading() : /*#__PURE__*/(0, _jsxRuntime.jsx)(_loading.default, {})), renderNFT()]
|
|
247
248
|
}));
|
|
248
249
|
} catch (e) {
|
|
249
|
-
|
|
250
|
+
var _parsed$current;
|
|
251
|
+
|
|
252
|
+
console.error(e === null || e === void 0 ? void 0 : e.message, {
|
|
253
|
+
nftId: address,
|
|
254
|
+
vcId: parsed === null || parsed === void 0 ? void 0 : (_parsed$current = parsed.current) === null || _parsed$current === void 0 ? void 0 : _parsed$current.vcId
|
|
255
|
+
});
|
|
250
256
|
return wrapRoot(renderError ? renderError() : /*#__PURE__*/(0, _jsxRuntime.jsx)(_broken.default, {}));
|
|
251
257
|
}
|
|
252
258
|
}
|
|
@@ -26,7 +26,7 @@ function PricingPlan(_ref) {
|
|
|
26
26
|
plan
|
|
27
27
|
} = _ref;
|
|
28
28
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(PlanCard, {
|
|
29
|
-
shadow: true,
|
|
29
|
+
$shadow: true,
|
|
30
30
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
31
31
|
className: "card-header",
|
|
32
32
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -77,4 +77,4 @@ PricingPlan.propTypes = {
|
|
|
77
77
|
const PlanCard = (0, _styledComponents.default)(_Card.default).withConfig({
|
|
78
78
|
displayName: "PricingPlan__PlanCard",
|
|
79
79
|
componentId: "sc-11tuq1x-0"
|
|
80
|
-
})(["height:500px;display:flex;flex-direction:column;@media (max-width:320px){margin-top:20px;}&&{", "}.card-header{height:80px;background-color:#f1fbfb;display:flex;flex-flow:column;align-items:center;justify-content:center;.title{font-size:18px;font-weight:600;text-align:center;color:#404040;margin:0;}}.card-content{display:flex;flex-direction:column;justify-content:space-between;align-items:center;flex-grow:1;}.plan-content{display:flex;flex-direction:column;flex-grow:1;.plan-pricing{display:flex;justify-content:center;align-items:baseline;margin-bottom:12px;color:#4e6af6;text-align:center;}.price-number{font-size:30px;font-weight:600;color:#4e6af6;}.plan-services strong{color:#4e6af6;font-weight:500;}}.plan-actions{width:100%;}"], props => props
|
|
80
|
+
})(["height:500px;display:flex;flex-direction:column;@media (max-width:320px){margin-top:20px;}&&{", "}.card-header{height:80px;background-color:#f1fbfb;display:flex;flex-flow:column;align-items:center;justify-content:center;.title{font-size:18px;font-weight:600;text-align:center;color:#404040;margin:0;}}.card-content{display:flex;flex-direction:column;justify-content:space-between;align-items:center;flex-grow:1;}.plan-content{display:flex;flex-direction:column;flex-grow:1;.plan-pricing{display:flex;justify-content:center;align-items:baseline;margin-bottom:12px;color:#4e6af6;text-align:center;}.price-number{font-size:30px;font-weight:600;color:#4e6af6;}.plan-services strong{color:#4e6af6;font-weight:500;}}.plan-actions{width:100%;}"], props => props.$shadow ? '' : 'box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.1)');
|
|
@@ -29,7 +29,10 @@ function PricingTable(_ref) {
|
|
|
29
29
|
container: true,
|
|
30
30
|
spacing: 2,
|
|
31
31
|
justifyContent: "center",
|
|
32
|
-
children: plans.map(x
|
|
32
|
+
children: plans.map((x, index) =>
|
|
33
|
+
/*#__PURE__*/
|
|
34
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
35
|
+
(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
33
36
|
item: true,
|
|
34
37
|
className: "plan-item",
|
|
35
38
|
xs: 12,
|
|
@@ -38,7 +41,7 @@ function PricingTable(_ref) {
|
|
|
38
41
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PricingPlan.default, {
|
|
39
42
|
plan: x
|
|
40
43
|
})
|
|
41
|
-
},
|
|
44
|
+
}, index))
|
|
42
45
|
})
|
|
43
46
|
});
|
|
44
47
|
}
|
package/lib/Screenshot/index.js
CHANGED
|
@@ -166,7 +166,9 @@ function Screenshot(props) {
|
|
|
166
166
|
className: "device-frame",
|
|
167
167
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
168
168
|
className: "device-content",
|
|
169
|
-
children: findChildren(_react.Children.toArray(children))
|
|
169
|
+
children: findChildren(_react.Children.toArray(children)).map((item, index) => /*#__PURE__*/(0, _react.cloneElement)(item, {
|
|
170
|
+
key: index
|
|
171
|
+
}))
|
|
170
172
|
})
|
|
171
173
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
172
174
|
className: "device-stripe"
|
package/lib/Tabs/index.js
CHANGED
|
@@ -58,7 +58,7 @@ function Tabs(_ref2) {
|
|
|
58
58
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
59
59
|
|
|
60
60
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledMuiTabs, _objectSpread(_objectSpread({
|
|
61
|
-
scrollButtons: "
|
|
61
|
+
scrollButtons: "auto",
|
|
62
62
|
variant: "scrollable",
|
|
63
63
|
value: current,
|
|
64
64
|
onChange: (_, newValue) => _onChange(newValue),
|
package/lib/Video/index.js
CHANGED
|
@@ -63,7 +63,7 @@ function Video(props) {
|
|
|
63
63
|
style: styles,
|
|
64
64
|
src: url,
|
|
65
65
|
onLoad: () => setLoaded(true),
|
|
66
|
-
allowFullScreen:
|
|
66
|
+
allowFullScreen: true
|
|
67
67
|
}), !loaded && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgress.default, {
|
|
68
68
|
className: "loading-indicator",
|
|
69
69
|
color: "primary"
|
package/lib/Wallet/Action.js
CHANGED
|
@@ -84,7 +84,7 @@ function WalletAction(props) {
|
|
|
84
84
|
|
|
85
85
|
WalletAction.propTypes = {
|
|
86
86
|
action: _propTypes.default.string,
|
|
87
|
-
size: _propTypes.default.oneOf(['large', 'medium', 'small']),
|
|
87
|
+
size: _propTypes.default.oneOf(['xlarge', 'large', 'medium', 'small']),
|
|
88
88
|
textLayout: _propTypes.default.oneOf(['vertical', 'horizontal']),
|
|
89
89
|
style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string])
|
|
90
90
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.46",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"react": ">=18.1.0",
|
|
53
53
|
"react-ga": "^2.7.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "cd765bb0fe364dd784fad471435d2ddef23fefa4",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@arcblock/icons": "^2.1.
|
|
58
|
-
"@arcblock/react-hooks": "^2.1.
|
|
57
|
+
"@arcblock/icons": "^2.1.46",
|
|
58
|
+
"@arcblock/react-hooks": "^2.1.46",
|
|
59
59
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
60
60
|
"@emotion/react": "^11.9.0",
|
|
61
61
|
"@emotion/styled": "^11.8.1",
|
package/src/CodeBlock/index.js
CHANGED
|
@@ -74,7 +74,7 @@ export default function CodeBlock({ code, language, children, ...rest }) {
|
|
|
74
74
|
dangerouslySetInnerHTML={{ __html: hljs.highlightAuto(source, [language]).value }}
|
|
75
75
|
/>
|
|
76
76
|
</span>
|
|
77
|
-
<Button className="copy-button" onClick={onCopy}
|
|
77
|
+
<Button className="copy-button" onClick={onCopy} color="primary" disabled={copied}>
|
|
78
78
|
{!copied && <CopyIcon style={{ color: '#fff', fontSize: 16 }} />}
|
|
79
79
|
{copied && <CheckIcon style={{ color: '#fff', fontSize: 16 }} />}
|
|
80
80
|
</Button>
|
|
@@ -134,7 +134,7 @@ const Pre = styled.pre`
|
|
|
134
134
|
|
|
135
135
|
&:hover {
|
|
136
136
|
.copy-button {
|
|
137
|
-
display:
|
|
137
|
+
display: flex;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
|
package/src/CountDown/index.js
CHANGED
|
@@ -43,8 +43,8 @@ function FixWidthNumber({ number, label, length = 2 }) {
|
|
|
43
43
|
|
|
44
44
|
export default class CountDown extends Component {
|
|
45
45
|
constructor(props) {
|
|
46
|
+
super(props);
|
|
46
47
|
const newProps = mergeProps(props, CountDown, ['dark', 'endTime', 'style']);
|
|
47
|
-
super(newProps);
|
|
48
48
|
this.state = getRemaining(newProps.endTime);
|
|
49
49
|
this.timer = null;
|
|
50
50
|
}
|
package/src/Footer/index.js
CHANGED
|
@@ -11,8 +11,9 @@ export default function Footer(props) {
|
|
|
11
11
|
const newProps = mergeProps(props, Footer, ['dark', 'style']);
|
|
12
12
|
const { className, copyStart, style, brand, dark } = newProps;
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
const
|
|
14
|
+
const endYearString = `${new Date().getFullYear()}`;
|
|
15
|
+
const copyStartString = `${copyStart}`;
|
|
16
|
+
const copyYear = endYearString === copyStartString ? endYearString : `${copyStartString}-${endYearString}`;
|
|
16
17
|
|
|
17
18
|
return (
|
|
18
19
|
<Container className={className} style={style} dark={dark}>
|
|
@@ -35,7 +36,7 @@ export default function Footer(props) {
|
|
|
35
36
|
Footer.propTypes = {
|
|
36
37
|
dark: PropTypes.bool,
|
|
37
38
|
className: PropTypes.string,
|
|
38
|
-
copyStart: PropTypes.string,
|
|
39
|
+
copyStart: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
39
40
|
brand: PropTypes.string,
|
|
40
41
|
style: PropTypes.object,
|
|
41
42
|
};
|
package/src/InfoRow/index.js
CHANGED
package/src/Locale/context.js
CHANGED
|
@@ -39,8 +39,12 @@ const create = () => {
|
|
|
39
39
|
const [currentLocale, setCurrentLocale] = useState(getLocale(locale));
|
|
40
40
|
|
|
41
41
|
useEffect(() => {
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
const tmpLocale = getLocale(locale);
|
|
43
|
+
if (tmpLocale !== currentLocale) {
|
|
44
|
+
setCurrentLocale(tmpLocale);
|
|
45
|
+
setLocale(tmpLocale);
|
|
46
|
+
}
|
|
47
|
+
}, [currentLocale, locale]);
|
|
44
48
|
|
|
45
49
|
const changeLocale = (newLocale) => {
|
|
46
50
|
setCurrentLocale(newLocale);
|
package/src/Metric/index.js
CHANGED
|
@@ -8,7 +8,7 @@ export default function Metric({ icon, value, name, url, animated, LinkComponent
|
|
|
8
8
|
const metric = (
|
|
9
9
|
<>
|
|
10
10
|
<div className="metric__image">
|
|
11
|
-
<ImageIcon name={icon} alt={name} size={30} prefix={prefix} color="#222222" />
|
|
11
|
+
<ImageIcon name={icon} alt={typeof name === 'string' ? name : ''} size={30} prefix={prefix} color="#222222" />
|
|
12
12
|
</div>
|
|
13
13
|
<div>
|
|
14
14
|
<div
|
|
@@ -26,7 +26,7 @@ export default function Metric({ icon, value, name, url, animated, LinkComponent
|
|
|
26
26
|
Metric.propTypes = {
|
|
27
27
|
icon: PropTypes.string.isRequired,
|
|
28
28
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
29
|
-
name: PropTypes.
|
|
29
|
+
name: PropTypes.node.isRequired,
|
|
30
30
|
animated: PropTypes.bool,
|
|
31
31
|
url: PropTypes.string,
|
|
32
32
|
LinkComponent: PropTypes.any,
|
package/src/NFTDisplay/index.js
CHANGED
|
@@ -69,13 +69,15 @@ function NFTDisplay({
|
|
|
69
69
|
</Root>
|
|
70
70
|
);
|
|
71
71
|
|
|
72
|
+
const parsed = useRef(data);
|
|
73
|
+
|
|
72
74
|
try {
|
|
73
|
-
const parsed = useRef(data);
|
|
74
75
|
// 如果是 raw data 先解析
|
|
75
76
|
if (typeof parsed.current === 'string') {
|
|
76
77
|
parsed.current = JSON.parse(data);
|
|
77
78
|
// console.log('[debug] parse data')
|
|
78
79
|
}
|
|
80
|
+
|
|
79
81
|
const { vcId } = parsed.current;
|
|
80
82
|
// 需要兼容新旧两种类型的数据结构, nft data 有 credentialSubject 属性, 说明是旧 nft data, 否则是新 nft data
|
|
81
83
|
const display = parsed.current.credentialSubject
|
|
@@ -147,14 +149,14 @@ function NFTDisplay({
|
|
|
147
149
|
const buffer = pako.ungzip(fromBase64(content), {});
|
|
148
150
|
const svg = Buffer.from(buffer).toString('utf8');
|
|
149
151
|
if (checkSvg && !isSvg(svg)) {
|
|
150
|
-
throw new Error(
|
|
152
|
+
throw new Error('Invalid SVG of type svg_gzipped');
|
|
151
153
|
}
|
|
152
154
|
const Embedder = getSvgEmbedder(preferredSvgEmbedder);
|
|
153
155
|
return <Embedder svg={svg} />;
|
|
154
156
|
}
|
|
155
157
|
case 'svg': {
|
|
156
158
|
if (checkSvg && !isSvg(content)) {
|
|
157
|
-
throw new Error(
|
|
159
|
+
throw new Error('Invalid SVG of type svg');
|
|
158
160
|
}
|
|
159
161
|
const Embedder = getSvgEmbedder(preferredSvgEmbedder);
|
|
160
162
|
return <Embedder svg={content} />;
|
|
@@ -176,7 +178,10 @@ function NFTDisplay({
|
|
|
176
178
|
</>
|
|
177
179
|
);
|
|
178
180
|
} catch (e) {
|
|
179
|
-
console.error(e
|
|
181
|
+
console.error(e?.message, {
|
|
182
|
+
nftId: address,
|
|
183
|
+
vcId: parsed?.current?.vcId,
|
|
184
|
+
});
|
|
180
185
|
return wrapRoot(renderError ? renderError() : <DefaultBrokenImage />);
|
|
181
186
|
}
|
|
182
187
|
}
|
|
@@ -8,7 +8,7 @@ import Typography from '@mui/material/Typography';
|
|
|
8
8
|
|
|
9
9
|
function PricingPlan({ plan }) {
|
|
10
10
|
return (
|
|
11
|
-
<PlanCard shadow>
|
|
11
|
+
<PlanCard $shadow>
|
|
12
12
|
<div className="card-header">
|
|
13
13
|
<div className="title">{plan.name}</div>
|
|
14
14
|
</div>
|
|
@@ -54,7 +54,7 @@ const PlanCard = styled(Card)`
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
&& {
|
|
57
|
-
${(props) => (props
|
|
57
|
+
${(props) => (props.$shadow ? '' : 'box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.1)')}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
.card-header {
|
|
@@ -9,8 +9,9 @@ function PricingTable({ plans }) {
|
|
|
9
9
|
return (
|
|
10
10
|
<Div variant="even">
|
|
11
11
|
<Grid container spacing={2} justifyContent="center">
|
|
12
|
-
{plans.map((x) => (
|
|
13
|
-
|
|
12
|
+
{plans.map((x, index) => (
|
|
13
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
14
|
+
<Grid item className="plan-item" key={index} xs={12} sm={6} md={3}>
|
|
14
15
|
<PricingPlan plan={x} />
|
|
15
16
|
</Grid>
|
|
16
17
|
))}
|
package/src/Screenshot/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElement, Children } from 'react';
|
|
1
|
+
import { createElement, Children, cloneElement } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
|
|
@@ -130,7 +130,10 @@ function Screenshot(props) {
|
|
|
130
130
|
contentRadius={borderRadius}
|
|
131
131
|
contentZIndex={zIndex}>
|
|
132
132
|
<div className="device-frame">
|
|
133
|
-
<div className="device-content">
|
|
133
|
+
<div className="device-content">
|
|
134
|
+
{/* eslint-disable-next-line react/no-array-index-key */}
|
|
135
|
+
{findChildren(Children.toArray(children)).map((item, index) => cloneElement(item, { key: index }))}
|
|
136
|
+
</div>
|
|
134
137
|
</div>
|
|
135
138
|
<div className="device-stripe" />
|
|
136
139
|
<div className="device-header" />
|
package/src/Tabs/index.js
CHANGED
|
@@ -24,7 +24,7 @@ const StyledMuiTabs = styled(MuiTabs)(({ theme }) => ({
|
|
|
24
24
|
export default function Tabs({ tabs, current, onChange, ...rest }) {
|
|
25
25
|
return (
|
|
26
26
|
<StyledMuiTabs
|
|
27
|
-
scrollButtons="
|
|
27
|
+
scrollButtons="auto"
|
|
28
28
|
variant="scrollable"
|
|
29
29
|
value={current}
|
|
30
30
|
onChange={(_, newValue) => onChange(newValue)}
|
package/src/Video/index.js
CHANGED
|
@@ -23,7 +23,7 @@ export default function Video(props) {
|
|
|
23
23
|
if (url.indexOf('v.qq.com') > 0) {
|
|
24
24
|
return (
|
|
25
25
|
<Placeholder style={{ width, height }}>
|
|
26
|
-
<iframe title={url} style={styles} src={url} onLoad={() => setLoaded(true)} allowFullScreen
|
|
26
|
+
<iframe title={url} style={styles} src={url} onLoad={() => setLoaded(true)} allowFullScreen />
|
|
27
27
|
{!loaded && <CircularProgress className="loading-indicator" color="primary" />}
|
|
28
28
|
</Placeholder>
|
|
29
29
|
);
|
package/src/Wallet/Action.js
CHANGED
|
@@ -35,7 +35,7 @@ export default function WalletAction(props) {
|
|
|
35
35
|
|
|
36
36
|
WalletAction.propTypes = {
|
|
37
37
|
action: PropTypes.string,
|
|
38
|
-
size: PropTypes.oneOf(['large', 'medium', 'small']),
|
|
38
|
+
size: PropTypes.oneOf(['xlarge', 'large', 'medium', 'small']),
|
|
39
39
|
textLayout: PropTypes.oneOf(['vertical', 'horizontal']),
|
|
40
40
|
style: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
41
41
|
};
|