Skip to content

Commit

Permalink
chore: use palette.background.alternative for background (#8627)
Browse files Browse the repository at this point in the history
The default badge styling uses theme.palette.primary.main for the
color, but this color doesn't give us the contrast we need in dark
mode. The solution is to use theme.palette.background.alternative
instead.

Before:

![image](https://github.com/user-attachments/assets/5fb535ff-1c17-47b9-a818-7b995cd188ae)


After:

![image](https://github.com/user-attachments/assets/43b7aa05-bfd8-4f6c-a9c3-fadb5268429f)
  • Loading branch information
thomasheartman authored Nov 1, 2024
1 parent ea08067 commit 88e1ec5
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ interface IEventTimelineEventProps {
endTime: number;
}

const StyledBadge = styled(Badge)(({ theme }) => ({
'.MuiBadge-badge': {
backgroundColor: theme.palette.background.alternative,
},
}));

export const EventTimelineEventGroup = ({
group,
startTime,
Expand All @@ -48,13 +54,12 @@ export const EventTimelineEventGroup = ({
maxWidth={350}
arrow
>
<Badge
<StyledBadge
badgeContent={group.length}
color='primary'
invisible={group.length < 2}
>
<EventTimelineEventCircle group={group} />
</Badge>
</StyledBadge>
</HtmlTooltip>
</StyledEvent>
);
Expand Down

0 comments on commit 88e1ec5

Please sign in to comment.