Skip to content

Commit

Permalink
use primal cdn for images
Browse files Browse the repository at this point in the history
  • Loading branch information
futurepaul committed Jan 29, 2024
1 parent 4d3ecdc commit 9ab49a7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/routes/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<button
onClick={() => props.onClick()}
Expand All @@ -480,7 +490,7 @@ function ContactButton(props: {
>
<LabelCircle
name={props.contact.name}
image_url={props.contact.image_url}
image_url={primalUrl()}
contact
label={false}
/>
Expand Down

0 comments on commit 9ab49a7

Please sign in to comment.