diff options
Diffstat (limited to 'src/components/Balance.svelte')
| -rw-r--r-- | src/components/Balance.svelte | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/components/Balance.svelte b/src/components/Balance.svelte index 0e4f2ec2..92714f98 100644 --- a/src/components/Balance.svelte +++ b/src/components/Balance.svelte @@ -1,34 +1,34 @@ <script> - import { Pin } from '$comp'; - import { f, s, sat, sats } from '$lib/utils'; - import { animatedRate, pin } from '$lib/store'; - import { t } from '$lib/translations'; + import { Pin } from "$comp"; + import { f, s, sat, sats } from "$lib/utils"; + import { animatedRate, pin } from "$lib/store"; + import { t } from "$lib/translations"; - let show; - export let user; + let show; + export let user; </script> {#if show && user.haspin && $pin?.length !== 6} - <Pin cancel={() => (show = false)} /> + <Pin cancel={() => (show = false)} /> {/if} <div class="space-y-2"> - {#if user.haspin && !$pin} - <button - class="text-sm md:text-lg rounded-full border py-2 px-4 hover:opacity-80 min-w-[72px] bg-black text-white" - on:click={() => (show = true)}>{$t('user.showBalance')}</button - > - {:else} - <div class="text-5xl font-bold tabular-nums"> - {#if isNaN($animatedRate)} - <div class="text-gray-200">—</div> - {:else} - {f((user.balance * $animatedRate) / sats, user.currency)} - {/if} - </div> + {#if user.haspin && !$pin} + <button + class="text-sm md:text-lg rounded-full border py-2 px-4 hover:opacity-80 min-w-[72px] bg-black text-white" + on:click={() => (show = true)}>{$t("user.showBalance")}</button + > + {:else} + <div class="text-5xl font-bold tabular-nums"> + {#if isNaN($animatedRate)} + <div class="text-gray-200">—</div> + {:else} + {f((user.balance * $animatedRate) / sats, user.currency)} + {/if} + </div> - <div class="text-secondary text-2xl"> - ⚡️{s(user.balance)} - </div> - {/if} + <div class="text-secondary text-2xl"> + ⚡️{s(user.balance)} + </div> + {/if} </div> |
