From 9ab49a7e270bea566a49e5a1482b4a28efaf7215 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Mon, 29 Jan 2024 14:57:26 +0000 Subject: [PATCH] use primal cdn for images --- src/routes/Search.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/routes/Search.tsx b/src/routes/Search.tsx index a95c1cb6..ec6cacf5 100644 --- a/src/routes/Search.tsx +++ b/src/routes/Search.tsx @@ -465,6 +465,16 @@ function ContactButton(props: { onClick: () => void; }) { const i18n = useI18n(); + + const primalUrl = createMemo(() => { + const originalUrl = props.contact.image_url; + if (!originalUrl) return undefined; + + return `https://primal.b-cdn.net/media-cache?s=s&a=1&u=${encodeURIComponent( + originalUrl + )}`; + }); + return (