@zoralabs/nft-components
Advanced tools
Comparing version 0.1.8-pre1 to 0.1.8-pre2
@@ -51,3 +51,2 @@ "use strict"; | ||
context.clearRect(0, 0, width, height); | ||
console.log({ uriEntropy }); | ||
for (let i = 0; i < width; i += 5) { | ||
@@ -54,0 +53,0 @@ const sinRnd = Math.sin(i + uriEntropy) * 10000; |
@@ -25,2 +25,11 @@ "use strict"; | ||
const react_1 = __importStar(require("react")); | ||
function getNormalizedURI(uri) { | ||
if (uri.startsWith("ipfs://")) { | ||
return uri.replace("ipfs://", "https://ipfs.io/ipfs/"); | ||
} | ||
if (uri.startsWith("arweave://")) { | ||
return uri.replace("arweave://", "https://arweave.net/"); | ||
} | ||
return uri; | ||
} | ||
function useMediaObjectProps({ uri, request, a11yIdPrefix, getStyles, }) { | ||
@@ -38,3 +47,3 @@ const [loading, setLoading] = react_1.useState(true); | ||
onError: () => setError("Error loading"), | ||
src: uri, | ||
src: uri ? getNormalizedURI(uri) : uri, | ||
...getStyles("mediaObject", { | ||
@@ -41,0 +50,0 @@ mediaLoaded: !loading, |
{ | ||
"name": "@zoralabs/nft-components", | ||
"version": "0.1.8-pre1", | ||
"version": "0.1.8-pre2", | ||
"description": "NFT Media Rendering Components", | ||
@@ -18,3 +18,3 @@ "typings": "dist/index.d.ts", | ||
"@types/react": "^17.0.5", | ||
"@zoralabs/nft-hooks": "0.5.0-pre3", | ||
"@zoralabs/nft-hooks": "^0.5.0", | ||
"merge-anything": "^4.0.1", | ||
@@ -45,2 +45,5 @@ "react": "^17.0.2", | ||
}, | ||
"peerDependencies": { | ||
"@zoralabs/nft-hooks": "^0.5.0" | ||
}, | ||
"lint-staged": { | ||
@@ -47,0 +50,0 @@ "*.{ts,md}": "prettier src --write" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
211199
4747
9
+ Added@zoralabs/nft-hooks@0.5.3(transitive)
- Removed@zoralabs/nft-hooks@0.5.0-pre3(transitive)
Updated@zoralabs/nft-hooks@^0.5.0