Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ PRICES_SERVICE_URI=prices.mainnet.teritori.com:443
SUBSTREAMS_API_TOKEN=<get_from_substream_site>

#app env
EXPO_PUBLIC_IMG_PROXY_URL=https://imgproxy.tools.teritori.com/insecure/
EXPO_PUBLIC_PUBLIC_TENOR_KEY=AIzaSyA8TpVfoyoBaDdLww6wJ1Xe0OVN-Hi8qPE

#map token
Expand Down
2 changes: 0 additions & 2 deletions mainnet.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@ PRICES_DB_USER=postgres
PRICES_DB_PASSWORD=magic

PRICES_SERVICE_URI=prices.mainnet.teritori.com:443

IMG_PROXY_URL=https://imgproxy.tools.teritori.com/insecure/
21 changes: 1 addition & 20 deletions packages/components/OptimizedImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,29 +106,10 @@ const transformURI = (
uri = "ipfs://" + uri;
} catch {}

const knownScheme = ["https://", "http://", "ipfs://"].find((scheme) =>
uri?.startsWith(scheme),
);
if (!knownScheme) {
return uri;
}

if (uri?.startsWith("ipfs://")) {
// XXX: allow passing a dev token
return `https://teritori.mypinata.cloud/ipfs/${uri.substring("ipfs://".length)}?img-width=${Math.round(width)}&img-height=${Math.round(height)}&img-fit=contain`;
}

const params = resolveParams(width, height);

return `${process.env.EXPO_PUBLIC_IMG_PROXY_URL}${params}/plain/${encodeURIComponent(
uri,
)}`;
};

const resolveParams = (width: number, height: number) => {
const params: string[] = [];
params.push(`width:${Math.round(width)}`);
params.push(`height:${Math.round(height)}`);

return params.join("/");
return uri;
};
Loading