diff --git a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestTimeline/ChangeRequestTimeline.test.tsx b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestTimeline/ChangeRequestTimeline.test.tsx index b5e185838a..63a6045000 100644 --- a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestTimeline/ChangeRequestTimeline.test.tsx +++ b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestTimeline/ChangeRequestTimeline.test.tsx @@ -117,12 +117,12 @@ describe('changeRequestScheduleProps', () => { status: 'pending' as const, }; - const { title, subtitle, color, reason } = getScheduleProps(schedule); + const { title, timeInfo, color, reason } = getScheduleProps(schedule); expect(title).toBe('Scheduled'); expect(color).toBe('warning'); expect(reason).toBeNull(); - render(subtitle); + render(timeInfo); screen.getByText('for'); const timeElement = screen.getByRole('time'); const datetime = timeElement.getAttribute('datetime'); @@ -138,12 +138,12 @@ describe('changeRequestScheduleProps', () => { failureReason: 'failure reason', }; - const { title, subtitle, color, reason } = getScheduleProps(schedule); + const { title, timeInfo, color, reason } = getScheduleProps(schedule); expect(title).toBe('Schedule failed'); expect(color).toBe('error'); expect(reason).toBeTruthy(); - render(subtitle); + render(timeInfo); screen.getByText('at'); const timeElement = screen.getByRole('time'); const datetime = timeElement.getAttribute('datetime'); @@ -158,12 +158,12 @@ describe('changeRequestScheduleProps', () => { reason: 'reason', }; - const { title, subtitle, color, reason } = getScheduleProps(schedule); + const { title, timeInfo, color, reason } = getScheduleProps(schedule); expect(title).toBe('Schedule suspended'); expect(color).toBe('grey'); expect(reason).toBeTruthy(); - render(subtitle); + render(timeInfo); screen.getByText('was'); const timeElement = screen.getByRole('time'); const datetime = timeElement.getAttribute('datetime'); diff --git a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestTimeline/ChangeRequestTimeline.tsx b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestTimeline/ChangeRequestTimeline.tsx index efc25510a7..9f7eac308b 100644 --- a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestTimeline/ChangeRequestTimeline.tsx +++ b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestTimeline/ChangeRequestTimeline.tsx @@ -48,6 +48,7 @@ const StyledSubtitle = styled(Box)(({ theme }) => ({ display: 'flex', flexDirection: 'row', alignItems: 'flex-end', + columnGap: '1ch', })); const StyledTimeline = styled(Timeline)(() => ({ @@ -117,7 +118,12 @@ export const ChangeRequestTimeline: FC = ({ {data.map((title, index) => { const timestampComponent = index <= activeIndex && timestamps?.[title] ? ( - ); -})(({ theme }) => ({ - color: theme.palette.text.secondary, - fontSize: theme.typography.body2.fontSize, -})); +}; const TimelineItem = ({ color, @@ -209,17 +212,17 @@ const TimelineItem = ({ }; export const getScheduleProps = (schedule: ChangeRequestSchedule) => { - const Subtitle = ({ prefix }: { prefix: string }) => ( - <> + const TimeInfo = ({ prefix }: { prefix: string }) => ( + {prefix} ); switch (schedule.status) { case 'suspended': return { title: 'Schedule suspended', - subtitle: , + timeInfo: , color: 'grey' as const, reason: ( @@ -230,7 +233,7 @@ export const getScheduleProps = (schedule: ChangeRequestSchedule) => { case 'failed': return { title: 'Schedule failed', - subtitle: , + timeInfo: , color: 'error' as const, reason: ( { default: return { title: 'Scheduled', - subtitle: , + timeInfo: , color: 'warning' as const, reason: null, }; @@ -260,7 +263,7 @@ const TimelineScheduleItem = ({ schedule: ChangeRequestSchedule; timestamp: ReactNode; }) => { - const { title, subtitle, color, reason } = getScheduleProps(schedule); + const { title, timeInfo, color, reason } = getScheduleProps(schedule); return ( @@ -270,13 +273,11 @@ const TimelineScheduleItem = ({ {title} - {timestamp} - - ({subtitle}) - + {timeInfo} {reason} + {timestamp} );