Add channel muting (#108)

This commit is contained in:
Szymon Szlachtowicz 2021-11-02 21:44:30 +01:00 committed by GitHub
parent df8387d5c0
commit 6db3b9272d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -28,7 +28,6 @@ function MenuItem({ Svg, text, onClick }: MenuItemProps) {
interface ChannelMenuProps { interface ChannelMenuProps {
channel: ChannelData; channel: ChannelData;
messages: ChatMessage[]; messages: ChatMessage[];
switchMemberList: () => void; switchMemberList: () => void;
setShowChannelMenu: (val: boolean) => void; setShowChannelMenu: (val: boolean) => void;
@ -36,7 +35,6 @@ interface ChannelMenuProps {
export const ChannelMenu = ({ export const ChannelMenu = ({
channel, channel,
messages, messages,
switchMemberList, switchMemberList,
setShowChannelMenu, setShowChannelMenu,
@ -58,7 +56,10 @@ export const ChannelMenu = ({
/> />
)} )}
<MenuItem <MenuItem
onClick={() => channel.isMuted === true} onClick={() => {
channel.isMuted = true;
setShowChannelMenu(false);
}}
Svg={MuteSvg} Svg={MuteSvg}
text="Mute Chat" text="Mute Chat"
/> />