diff --git a/web/src/components/donate/DonateOptionsCard.svelte b/web/src/components/donate/DonateOptionsCard.svelte index ed67310b..e3842f90 100644 --- a/web/src/components/donate/DonateOptionsCard.svelte +++ b/web/src/components/donate/DonateOptionsCard.svelte @@ -20,6 +20,7 @@ import IconPhoto from "@tabler/icons-svelte/IconPhoto.svelte"; import IconWorldWww from "@tabler/icons-svelte/IconWorldWww.svelte"; import IconBath from "@tabler/icons-svelte/IconBath.svelte"; + import OuterLink from "$components/misc/OuterLink.svelte"; let customInput: HTMLInputElement; let customInputValue: number | null; @@ -44,32 +45,28 @@ type Processor = "stripe" | "liberapay"; let processor: Processor = "stripe"; - const donationMethods: Record void> = { + const donationMethods: Record string> = { stripe: (amount: number) => { const url = new URL(donate.stripe); url.searchParams.set("__prefilled_amount", amount.toString()); - window.open(url, "_blank"); + return url.toString(); }, liberapay: (amount: number) => { const url = new URL(donate.liberapay); url.searchParams.set("currency", "USD"); url.searchParams.set("period", "monthly"); url.searchParams.set("amount", (amount / 100).toString()); - window.open(url, "_blank"); + return url.toString(); }, }; - const send = (amount: number) => { - return donationMethods[processor](amount); - }; - const sendCustom = () => { if (!customInput.reportValidity()) { return; } const amount = Number(customInputValue) * 100; - send(amount); + return donationMethods[processor](amount); }; @@ -110,9 +107,11 @@
{#each Object.entries(PRESET_DONATION_AMOUNTS) as [ amount, component ]} - - - + + + + + {/each}
@@ -313,4 +312,8 @@ display: block; } } + + #donation-options > :global(a) { + text-decoration: none; + } diff --git a/web/src/components/donate/DonationOption.svelte b/web/src/components/donate/DonationOption.svelte index 61599558..91bcee7b 100644 --- a/web/src/components/donate/DonationOption.svelte +++ b/web/src/components/donate/DonationOption.svelte @@ -1,9 +1,7 @@ -