@arcblock/ux 1.16.17 → 1.16.18
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/NFTDisplay/index.js +14 -1
- package/package.json +4 -4
- package/src/NFTDisplay/index.js +11 -2
package/lib/NFTDisplay/index.js
CHANGED
|
@@ -150,7 +150,6 @@ function NFTDisplay(_ref) {
|
|
|
150
150
|
if (content) {
|
|
151
151
|
switch (type) {
|
|
152
152
|
case 'url':
|
|
153
|
-
case 'uri':
|
|
154
153
|
{
|
|
155
154
|
const urlObj = new URL(content);
|
|
156
155
|
|
|
@@ -175,6 +174,20 @@ function NFTDisplay(_ref) {
|
|
|
175
174
|
});
|
|
176
175
|
}
|
|
177
176
|
|
|
177
|
+
case 'uri':
|
|
178
|
+
{
|
|
179
|
+
return /*#__PURE__*/_react.default.createElement("img", {
|
|
180
|
+
src: content,
|
|
181
|
+
onError: () => setState(_objectSpread(_objectSpread({}, state), {}, {
|
|
182
|
+
error: true
|
|
183
|
+
})),
|
|
184
|
+
onLoad: () => setState(_objectSpread(_objectSpread({}, state), {}, {
|
|
185
|
+
loading: false
|
|
186
|
+
})),
|
|
187
|
+
alt: "NFT Display"
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
178
191
|
case 'svg_gzipped':
|
|
179
192
|
{
|
|
180
193
|
const buffer = _pako.default.ungzip(fromBase64(content), {});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.18",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"react": ">=16.12.0",
|
|
54
54
|
"react-ga": "^2.7.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "d558b1c877b8ea29fc1719ca91bd7506344a6b23",
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@arcblock/icons": "^1.16.
|
|
59
|
-
"@arcblock/react-hooks": "^1.16.
|
|
58
|
+
"@arcblock/icons": "^1.16.18",
|
|
59
|
+
"@arcblock/react-hooks": "^1.16.18",
|
|
60
60
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
61
61
|
"@material-ui/core": "^4.12.3",
|
|
62
62
|
"@material-ui/icons": "4.11.2",
|
package/src/NFTDisplay/index.js
CHANGED
|
@@ -97,8 +97,7 @@ function NFTDisplay({
|
|
|
97
97
|
const renderNFT = () => {
|
|
98
98
|
if (content) {
|
|
99
99
|
switch (type) {
|
|
100
|
-
case 'url':
|
|
101
|
-
case 'uri': {
|
|
100
|
+
case 'url': {
|
|
102
101
|
const urlObj = new URL(content);
|
|
103
102
|
if (!urlObj.searchParams.has('assetId')) {
|
|
104
103
|
urlObj.searchParams.append('assetId', address);
|
|
@@ -118,6 +117,16 @@ function NFTDisplay({
|
|
|
118
117
|
/>
|
|
119
118
|
);
|
|
120
119
|
}
|
|
120
|
+
case 'uri': {
|
|
121
|
+
return (
|
|
122
|
+
<img
|
|
123
|
+
src={content}
|
|
124
|
+
onError={() => setState({ ...state, error: true })}
|
|
125
|
+
onLoad={() => setState({ ...state, loading: false })}
|
|
126
|
+
alt="NFT Display"
|
|
127
|
+
/>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
121
130
|
case 'svg_gzipped': {
|
|
122
131
|
const buffer = pako.ungzip(fromBase64(content), {});
|
|
123
132
|
const svg = Buffer.from(buffer).toString('utf8');
|