Skip to content

Commit

Permalink
feat: Hide shimmer token claiming related graphs in "Statistics" on n…
Browse files Browse the repository at this point in the history
…on-shimmer networks
  • Loading branch information
msarcev committed Feb 15, 2024
1 parent 7cbfb6d commit 5d10382
Showing 1 changed file with 31 additions and 25 deletions.
56 changes: 31 additions & 25 deletions client/src/app/components/stardust/statistics/InfluxChartsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import { idGenerator } from "~helpers/stardust/statisticsUtils";
import { formatAmount } from "~helpers/stardust/valueFormatHelper";
import NetworkContext from "../../../context/NetworkContext";
import { COMMAS_REGEX } from "../../../routes/stardust/landing/ShimmerClaimedUtils";
import { SHIMMER } from "~/models/config/networkType";
import Modal from "../../Modal";

export const InfluxChartsTab: React.FC = () => {
const { tokenInfo } = useContext(NetworkContext);
const { name: networkName, tokenInfo } = useContext(NetworkContext);

const [
transactions,
dailyBlocks,
Expand All @@ -38,6 +40,8 @@ export const InfluxChartsTab: React.FC = () => {

const ids = idGenerator();

const isShimmerNetwork = networkName === SHIMMER;

return (
<div className="statistics-page--charts">
<div className="section">
Expand Down Expand Up @@ -185,30 +189,32 @@ export const InfluxChartsTab: React.FC = () => {
/>
</div>
</div>
<div className="section">
<div className="section--header">
<h2>Genesis</h2>
<Modal icon="info" data={graphMessages.genesis} />
</div>
<div className="row statistics-row">
<LineChart
chartId={ids.next().value}
title="Total Unclaimed Tokens"
info={graphMessages.totalUnclaimedTokens}
label="Unclaimed Tokens"
color="#00F5DD"
data={unclaimedTokens}
/>
<LineChart
chartId={ids.next().value}
title="Total Unclaimed Outputs"
info={graphMessages.totalUnclaimedOutputs}
label="Outputs"
color="#00F5DD"
data={unclaimedGenesisOutputs}
/>
</div>
</div>
{isShimmerNetwork && (
<div className="section">
<div className="section--header">
<h2>Genesis</h2>
<Modal icon="info" data={graphMessages.genesis} />
</div>
<div className="row statistics-row">
<LineChart
chartId={ids.next().value}
title="Total Unclaimed Tokens"
info={graphMessages.totalUnclaimedTokens}
label="Unclaimed Tokens"
color="#00F5DD"
data={unclaimedTokens}
/>
<LineChart
chartId={ids.next().value}
title="Total Unclaimed Outputs"
info={graphMessages.totalUnclaimedOutputs}
label="Outputs"
color="#00F5DD"
data={unclaimedGenesisOutputs}
/>
</div>
</div>
)}
<div className="section">
<div className="section--header">
<h2>Data Storage</h2>
Expand Down

0 comments on commit 5d10382

Please sign in to comment.