Skip to content

Commit

Permalink
update hardcoded option title
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoYhun committed Oct 10, 2023
1 parent fba406e commit f73cec7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/pages/KyberDAO/Vote/ProposalItem/OptionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<number, Record<number, string>> = {
19: { 1: 'Base: KNC-USDC & KNC-ETH' },
}

export default function OptionButton({
checked,
Expand All @@ -112,6 +117,7 @@ export default function OptionButton({
onOptionClick,
isCheckBox,
disabled,
proposalId,
id,
}: {
checked?: boolean
Expand All @@ -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 (
<Wrapper onClick={() => !disabled && onOptionClick?.()} disabled={disabled} type={type}>
<div style={{ zIndex: 4, width: '100%' }}>
Expand All @@ -147,7 +155,7 @@ export default function OptionButton({
<RadioButtonUnchecked />
)}{' '}
</CheckButtonWrapper>
<Text>{`${id}. ${title}`}</Text>
<Text>{`${id}. ${hardCodedTitle || title}`}</Text>
</RowFit>
</MouseoverTooltip>
<Text fontSize="12px" padding={'0 4px'}>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/KyberDAO/Vote/ProposalItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -324,6 +324,7 @@ function ProposalItem({
: 'Finished'
}
isCheckBox={proposal.proposal_type === ProposalType.GenericProposal && !isForcedBinaryOption}
proposalId={proposal.proposal_id}
id={index}
/>
)
Expand Down

0 comments on commit f73cec7

Please sign in to comment.