From 4689c41c5cdb420f254a862f7f7b72ce00c26aa9 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Thu, 15 Feb 2024 15:54:53 +0100 Subject: [PATCH] fix: round type badge --- packages/common/src/index.ts | 10 ++++++++++ .../round-manager/src/features/common/Utils.ts | 14 ++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts index f8d7ccae62..dc91d6891e 100644 --- a/packages/common/src/index.ts +++ b/packages/common/src/index.ts @@ -317,6 +317,16 @@ export type RoundPayoutType = | "DIRECT" | "allov1.Direct" | "allov1.QF"; + +export const ROUND_PAYOUT_STRATEGY_TITLES: Record = { + MERKLE: "Quadratic Funding", + DIRECT: "Direct Grants", + "allov1.QF": "Quadratic Funding", + "allov1.Direct": "Direct Grants", + "allov2.DonationVotingMerkleDistributionDirectTransferStrategy": + "Quadratic Funding", +}; + export type RoundVisibilityType = "public" | "private"; export type { Allo, AlloError, AlloOperation } from "./allo/allo"; diff --git a/packages/round-manager/src/features/common/Utils.ts b/packages/round-manager/src/features/common/Utils.ts index bd6fffd1d2..e76953123e 100644 --- a/packages/round-manager/src/features/common/Utils.ts +++ b/packages/round-manager/src/features/common/Utils.ts @@ -1,4 +1,4 @@ -import { ROUND_PAYOUT_DIRECT, ROUND_PAYOUT_MERKLE } from "common"; +import { ROUND_PAYOUT_STRATEGY_TITLES } from "common"; export const verticalTabStyles = (selected: boolean) => selected @@ -11,15 +11,5 @@ export const horizontalTabStyles = (selected: boolean) => : "border-transparent text-grey-400 hover:text-gray-700 hover:border-gray-300 whitespace-nowrap py-4 px-1 font-medium text-sm"; export const getPayoutRoundDescription = (key: string) => { - switch (key) { - case ROUND_PAYOUT_MERKLE: - return "Quadratic Funding"; - break; - case ROUND_PAYOUT_DIRECT: - return "Direct Grant"; - break; - default: - return key; - break; - } + return ROUND_PAYOUT_STRATEGY_TITLES[key] ?? key; };