aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Balance.svelte
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-01 20:04:13 -0800
committerAdam Soltys <[email protected]>2023-12-01 20:04:13 -0800
commit216a600224fde22ce76b367557a02094ec693886 (patch)
treed1189bbaa39db204633523132a7d4767b952717d /src/components/Balance.svelte
parent7d9bc1f54dfd04172e8d6d43ebc2efd6f407e833 (diff)
downloadcoinos-ui-216a600224fde22ce76b367557a02094ec693886.tar.gz
coinos-ui-216a600224fde22ce76b367557a02094ec693886.zip
prettier
Diffstat (limited to 'src/components/Balance.svelte')
-rw-r--r--src/components/Balance.svelte48
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">&mdash;</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">&mdash;</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>