From 856bbb598cc9d158f62d97afb4a183e0a45fd216 Mon Sep 17 00:00:00 2001 From: RigidStudios <34319439+RigidStudios@users.noreply.github.com> Date: Mon, 1 Nov 2021 01:10:42 +0400 Subject: [PATCH] fix: muted channels no longer have new messages badge (#297) --- .../navigation/items/ButtonItem.tsx | 24 ++++++++++++++----- .../navigation/items/Item.module.scss | 4 ++++ .../navigation/left/ServerSidebar.tsx | 18 ++++++++++---- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/src/components/navigation/items/ButtonItem.tsx b/src/components/navigation/items/ButtonItem.tsx index 1f7d274c..58fe2745 100644 --- a/src/components/navigation/items/ButtonItem.tsx +++ b/src/components/navigation/items/ButtonItem.tsx @@ -31,6 +31,7 @@ type CommonProps = Omit< alert?: "unread" | "mention"; alertCount?: number; margin?: boolean; + muted?: boolean; }; type UserProps = CommonProps & { @@ -39,6 +40,7 @@ type UserProps = CommonProps & { channel?: Channel; }; +// TODO: Gray out blocked names. export const UserButton = observer((props: UserProps) => { const { active, @@ -132,8 +134,16 @@ type ChannelProps = CommonProps & { }; export const ChannelButton = observer((props: ChannelProps) => { - const { active, alert, alertCount, channel, user, compact, ...divProps } = - props; + const { + active, + alert, + alertCount, + channel, + user, + compact, + muted, + ...divProps + } = props; if (channel.channel_type === "SavedMessages") throw "Invalid channel type."; if (channel.channel_type === "DirectMessage") { @@ -147,12 +157,13 @@ export const ChannelButton = observer((props: ChannelProps) => {