Skip to content

Commit fbce4ce

Browse files
author
Teo
authored
Issue#13 add link to the reddit article regarding total supply misscalculation and correction (#753)
* fix brace display * Add read more link reddit clarification * Improve data type to JSX or string * fix(DFIStatisticsDisplay): set desc to undefined when supply missing; render JSX fragment when present
1 parent e1ada14 commit fbce4ce

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

src/components/commons/StatisticPanel.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React, { ReactNode } from "react";
12
import { useUnitSuffix } from "@hooks/useUnitSuffix";
23
import CountUp from "react-countup";
34
import classNames from "classnames";
@@ -6,7 +7,7 @@ import { useRouter } from "next/router";
67
interface StatisticPanelItemProps {
78
title: string;
89
stats?: number;
9-
desc?: string;
10+
desc?: ReactNode; // JSX or string
1011
prefix?: string;
1112
descStyle?: string;
1213
displayId?: string;
@@ -68,7 +69,7 @@ function StatisticsPanelItem({
6869
}: {
6970
title: string;
7071
stats?: number;
71-
desc?: string;
72+
desc?: ReactNode;
7273
prefix?: string;
7374
descStyle?: string;
7475
isTabletHorizontal?: boolean;

src/pages/explore/dfi/_components/DFIStatisticsDisplay.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function DFIStatisticsDisplay() {
3333
stats: supply?.circulating,
3434
desc:
3535
supply === undefined
36-
? supply
36+
? undefined
3737
: `${calculatePercentage(
3838
supply?.circulating,
3939
supply?.total,
@@ -44,9 +44,21 @@ export function DFIStatisticsDisplay() {
4444
title: t("statisticsDisplay.dfiMinted.title"),
4545
stats: supply?.total,
4646
desc:
47-
supply === undefined
48-
? supply
49-
: `out of ${dfiMintedValue}${dfiMintedSuffix}} fixed supply`,
47+
supply === undefined ? undefined : (
48+
<>
49+
Out of {dfiMintedValue}
50+
{dfiMintedSuffix} fixed supply. (
51+
<a
52+
href="https://www.reddit.com/r/defiblockchain/comments/1ka6cux/clarification_on_dfi_max_supply_overshooting_12b/"
53+
target="_blank"
54+
rel="noopener noreferrer"
55+
className="text-blue-500 underline"
56+
>
57+
read more...
58+
</a>
59+
)
60+
</>
61+
),
5062
testID: "dfi-minted",
5163
},
5264
];

0 commit comments

Comments
 (0)