Skip to content

Commit

Permalink
fix: styled component transient props
Browse files Browse the repository at this point in the history
  • Loading branch information
insmac committed Oct 4, 2023
1 parent 92d630d commit e58a5ea
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/web-console/src/scenes/News/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ const swing = () => {
return animation
}

const BellIcon = styled(Notification2)<{ hasUnreadNews: boolean }>`
color: ${({ theme, hasUnreadNews }) =>
theme.color[hasUnreadNews ? "red" : "foreground"]};
const BellIcon = styled(Notification2)<{ $unread: boolean }>`
color: ${({ theme, $unread }) => theme.color[$unread ? "red" : "foreground"]};
${({ hasUnreadNews }) =>
hasUnreadNews &&
${({ $unread }) =>
$unread &&
`
animation: 5s linear swing infinite;
@keyframes swing {
Expand Down Expand Up @@ -167,7 +166,7 @@ const News = () => {
icon={
<Button skin={newsOpened ? "primary" : "secondary"}>
<UnreadItemsIcon
icon={<BellIcon size="18px" hasUnreadNews={hasUnreadNews} />}
icon={<BellIcon size="18px" $unread={hasUnreadNews} />}
tick={hasUnreadNews}
/>
</Button>
Expand Down

0 comments on commit e58a5ea

Please sign in to comment.