diff --git a/src/lib/layout/unauthenticated.svelte b/src/lib/layout/unauthenticated.svelte index 9e457cd27..001554954 100644 --- a/src/lib/layout/unauthenticated.svelte +++ b/src/lib/layout/unauthenticated.svelte @@ -8,7 +8,7 @@ import type { Coupon } from '$lib/sdk/billing'; import { app } from '$lib/stores/app'; import type { Campaign } from '$lib/stores/campaigns'; - import { getApiEndpoint } from '$lib/stores/sdk'; + import { getCampaignImageUrl } from '$routes/(public)/card/helpers'; export const imgLight = LoginLight; export const imgDark = LoginDark; @@ -38,12 +38,6 @@ return campaign.description; } } - - function getImage(image: string) { - const endpoint = getApiEndpoint(); - const url = new URL(image, endpoint); - return url.toString(); - }
@@ -86,7 +80,7 @@
promo @@ -151,7 +145,7 @@
{#if currentReview?.image} {:else} @@ -170,7 +164,7 @@

provided to you by

{coupon?.campaign
{/if} diff --git a/src/routes/(console)/apply-credit/+page.svelte b/src/routes/(console)/apply-credit/+page.svelte index aa347f68f..1a786e47b 100644 --- a/src/routes/(console)/apply-credit/+page.svelte +++ b/src/routes/(console)/apply-credit/+page.svelte @@ -26,6 +26,7 @@ import { ID } from '@appwrite.io/console'; import { onMount } from 'svelte'; import { writable } from 'svelte/store'; + import { getCampaignImageUrl } from '$routes/(public)/card/helpers'; export let data; @@ -281,7 +282,7 @@
promo

diff --git a/src/routes/(public)/card/helpers.ts b/src/routes/(public)/card/helpers.ts index e59c305f9..7b3e292f9 100644 --- a/src/routes/(public)/card/helpers.ts +++ b/src/routes/(public)/card/helpers.ts @@ -1,3 +1,5 @@ +import { getApiEndpoint } from '$lib/stores/sdk'; + export function getCardImgUrls(userId: string, endpoint: string) { const resolved = endpoint; @@ -7,3 +9,9 @@ export function getCardImgUrls(userId: string, endpoint: string) { return { frontImg, backImg, ogImg }; } + +export function getCampaignImageUrl(image: string) { + const endpoint = getApiEndpoint(); + const url = new URL(image, endpoint); + return url.toString(); +}