Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong timeline stage #1619

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Accordion expanded={expanded} onChange={handleChange} style={style.accordionStyle}>
<AccordionSummary
Expand All @@ -131,13 +141,13 @@ export default function Chronology ({ address, currentTreasuryApprovalList, refe
sx={{ borderBottom: expanded ? `1px solid ${theme.palette.text.disabled}` : 'none', px: 0 }}
>
<Grid container item>
<Grid alignItems='baseline' container item>
<Grid alignItems='center' container item>
<Typography fontSize={24} fontWeight={500}>
{t('Timeline')}
</Typography>
{!expanded &&
<Typography fontSize={16} fontWeight={300} sx={{ color: 'text.disabled', ml: '10px' }}>
({ isTreasury && isExecuted ? treasuryLabel : sortedHistory?.length ? treasuryLabel || pascalCaseToTitleCase(sortedHistory[0].status)?.trim() : ''})
{timelineStage}
</Typography>
}
</Grid>
Expand Down
Loading