diff --git a/explorer/CHANGELOG.md b/explorer/CHANGELOG.md index 8b1e7b8106..a5d631563f 100644 --- a/explorer/CHANGELOG.md +++ b/explorer/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add accessible name to the gas used progress bar [#2037] - Add accessible name to the nav bar button on mobile [#2036] - Implement warning for stale market data [#1892] +- Add tooltip to current and pending stake showing the exact amount [#2363] ### Changed @@ -61,6 +62,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#2159]: https://github.com/dusk-network/rusk/issues/2159 [#2220]: https://github.com/dusk-network/rusk/issues/2220 [#2348]: https://github.com/dusk-network/rusk/issues/2348 +[#2363]: https://github.com/dusk-network/rusk/issues/2363 diff --git a/explorer/src/lib/containers/__tests__/__snapshots__/StatisticsPanel.spec.js.snap b/explorer/src/lib/containers/__tests__/__snapshots__/StatisticsPanel.spec.js.snap index 6eaa951a4c..ed6f96a523 100644 --- a/explorer/src/lib/containers/__tests__/__snapshots__/StatisticsPanel.spec.js.snap +++ b/explorer/src/lib/containers/__tests__/__snapshots__/StatisticsPanel.spec.js.snap @@ -27,12 +27,14 @@ exports[`StatisticsPanel > should render the StatisticsPanel, query for the nece - - - - - - - - - +
+ + - - - + + + + +
should render the StatisticsPanel, query for the nece - - - - - - - - - +
+ + - - - + + + + +
should render the StatisticsPanel, query for the nece >
should render the StatisticsPanel, query for the nece - - - - - - - - +
+ + - - - + + + +
should render the StatisticsPanel, query for the nece
should render the StatisticsPanel, query for the nece - - - - - - - - +
+ + - - - + + + +
should render the StatisticsPanel, query for the nece - - - - - - - - +
+ + - - - + + + +
should render the StatisticsPanel, query for the nece - - - - - - - - +
+ + - - - + + + +
should render the StatisticsPanel, query for the nece - - - - - - - - +
+ + - - - + + + +
should render the StatisticsPanel, query for the nece - - - - - - - - +
+ + - - - + + + +
should render the StatisticsPanel, query for the nece - 0.368 - - - - +
+ 0.368 + + + + +
should render the StatisticsPanel, query for the nece - 168M - - - - +
+ 168.00M + + + + +
should render the StatisticsPanel, query for the nece >
should render the StatisticsPanel, query for the nece - 58.2M - - - +
+ 58.23M + + + +
should render the StatisticsPanel, query for the nece
should render the StatisticsPanel, query for the nece - 2.6M - - - +
+ 2.57M + + + +
should render the StatisticsPanel, query for the nece - 487,596 - - - +
+ 487,596 + + + +
should render the StatisticsPanel, query for the nece - 10 - - - +
+ 10 + + + +
should render the StatisticsPanel, query for the nece - 945 - - - +
+ 945 + + + +
should render the StatisticsPanel, query for the nece - 34 - - - +
+ 34 + + + +
{#each statistic as item (`${item.title}`)} -
+
- - {#if item.compact} - {formatter(item.data)} - {:else} - {valueFormatter(item.data)} +
+ + {#if item.compact} + {formatter(item.data)} + {:else} + {valueFormatter(item.data)} + {/if} + + {#if item.canBeStale} + {/if} - - {#if item.canBeStale} - - {/if} +
{item.title} { it("should format a number correctly", () => { const formatter = createCompactFormatter("en"); - expect(formatter(9e5)).toBe("900K"); - expect(formatter(1e6)).toBe("1M"); + expect(formatter(9e5)).toBe("900.00K"); + expect(formatter(1e6)).toBe("1.00M"); }); }); diff --git a/explorer/src/lib/dusk/value/createCompactFormatter.js b/explorer/src/lib/dusk/value/createCompactFormatter.js index fa8702f869..d2a2b66014 100644 --- a/explorer/src/lib/dusk/value/createCompactFormatter.js +++ b/explorer/src/lib/dusk/value/createCompactFormatter.js @@ -7,7 +7,8 @@ const createFormatter = (locale) => { const formatter = new Intl.NumberFormat(locale, { compactDisplay: "short", - maximumFractionDigits: 1, + maximumFractionDigits: 2, + minimumFractionDigits: 2, notation: "compact", }); diff --git a/explorer/src/routes/__tests__/__snapshots__/page.spec.js.snap b/explorer/src/routes/__tests__/__snapshots__/page.spec.js.snap index 2047c5d31a..ccefc5febe 100644 --- a/explorer/src/routes/__tests__/__snapshots__/page.spec.js.snap +++ b/explorer/src/routes/__tests__/__snapshots__/page.spec.js.snap @@ -30,12 +30,14 @@ exports[`home page > should render the home page, start polling for the latest c - - - - - - - - - +
+ + - - - + + + + +
should render the home page, start polling for the latest c - - - - - - - - - +
+ + - - - + + + + +
should render the home page, start polling for the latest c >
should render the home page, start polling for the latest c - - - - - - - - +
+ + - - - + + + +
should render the home page, start polling for the latest c
should render the home page, start polling for the latest c - - - - - - - - +
+ + - - - + + + +
should render the home page, start polling for the latest c - - - - - - - - +
+ + - - - + + + +
should render the home page, start polling for the latest c - - - - - - - - +
+ + - - - + + + +
should render the home page, start polling for the latest c - - - - - - - - +
+ + - - - + + + +
should render the home page, start polling for the latest c - - - - - - - - +
+ + - - - + + + +
should render the home page, start polling for the latest c - 0.368 - - - - +
+ 0.368 + + + + +
should render the home page, start polling for the latest c - 168M - - - - +
+ 168.00M + + + + +
should render the home page, start polling for the latest c >
should render the home page, start polling for the latest c - - - - - - - - +
+ + - - - + + + +
should render the home page, start polling for the latest c
should render the home page, start polling for the latest c - - - - - - - - +
+ + - - - + + + +
should render the home page, start polling for the latest c - - - - - - - - +
+ + - - - + + + +
should render the home page, start polling for the latest c - - - - - - - - +
+ + - - - + + + +
should render the home page, start polling for the latest c - - - - - - - - +
+ + - - - + + + +
should render the home page, start polling for the latest c - - - - - - - - +
+ + - - - + + + +