From 7c15e901a488a84afab5cf142aa12d15d2a1bf48 Mon Sep 17 00:00:00 2001 From: Pedro Rezende Date: Thu, 21 Nov 2024 15:18:16 -0300 Subject: [PATCH] feat: conditionally highlight each phase on the roadmap (#1290) --- .../src/App/Sidebars/MainnetRoadmap.tsx | 82 ++++++++----------- .../src/App/Sidebars/RoadmapPhase.tsx | 34 ++++++++ 2 files changed, 69 insertions(+), 47 deletions(-) create mode 100644 apps/namadillo/src/App/Sidebars/RoadmapPhase.tsx diff --git a/apps/namadillo/src/App/Sidebars/MainnetRoadmap.tsx b/apps/namadillo/src/App/Sidebars/MainnetRoadmap.tsx index c06dd6854..b4212f151 100644 --- a/apps/namadillo/src/App/Sidebars/MainnetRoadmap.tsx +++ b/apps/namadillo/src/App/Sidebars/MainnetRoadmap.tsx @@ -2,35 +2,19 @@ import { ActionButton, Image, Panel } from "@namada/components"; import { applicationFeaturesAtom } from "atoms/settings"; import clsx from "clsx"; import { useAtomValue } from "jotai"; -import { FaCircleCheck } from "react-icons/fa6"; +import { RoadmapPhase } from "./RoadmapPhase"; const MainnetRoadmap = (): JSX.Element => { - const { claimRewardsEnabled } = useAtomValue(applicationFeaturesAtom); + const { + claimRewardsEnabled, + shieldingRewardsEnabled, + namTransfersEnabled, + maspEnabled, + ibcTransfersEnabled, + } = useAtomValue(applicationFeaturesAtom); - const renderPhase = ( - phaseNumber: string, - name: React.ReactNode, - className: string, - done = false - ): JSX.Element => { - return ( -
  • - - Phase {phaseNumber} - {name} - {done && ( - - - - )} -
  • - ); - }; + const getClassName = (enabled: boolean): string => + clsx(!enabled && "opacity-25"); return ( @@ -40,33 +24,37 @@ const MainnetRoadmap = (): JSX.Element => { Namada Mainnet Roadmap
      - {renderPhase( - "1", + <> Proof of Stake
      Governance - , - "opacity-100", - true - )} - {renderPhase( - "2", - <>Staking Rewards, - claimRewardsEnabled ? "opacity-100" : "opacity-25", - claimRewardsEnabled - )} - {renderPhase( - "3", + +
      + + + Staking Rewards + + + <> - IBC Transfers + + IBC Transfers +
      - MASP Enabled - , - "opacity-25" - )} - {renderPhase("4", "Shielding Rewards", "opacity-25")} - {renderPhase("5", "NAM Transfers enabled", "opacity-25")} + MASP Enabled + +
      + + + Shielding Rewards + + + + + NAM Transfers enabled + +
    { + const disabledClassName = !active && "opacity-25"; + return ( +
  • + + + Phase {phase} + +
    {children}
    + {active && ( + + + + )} +
  • + ); +};