diff --git a/ts/components/ToastCannotStartGroupCall.tsx b/ts/components/ToastCannotStartGroupCall.tsx
deleted file mode 100644
index 58996bc15..000000000
--- a/ts/components/ToastCannotStartGroupCall.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2021 Signal Messenger, LLC
-// SPDX-License-Identifier: AGPL-3.0-only
-
-import React from 'react';
-import type { LocalizerType } from '../types/Util';
-import { Toast } from './Toast';
-
-type PropsType = {
- i18n: LocalizerType;
- onClose: () => unknown;
-};
-
-export function ToastCannotStartGroupCall({
- i18n,
- onClose,
-}: PropsType): JSX.Element {
- return (
- {i18n('GroupV2--cannot-start-group-call')}
- );
-}
diff --git a/ts/components/ToastManager.tsx b/ts/components/ToastManager.tsx
index 339ad003e..b9f8abbe2 100644
--- a/ts/components/ToastManager.tsx
+++ b/ts/components/ToastManager.tsx
@@ -30,72 +30,6 @@ export function ToastManager({
}
const { toastType } = toast;
- if (toastType === ToastType.Error) {
- return (
- window.showDebugLog(),
- }}
- >
- {i18n('Toast--error')}
-
- );
- }
-
- if (toastType === ToastType.MessageBodyTooLong) {
- return ;
- }
-
- if (toastType === ToastType.StoryReact) {
- return (
-
- {i18n('Stories__toast--sending-reaction')}
-
- );
- }
-
- if (toastType === ToastType.StoryReply) {
- return (
-
- {i18n('Stories__toast--sending-reply')}
-
- );
- }
-
- if (toastType === ToastType.StoryMuted) {
- return (
-
- {i18n('Stories__toast--hasNoSound')}
-
- );
- }
-
- if (toastType === ToastType.StoryVideoTooLong) {
- return (
-
- {i18n('StoryCreator__error--video-too-long')}
-
- );
- }
-
- if (toastType === ToastType.StoryVideoUnsupported) {
- return (
-
- {i18n('StoryCreator__error--video-unsupported')}
-
- );
- }
-
- if (toastType === ToastType.StoryVideoError) {
- return (
-
- {i18n('StoryCreator__error--video-error')}
-
- );
- }
if (toastType === ToastType.AddingUserToGroup) {
return (
@@ -108,21 +42,10 @@ export function ToastManager({
);
}
- if (toastType === ToastType.UserAddedToGroup) {
+ if (toastType === ToastType.CannotStartGroupCall) {
return (
- {i18n(
- 'AddUserToAnotherGroupModal__toast--user-added-to-group',
- toast.parameters
- )}
-
- );
- }
-
- if (toastType === ToastType.FailedToDeleteUsername) {
- return (
-
- {i18n('ProfileEditor--username--delete-general-error')}
+ {i18n('GroupV2--cannot-start-group-call', toast.parameters)}
);
}
@@ -147,5 +70,91 @@ export function ToastManager({
return {i18n('deleteForEveryoneFailed')};
}
+ if (toastType === ToastType.Error) {
+ return (
+ window.showDebugLog(),
+ }}
+ >
+ {i18n('Toast--error')}
+
+ );
+ }
+
+ if (toastType === ToastType.FailedToDeleteUsername) {
+ return (
+
+ {i18n('ProfileEditor--username--delete-general-error')}
+
+ );
+ }
+
+ if (toastType === ToastType.MessageBodyTooLong) {
+ return ;
+ }
+
+ if (toastType === ToastType.StoryMuted) {
+ return (
+
+ {i18n('Stories__toast--hasNoSound')}
+
+ );
+ }
+
+ if (toastType === ToastType.StoryReact) {
+ return (
+
+ {i18n('Stories__toast--sending-reaction')}
+
+ );
+ }
+
+ if (toastType === ToastType.StoryReply) {
+ return (
+
+ {i18n('Stories__toast--sending-reply')}
+
+ );
+ }
+
+ if (toastType === ToastType.StoryVideoError) {
+ return (
+
+ {i18n('StoryCreator__error--video-error')}
+
+ );
+ }
+
+ if (toastType === ToastType.StoryVideoTooLong) {
+ return (
+
+ {i18n('StoryCreator__error--video-too-long')}
+
+ );
+ }
+
+ if (toastType === ToastType.StoryVideoUnsupported) {
+ return (
+
+ {i18n('StoryCreator__error--video-unsupported')}
+
+ );
+ }
+
+ if (toastType === ToastType.UserAddedToGroup) {
+ return (
+
+ {i18n(
+ 'AddUserToAnotherGroupModal__toast--user-added-to-group',
+ toast.parameters
+ )}
+
+ );
+ }
+
throw missingCaseError(toastType);
}
diff --git a/ts/components/conversation/ConversationHeader.stories.tsx b/ts/components/conversation/ConversationHeader.stories.tsx
index 9b700b225..228520c3a 100644
--- a/ts/components/conversation/ConversationHeader.stories.tsx
+++ b/ts/components/conversation/ConversationHeader.stories.tsx
@@ -41,7 +41,6 @@ const commonProps = {
setDisappearingMessages: action('setDisappearingMessages'),
destroyMessages: action('destroyMessages'),
onSearchInConversation: action('onSearchInConversation'),
- onSetMuteNotifications: action('onSetMuteNotifications'),
onOutgoingAudioCallInConversation: action(
'onOutgoingAudioCallInConversation'
),
@@ -57,6 +56,7 @@ const commonProps = {
onMarkUnread: action('onMarkUnread'),
onMoveToInbox: action('onMoveToInbox'),
onSetPin: action('onSetPin'),
+ setMuteExpiration: action('onSetMuteNotifications'),
viewUserStories: action('viewUserStories'),
};
diff --git a/ts/components/conversation/ConversationHeader.tsx b/ts/components/conversation/ConversationHeader.tsx
index 95f6bd092..728118e2e 100644
--- a/ts/components/conversation/ConversationHeader.tsx
+++ b/ts/components/conversation/ConversationHeader.tsx
@@ -80,11 +80,10 @@ export type PropsDataType = {
>;
export type PropsActionsType = {
- onSetMuteNotifications: (seconds: number) => void;
destroyMessages: (conversationId: string) => void;
onSearchInConversation: () => void;
- onOutgoingAudioCallInConversation: () => void;
- onOutgoingVideoCallInConversation: () => void;
+ onOutgoingAudioCallInConversation: (conversationId: string) => void;
+ onOutgoingVideoCallInConversation: (conversationId: string) => void;
onSetPin: (value: boolean) => void;
onShowConversationDetails: () => void;
@@ -95,6 +94,7 @@ export type PropsActionsType = {
onArchive: () => void;
onMarkUnread: () => void;
onMoveToInbox: () => void;
+ setMuteExpiration: (conversationId: string, seconds: number) => void;
setDisappearingMessages: (
conversationId: string,
seconds: DurationInSeconds
@@ -349,12 +349,12 @@ export class ConversationHeader extends React.Component {
onArchive,
onMarkUnread,
onMoveToInbox,
- onSetMuteNotifications,
onSetPin,
onShowAllMedia,
onShowConversationDetails,
onShowGroupMembers,
setDisappearingMessages,
+ setMuteExpiration,
type,
} = this.props;
@@ -371,7 +371,7 @@ export class ConversationHeader extends React.Component {
{isMuted ? (