mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-22 10:46:19 +01:00
web/DonationOption: use icon prop instead of slot
This commit is contained in:
parent
540bbbdad7
commit
a0616841bf
2 changed files with 5 additions and 5 deletions
|
@ -176,14 +176,13 @@
|
|||
showRightScroll = currentPos < maxPos && currentPos !== maxPos;
|
||||
}}
|
||||
>
|
||||
{#each Object.entries(PRESET_DONATION_AMOUNTS) as [amount, component]}
|
||||
{#each Object.entries(PRESET_DONATION_AMOUNTS) as [amount, icon]}
|
||||
<DonationOption
|
||||
price={+amount}
|
||||
desc={$t(`donate.card.option.${amount}`)}
|
||||
href={donationMethods[processor](+amount * 100)}
|
||||
>
|
||||
<svelte:component this={component} />
|
||||
</DonationOption>
|
||||
{icon}
|
||||
/>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
export let price: number;
|
||||
export let desc: string;
|
||||
export let href: string;
|
||||
export let icon: ConstructorOfATypedSvelteComponent;
|
||||
|
||||
const USD = new Intl.NumberFormat("en-US", {
|
||||
style: "currency",
|
||||
|
@ -17,7 +18,7 @@
|
|||
}}
|
||||
>
|
||||
<div class="donate-card-title">
|
||||
<slot></slot>
|
||||
<svelte:component this={icon} />
|
||||
{USD.format(price)}
|
||||
</div>
|
||||
<div class="donate-card-subtitle">{desc}</div>
|
||||
|
|
Loading…
Reference in a new issue