Skip to content

Commit 5726dd4

Browse files
committed
feat(channels): add an indicator for channels having filters
1 parent 0d0bcc8 commit 5726dd4

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/ui/components/pages/Channels/ChannelCard/ChannelTitle.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import { Box, Link, Tooltip } from '@mui/material';
33
import { Channel } from 'types';
44
import NotificationsOffIcon from '@mui/icons-material/NotificationsOff';
5+
import FilterAltIcon from '@mui/icons-material/FilterAlt';
56

67
interface ChannelTitleProps {
78
channel: Channel;
@@ -15,7 +16,7 @@ function ChannelTitle(props: ChannelTitleProps) {
1516
sx={{
1617
display: 'flex',
1718
alignItems: 'center',
18-
gap: 2,
19+
gap: 1,
1920
}}
2021
>
2122
<Link
@@ -34,6 +35,11 @@ function ChannelTitle(props: ChannelTitleProps) {
3435
<NotificationsOffIcon color="disabled" fontSize="small" />
3536
</Tooltip>
3637
)}
38+
{!!channel.filters?.length && (
39+
<Tooltip title="Has filters">
40+
<FilterAltIcon color="disabled" fontSize="small" />
41+
</Tooltip>
42+
)}
3743
</Box>
3844
);
3945
}
@@ -46,7 +52,8 @@ function propsAreEqual(
4652
prevProps.channel.title === nextProps.channel.title &&
4753
prevProps.channel.url === nextProps.channel.url &&
4854
prevProps.channel.notifications?.isDisabled ===
49-
nextProps.channel.notifications?.isDisabled
55+
nextProps.channel.notifications?.isDisabled &&
56+
prevProps.channel.filters?.length === nextProps.channel.filters?.length
5057
);
5158
}
5259

0 commit comments

Comments
 (0)