feat: use cloudflare image resizing

This commit is contained in:
DIYgod
2023-08-12 18:57:25 +01:00
parent 6563a9c273
commit fc86508206
11 changed files with 50 additions and 6 deletions
+2 -2
View File
@@ -3,7 +3,7 @@
import React, { useState } from "react"
import { Image } from "~/components/ui/Image"
import { IPFS_GATEWAY } from "~/lib/env"
import { IPFS_GATEWAY, IPFS_GATEWAY_FALLBACK } from "~/lib/env"
export const UniMedia = ({
src,
@@ -21,7 +21,7 @@ export const UniMedia = ({
if (src && !errorHandled) {
try {
const response = await fetch(
src.replace(IPFS_GATEWAY, "https://gateway.ipfs.io/ipfs/"),
src.replace(IPFS_GATEWAY, IPFS_GATEWAY_FALLBACK),
{
method: "HEAD",
},