From 6c7b28b035272a8e66cc19a3c3a12901ec52cebb Mon Sep 17 00:00:00 2001 From: Kieran Hall Date: Sat, 31 Aug 2024 18:37:32 +0200 Subject: [PATCH] web-wallet: Add UsageIndicator to Balance component Resolves #2234 --- .../lib/components/Allocate/Allocate.svelte | 2 +- .../src/lib/components/Balance/Balance.svelte | 24 +- .../UsageIndicator/UsageIndicator.svelte | 5 +- .../lib/components/__tests__/Balance.spec.js | 18 +- .../__snapshots__/Balance.spec.js.snap | 270 ++++++++-------- .../src/routes/(app)/dashboard/+layout.svelte | 3 + .../__snapshots__/layout.spec.js.snap | 296 ++++++++++++------ .../__tests__/__snapshots__/page.spec.js.snap | 20 +- .../components-showcase/Balances.svelte | 14 +- .../src/style/dusk-components/balance.css | 10 +- web-wallet/src/style/dusk/language.css | 1 + 11 files changed, 417 insertions(+), 246 deletions(-) diff --git a/web-wallet/src/lib/components/Allocate/Allocate.svelte b/web-wallet/src/lib/components/Allocate/Allocate.svelte index e7714c5d07..53af14e372 100644 --- a/web-wallet/src/lib/components/Allocate/Allocate.svelte +++ b/web-wallet/src/lib/components/Allocate/Allocate.svelte @@ -314,7 +314,7 @@ flex-direction: column; justify-content: center; align-items: flex-start; - gap: var(--gap-medium); + gap: var(--medium-gap); align-self: stretch; border-radius: var(--fieldset-border-radius); diff --git a/web-wallet/src/lib/components/Balance/Balance.svelte b/web-wallet/src/lib/components/Balance/Balance.svelte index bfc78777dc..366dcb68cc 100644 --- a/web-wallet/src/lib/components/Balance/Balance.svelte +++ b/web-wallet/src/lib/components/Balance/Balance.svelte @@ -1,8 +1,7 @@
@@ -8,6 +11,15 @@ fiatPrice={10} locale="en" tokenCurrency="DUSK" - tokens={2000000} + tokens={balance} + /> + +
diff --git a/web-wallet/src/style/dusk-components/balance.css b/web-wallet/src/style/dusk-components/balance.css index 68a8c5ae19..80f0081f4b 100644 --- a/web-wallet/src/style/dusk-components/balance.css +++ b/web-wallet/src/style/dusk-components/balance.css @@ -1,6 +1,7 @@ .dusk-balance { display: flex; flex-direction: column; + text-align: center; } .dusk-balance__header > h2 { @@ -13,6 +14,7 @@ display: flex; align-items: center; gap: 0.5em; + justify-content: center; } .dusk-balance__dusk > strong { @@ -28,14 +30,14 @@ line-height: 150%; letter-spacing: -0.01em; visibility: hidden; + color: var(--muted-color); } .dusk-balance__fiat--visible > strong { visibility: unset; } -.dusk-icon.dusk-balance__icon { - width: 1.3125em; - height: 1.3125em; - flex-shrink: 0; +.dusk-balance__usage { + padding: 0.62em 0.75em; + margin-top: 0.62em; } diff --git a/web-wallet/src/style/dusk/language.css b/web-wallet/src/style/dusk/language.css index 74aff3f4d6..821f6e5fd7 100644 --- a/web-wallet/src/style/dusk/language.css +++ b/web-wallet/src/style/dusk/language.css @@ -15,6 +15,7 @@ --success-color: var(--success-500); --success-color-variant-dark: var(--success-700); --warning-color: var(--warning); + --muted-color: var(--granite-grey); --on-background-color: var(--smokey-black); --on-primary-color: var(--light-grey);