@arcblock/ux 2.10.37 → 2.10.38
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/NFTDisplay/index.js +7 -0
- package/package.json +5 -5
- package/src/NFTDisplay/index.js +23 -0
package/lib/NFTDisplay/index.js
CHANGED
@@ -228,6 +228,13 @@ function NFTDisplay({
|
|
228
228
|
const renderObject = () => {
|
229
229
|
const objectType = state.urlType || 'image/svg+xml';
|
230
230
|
const url = getFullContentUrl();
|
231
|
+
|
232
|
+
// do naive image render
|
233
|
+
const pathname = new URL(url).pathname.toLowerCase();
|
234
|
+
const imageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.webp', '.svg', '.tiff', '.tif', '.ico', '.jfif', '.pjpeg', '.pjp', '.avif'];
|
235
|
+
if (imageExtensions.some(ext => pathname.endsWith(ext))) {
|
236
|
+
return renderImg();
|
237
|
+
}
|
231
238
|
return (
|
232
239
|
/*#__PURE__*/
|
233
240
|
// eslint-disable-next-line jsx-a11y/alt-text
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "2.10.
|
3
|
+
"version": "2.10.38",
|
4
4
|
"description": "Common used react components for arcblock products",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
@@ -63,12 +63,12 @@
|
|
63
63
|
"react": ">=18.2.0",
|
64
64
|
"react-router-dom": ">=6.22.3"
|
65
65
|
},
|
66
|
-
"gitHead": "
|
66
|
+
"gitHead": "ec30518daa2eb50dc076fe00e7dfde253ba8b7cb",
|
67
67
|
"dependencies": {
|
68
68
|
"@arcblock/did-motif": "^1.1.13",
|
69
|
-
"@arcblock/icons": "^2.10.
|
70
|
-
"@arcblock/nft-display": "^2.10.
|
71
|
-
"@arcblock/react-hooks": "^2.10.
|
69
|
+
"@arcblock/icons": "^2.10.38",
|
70
|
+
"@arcblock/nft-display": "^2.10.38",
|
71
|
+
"@arcblock/react-hooks": "^2.10.38",
|
72
72
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
73
73
|
"@fontsource/inter": "^5.0.16",
|
74
74
|
"@fontsource/ubuntu-mono": "^5.0.18",
|
package/src/NFTDisplay/index.js
CHANGED
@@ -201,6 +201,29 @@ function NFTDisplay({
|
|
201
201
|
const renderObject = () => {
|
202
202
|
const objectType = state.urlType || 'image/svg+xml';
|
203
203
|
const url = getFullContentUrl();
|
204
|
+
|
205
|
+
// do naive image render
|
206
|
+
const pathname = new URL(url).pathname.toLowerCase();
|
207
|
+
const imageExtensions = [
|
208
|
+
'.jpg',
|
209
|
+
'.jpeg',
|
210
|
+
'.png',
|
211
|
+
'.gif',
|
212
|
+
'.bmp',
|
213
|
+
'.webp',
|
214
|
+
'.svg',
|
215
|
+
'.tiff',
|
216
|
+
'.tif',
|
217
|
+
'.ico',
|
218
|
+
'.jfif',
|
219
|
+
'.pjpeg',
|
220
|
+
'.pjp',
|
221
|
+
'.avif',
|
222
|
+
];
|
223
|
+
if (imageExtensions.some((ext) => pathname.endsWith(ext))) {
|
224
|
+
return renderImg();
|
225
|
+
}
|
226
|
+
|
204
227
|
return (
|
205
228
|
// eslint-disable-next-line jsx-a11y/alt-text
|
206
229
|
<object
|