From 78c201d8d9d2f3ec07f6ea36201977846e29ccd9 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 4 Feb 2026 12:42:42 -0800 Subject: homepage design and currency toggling --- src/components/Amount.svelte | 59 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 29 deletions(-) (limited to 'src/components/Amount.svelte') diff --git a/src/components/Amount.svelte b/src/components/Amount.svelte index e5aeabde..7dea7cf1 100644 --- a/src/components/Amount.svelte +++ b/src/components/Amount.svelte @@ -9,56 +9,57 @@ rate, currency, locked = false, - showFiat = true, } = $props(); const icon = $derived(locked ? "ph:lock-fill" : "ph:lightning-fill"); + const canShowFiat = $derived($fiat && rate && currency); + + const toggleFiat = (e) => { + e.preventDefault(); + e.stopPropagation(); + $fiat = !$fiat; + }; + {#if typeof amount !== "undefined"}

{#if tip}
+
- -
{s(tip, locale)}
+
+ {#if canShowFiat} + {f(toFiat(tip, rate), currency, locale)} + {:else} + {s(tip, locale)} + {/if} +
{/if}

- {#if showFiat} -

- -

- {/if}
{/if} -- cgit v1.2.3