From f73cec79d07e27ca0b19438aeb95423756f28204 Mon Sep 17 00:00:00 2001 From: XiaoYhun Date: Tue, 10 Oct 2023 15:30:22 +0700 Subject: [PATCH] update hardcoded option title --- src/pages/KyberDAO/Vote/ProposalItem/OptionButton.tsx | 10 +++++++++- src/pages/KyberDAO/Vote/ProposalItem/index.tsx | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/pages/KyberDAO/Vote/ProposalItem/OptionButton.tsx b/src/pages/KyberDAO/Vote/ProposalItem/OptionButton.tsx index 906c27b9e6..c282b1c31d 100644 --- a/src/pages/KyberDAO/Vote/ProposalItem/OptionButton.tsx +++ b/src/pages/KyberDAO/Vote/ProposalItem/OptionButton.tsx @@ -103,6 +103,11 @@ const CheckButtonWrapper = styled.div` display: block; } ` +// Operator miss typing option title, need to custom it in UI +// { [ProposalId]: {[OptionId]: newTitle } } +const HARDCODED_OPTION_TITLE: Record> = { + 19: { 1: 'Base: KNC-USDC & KNC-ETH' }, +} export default function OptionButton({ checked, @@ -112,6 +117,7 @@ export default function OptionButton({ onOptionClick, isCheckBox, disabled, + proposalId, id, }: { checked?: boolean @@ -121,9 +127,11 @@ export default function OptionButton({ onOptionClick?: () => void isCheckBox: boolean disabled?: boolean + proposalId: number id: number }) { const parsedPercent = parseFloat(percent.toFixed(2) || '0') + const hardCodedTitle = HARDCODED_OPTION_TITLE[proposalId][id] return ( !disabled && onOptionClick?.()} disabled={disabled} type={type}>
@@ -147,7 +155,7 @@ export default function OptionButton({ )}{' '} - {`${id}. ${title}`} + {`${id}. ${hardCodedTitle || title}`} diff --git a/src/pages/KyberDAO/Vote/ProposalItem/index.tsx b/src/pages/KyberDAO/Vote/ProposalItem/index.tsx index ec66f4b9fd..026cfb6ac1 100644 --- a/src/pages/KyberDAO/Vote/ProposalItem/index.tsx +++ b/src/pages/KyberDAO/Vote/ProposalItem/index.tsx @@ -187,7 +187,7 @@ const VoteButton = ({ ) } -const FORCED_TO_BINARY_OPTION_PROPOSALS = [14, 15, 17, 18] +const FORCED_TO_BINARY_OPTION_PROPOSALS = [14, 15, 17, 18, 19] function ProposalItem({ proposal, @@ -324,6 +324,7 @@ function ProposalItem({ : 'Finished' } isCheckBox={proposal.proposal_type === ProposalType.GenericProposal && !isForcedBinaryOption} + proposalId={proposal.proposal_id} id={index} /> )