Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Video-Downloader/web/src/components/donate/DonationOption.svelte
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
44 lines (39 sloc)
964 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
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", | |
currency: "USD", | |
minimumFractionDigits: 0, | |
}); | |
</script> | |
<button | |
class="donation-option" | |
on:click={() => { | |
window.open(href, "_blank"); | |
}} | |
> | |
<div class="donate-card-title"> | |
<svelte:component this={icon} /> | |
{USD.format(price)} | |
</div> | |
<div class="donate-card-subtitle">{desc}</div> | |
</button> | |
<style> | |
.donation-option .donate-card-subtitle { | |
white-space: nowrap; | |
} | |
.donation-option :global(svg) { | |
width: 20px; | |
height: 20px; | |
stroke-width: 1.8px; | |
} | |
@media screen and (max-width: 550px) { | |
.donation-option :global(svg) { | |
width: 18px; | |
height: 18px; | |
} | |
} | |
</style> |