diff --git a/.changeset/cuddly-turtles-search.md b/.changeset/cuddly-turtles-search.md new file mode 100644 index 0000000000..463fe4effe --- /dev/null +++ b/.changeset/cuddly-turtles-search.md @@ -0,0 +1,5 @@ +--- +'web-desmos': major +--- + +update desmos proposals type display diff --git a/apps/web-desmos/src/screens/proposal_details/components/overview/index.tsx b/apps/web-desmos/src/screens/proposal_details/components/overview/index.tsx index 0e967c65f7..358a560745 100644 --- a/apps/web-desmos/src/screens/proposal_details/components/overview/index.tsx +++ b/apps/web-desmos/src/screens/proposal_details/components/overview/index.tsx @@ -26,10 +26,14 @@ const Overview: FC<{ className?: string; overview: OverviewType }> = ({ classNam const { classes, cx } = useStyles(); const { t } = useAppTranslation('proposals'); - const type = - R.pathOr('', [0, '@type'], overview.content) === '' - ? getProposalType(R.pathOr('', ['@type'], overview.content)) - : getProposalType(R.pathOr('', [0, '@type'], overview.content)); + const types: string[] = []; + if (Array.isArray(overview.content)) { + overview.content.forEach((type: string) => { + types.push(getProposalType(R.pathOr('', ['@type'], type))); + }); + } else { + types.push(getProposalType(R.pathOr('', ['@type'], overview.content))); + } const { address: proposerAddress, name: proposerName } = useProfileRecoil(overview.proposer); const { name: recipientName } = useProfileRecoil(overview?.content?.recipient); @@ -47,45 +51,49 @@ const Overview: FC<{ className?: string; overview: OverviewType }> = ({ classNam const getExtraDetails = useCallback(() => { let extraDetails = null; - if (type === 'parameterChangeProposal') { - extraDetails = ( - <> - - {t('changes')} - - - - ); - } else if (type === 'softwareUpgradeProposal') { - extraDetails = ( - <> - - {t('plan')} - - - - ); - } else if (type === 'communityPoolSpendProposal') { - extraDetails = ( - <> - - {t('content')} - - - - ); - } + types.forEach((type: string) => { + if (type === 'parameterChangeProposal') { + extraDetails = ( + <> + + {t('changes')} + + + + ); + } + if (type === 'softwareUpgradeProposal') { + extraDetails = ( + <> + + {t('plan')} + + + + ); + } + if (type === 'communityPoolSpendProposal') { + extraDetails = ( + <> + + {t('content')} + + + + ); + } + }); return extraDetails; - }, [overview.content, parsedAmountRequested, recipientMoniker, t, type]); + }, [overview.content, parsedAmountRequested, recipientMoniker, t, types]); const extra = getExtraDetails(); @@ -101,8 +109,12 @@ const Overview: FC<{ className?: string; overview: OverviewType }> = ({ classNam {t('type')} - - {t(type)} + + {types.map((type) => ( + + {t(type)} + + ))} {t('proposer')}