Skip to content

Commit

Permalink
Website: serve images through a CDN (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpierre authored May 19, 2021
1 parent bf5be15 commit 3e73400
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions website/src/Nft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,23 @@ function NftDetails({ nft }: { nft?: NftMetadata }) {
`}
>
{image.endsWith(".mp4") ? (
<LoopVideo type="video/mp4" src={image} height="280" />
<LoopVideo
type="video/mp4"
src={`https://ik.imagekit.io/p/${image}?tr=n-card`}
height="280"
/>
) : (
image && <img src={image} height="280" alt="" />
image && (
<img
src={
image.startsWith("http")
? `https://ik.imagekit.io/p/${image}?tr=n-card`
: image
}
height="280"
alt=""
/>
)
)}
</div>
<h1
Expand Down

0 comments on commit 3e73400

Please sign in to comment.