mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Release Note Channel: Mute/Unmute UI, hide UI elements
This commit is contained in:
34
ts/components/conversation/SignalConversationMuteToggle.tsx
Normal file
34
ts/components/conversation/SignalConversationMuteToggle.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import type { LocalizerType } from '../../types/I18N';
|
||||
|
||||
type Props = {
|
||||
isMuted: boolean;
|
||||
i18n: LocalizerType;
|
||||
setMuteExpiration: (conversationId: string, muteExpiresAt: number) => unknown;
|
||||
conversationId: string;
|
||||
};
|
||||
export function SignalConversationMuteToggle({
|
||||
isMuted,
|
||||
i18n,
|
||||
setMuteExpiration,
|
||||
conversationId,
|
||||
}: Props): JSX.Element {
|
||||
const onMuteToggleClicked = () => {
|
||||
setMuteExpiration(conversationId, isMuted ? 0 : Number.MAX_SAFE_INTEGER);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="SignalConversationMuteToggle">
|
||||
<button
|
||||
onClick={onMuteToggleClicked}
|
||||
type="button"
|
||||
className="SignalConversationMuteToggle__text"
|
||||
>
|
||||
{isMuted ? i18n('icu:unmute') : i18n('icu:mute')}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user