1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-13 13:48:59 +02:00

Only show timestamp if it's for the current or previous stage.

This commit is contained in:
Thomas Heartman 2025-07-23 16:26:31 +02:00
parent ca128cc7f6
commit 372c93829c
No known key found for this signature in database
GPG Key ID: BD1F880DAED1EE78

View File

@ -13,8 +13,7 @@ import type {
import { HtmlTooltip } from '../../../common/HtmlTooltip/HtmlTooltip.tsx'; import { HtmlTooltip } from '../../../common/HtmlTooltip/HtmlTooltip.tsx';
import ErrorIcon from '@mui/icons-material/Error'; import ErrorIcon from '@mui/icons-material/Error';
import { useLocationSettings } from 'hooks/useLocationSettings'; import { useLocationSettings } from 'hooks/useLocationSettings';
import { formatDateYMDHM } from 'utils/formatDate'; import { formatDateYMDHM } from 'utils/formatDate.ts';
import type { ReactNode } from 'react-markdown/lib/react-markdown';
export type ISuggestChangeTimelineProps = { export type ISuggestChangeTimelineProps = {
timestamps?: Record<ChangeRequestState, string>; timestamps?: Record<ChangeRequestState, string>;
@ -111,9 +110,10 @@ export const ChangeRequestTimeline: FC<ISuggestChangeTimelineProps> = ({
<StyledBox> <StyledBox>
<StyledTimeline> <StyledTimeline>
{data.map((title, index) => { {data.map((title, index) => {
const timestampComponent = timestamps?.[title] ? ( const timestampComponent =
<Timestamp timestamp={timestamps?.[title]} /> index <= activeIndex && timestamps?.[title] ? (
) : undefined; <Timestamp timestamp={timestamps?.[title]} />
) : undefined;
if (schedule && title === 'Scheduled') { if (schedule && title === 'Scheduled') {
return ( return (