diff --git a/functions/api/image/nfts/asset/[[index]].tsx b/functions/api/image/nfts/asset/[[index]].tsx index 84197e9237..f666cf9729 100644 --- a/functions/api/image/nfts/asset/[[index]].tsx +++ b/functions/api/image/nfts/asset/[[index]].tsx @@ -25,7 +25,7 @@ export const onRequest: PagesFunction = async ({ params, request }) => { return new Response('Asset not found.', { status: 404 }) } - const fontData = await getFont() + const fontData = await getFont(origin) return new ImageResponse( ( diff --git a/functions/api/image/nfts/collection/[index].tsx b/functions/api/image/nfts/collection/[index].tsx index 21ab41be5c..b2672dd50e 100644 --- a/functions/api/image/nfts/collection/[index].tsx +++ b/functions/api/image/nfts/collection/[index].tsx @@ -26,7 +26,7 @@ export const onRequest: PagesFunction = async ({ params, request }) => { return new Response('Collection not found.', { status: 404 }) } - const [fontData, palette] = await Promise.all([getFont(), getColor(data.ogImage)]) + const [fontData, palette] = await Promise.all([getFont(origin), getColor(data.ogImage)]) // Split name into words to wrap them since satori does not support inline text wrapping const words = data.name.split(' ') diff --git a/functions/api/image/tokens/[[index]].tsx b/functions/api/image/tokens/[[index]].tsx index 77010bbdd8..69a28591ab 100644 --- a/functions/api/image/tokens/[[index]].tsx +++ b/functions/api/image/tokens/[[index]].tsx @@ -28,9 +28,9 @@ export const onRequest: PagesFunction = async ({ params, request }) => { return new Response('Token not found.', { status: 404 }) } - const [fontData, palette] = await Promise.all([getFont(), getColor(data.ogImage, true)]) + const [fontData, palette] = await Promise.all([getFont(origin), getColor(data.ogImage, true)]) - const networkLogo = getNetworkLogoUrl(networkName.toUpperCase()) + const networkLogo = getNetworkLogoUrl(networkName.toUpperCase(), origin) // Capitalize name such that each word starts with a capital letter let words = data.name.split(' ') diff --git a/functions/utils/getFont.ts b/functions/utils/getFont.ts index 0f1a8dcd0c..18c8823d94 100644 --- a/functions/utils/getFont.ts +++ b/functions/utils/getFont.ts @@ -1,6 +1,5 @@ -const FONT_URL = 'https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fAZFhjQ.ttf' - -export default async function getFont() { - const font = await fetch(FONT_URL) +export default async function getFont(origin: string) { + const url = origin + '/fonts/Inter-normal.var.ttf' + const font = await fetch(url) return font.arrayBuffer() } diff --git a/functions/utils/getNetworkLogoURL.ts b/functions/utils/getNetworkLogoURL.ts index 5ed0de7b2f..8581267e10 100644 --- a/functions/utils/getNetworkLogoURL.ts +++ b/functions/utils/getNetworkLogoURL.ts @@ -1,15 +1,15 @@ import { Chain } from '../../src/graphql/data/__generated__/types-and-hooks' -export default function getNetworkLogoUrl(network: string) { +export default function getNetworkLogoUrl(network: string, origin: string) { switch (network) { case Chain.Polygon: - return 'https://assets.coingecko.com/coins/images/4713/small/matic-token-icon.png?1624446912' + return origin + '/images/logos/Polygon_Logo.png' case Chain.Arbitrum: - return 'https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/arbitrum/assets/0x912CE59144191C1204E64559FE8253a0e49E6548/logo.png' + return origin + '/images/logos/Arbitrum_Logo.png' case Chain.Optimism: - return 'https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/optimism/assets/0x4200000000000000000000000000000000000042/logo.png' + return origin + '/images/logos/Optimism_Logo.png' case Chain.Celo: - return 'https://assets.coingecko.com/coins/images/11090/small/InjXBNx9_400x400.jpg?1674707499' + return origin + '/images/logos/Celo_Logo.png' default: return '' } diff --git a/public/fonts/Inter-normal.var.ttf b/public/fonts/Inter-normal.var.ttf new file mode 100644 index 0000000000..600b384ad8 Binary files /dev/null and b/public/fonts/Inter-normal.var.ttf differ diff --git a/public/images/logos/Arbitrum_Logo.png b/public/images/logos/Arbitrum_Logo.png new file mode 100644 index 0000000000..eebe97c4b3 Binary files /dev/null and b/public/images/logos/Arbitrum_Logo.png differ diff --git a/public/images/logos/Celo_Logo.png b/public/images/logos/Celo_Logo.png new file mode 100644 index 0000000000..8639b117bb Binary files /dev/null and b/public/images/logos/Celo_Logo.png differ diff --git a/public/images/logos/Optimism_Logo.png b/public/images/logos/Optimism_Logo.png new file mode 100644 index 0000000000..fe22521a67 Binary files /dev/null and b/public/images/logos/Optimism_Logo.png differ diff --git a/public/images/logos/Polygon_Logo.png b/public/images/logos/Polygon_Logo.png new file mode 100644 index 0000000000..4b86751eb2 Binary files /dev/null and b/public/images/logos/Polygon_Logo.png differ