From 0773802befe587d77dc24e8e4d0d0db28e0d87b0 Mon Sep 17 00:00:00 2001 From: David de Kloet <122978264+dskloetd@users.noreply.github.com> Date: Thu, 19 Dec 2024 12:50:46 +0100 Subject: [PATCH] Show stake in USD on SNS neuron details (#6044) # Motivation Want to show the stake in USD on the neuron details page similar to how we show the account balance on the wallet page. https://github.com/dfinity/nns-dapp/pull/6039 did it for NNS neurons. This PR does it for SNS neurons. And a third PR will make sure token prices are loaded when the neuron page is deep linked. # Changes 1. Use `HeadingSubtitleWithUsdValue` in `SnsNeuronPageHeading`. Some of the slot content is temporarily duplicate between with and without feature flag. 2. Pass the `ledgerCanisterId` from `SnsNeuronDetail` to `SnsNeuronPageHeading` as it's needed to find the token price. # Tests 1. Unit tests added. 2. Manually at https://qsgjb-riaaa-aaaaa-aaaga-cai.dskloet-ingress.devenv.dfinity.network/neuron/?u=bd3sg-teaaa-aaaaa-qaaba-cai&neuron=d09433a0369029e7b1114df00138c0cf5bbbef6d0d150c0aa6dd0fd67a75f985 # Todos - [ ] Add entry to changelog (if necessary). not yet --- .../SnsNeuronPageHeading.svelte | 32 ++++++++++--- frontend/src/lib/pages/SnsNeuronDetail.svelte | 4 ++ .../SnsNeuronPageHeading.spec.ts | 45 +++++++++++++++++++ .../SnsNeuronPageHeading.page-object.ts | 13 ++++++ 4 files changed, 87 insertions(+), 7 deletions(-) diff --git a/frontend/src/lib/components/sns-neuron-detail/SnsNeuronPageHeading.svelte b/frontend/src/lib/components/sns-neuron-detail/SnsNeuronPageHeading.svelte index 02caf1a3ed2..1c19cf74185 100644 --- a/frontend/src/lib/components/sns-neuron-detail/SnsNeuronPageHeading.svelte +++ b/frontend/src/lib/components/sns-neuron-detail/SnsNeuronPageHeading.svelte @@ -1,6 +1,7 @@