diff --git a/packages/extension-polkagate/src/fullscreen/governance/post/Chronology.tsx b/packages/extension-polkagate/src/fullscreen/governance/post/Chronology.tsx index c7ca8436a..2af06050e 100644 --- a/packages/extension-polkagate/src/fullscreen/governance/post/Chronology.tsx +++ b/packages/extension-polkagate/src/fullscreen/governance/post/Chronology.tsx @@ -122,6 +122,16 @@ export default function Chronology ({ address, currentTreasuryApprovalList, refe setExpanded(isExpanded); }, []); + const timelineStage = useMemo(() => { + if (isTreasury && isExecuted) { + return `(${treasuryLabel})`; + } else if (sortedHistory?.length) { + return `(${pascalCaseToTitleCase(sortedHistory[0].status)?.trim() || treasuryLabel})`; + } else { + return ''; + } + }, [isExecuted, isTreasury, sortedHistory, treasuryLabel]); + return ( - + {t('Timeline')} {!expanded && - ({ isTreasury && isExecuted ? treasuryLabel : sortedHistory?.length ? treasuryLabel || pascalCaseToTitleCase(sortedHistory[0].status)?.trim() : ''}) + {timelineStage} }