mirror of
https://github.com/wukko/cobalt.git
synced 2025-02-08 19:56:34 +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;
|
showRightScroll = currentPos < maxPos && currentPos !== maxPos;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{#each Object.entries(PRESET_DONATION_AMOUNTS) as [amount, component]}
|
{#each Object.entries(PRESET_DONATION_AMOUNTS) as [amount, icon]}
|
||||||
<DonationOption
|
<DonationOption
|
||||||
price={+amount}
|
price={+amount}
|
||||||
desc={$t(`donate.card.option.${amount}`)}
|
desc={$t(`donate.card.option.${amount}`)}
|
||||||
href={donationMethods[processor](+amount * 100)}
|
href={donationMethods[processor](+amount * 100)}
|
||||||
>
|
{icon}
|
||||||
<svelte:component this={component} />
|
/>
|
||||||
</DonationOption>
|
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
export let price: number;
|
export let price: number;
|
||||||
export let desc: string;
|
export let desc: string;
|
||||||
export let href: string;
|
export let href: string;
|
||||||
|
export let icon: ConstructorOfATypedSvelteComponent;
|
||||||
|
|
||||||
const USD = new Intl.NumberFormat("en-US", {
|
const USD = new Intl.NumberFormat("en-US", {
|
||||||
style: "currency",
|
style: "currency",
|
||||||
|
@ -17,7 +18,7 @@
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div class="donate-card-title">
|
<div class="donate-card-title">
|
||||||
<slot></slot>
|
<svelte:component this={icon} />
|
||||||
{USD.format(price)}
|
{USD.format(price)}
|
||||||
</div>
|
</div>
|
||||||
<div class="donate-card-subtitle">{desc}</div>
|
<div class="donate-card-subtitle">{desc}</div>
|
||||||
|
|
Loading…
Reference in a new issue