ConversationView: Pull various functions out of getMessageActions

This commit is contained in:
Scott Nonnenberg 2022-12-19 17:04:47 -08:00 committed by GitHub
parent 5a98fc2f4c
commit 1e282ee5d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 440 additions and 570 deletions

View file

@ -60,6 +60,22 @@ export function ToastManager({
);
}
if (toastType === ToastType.CannotOpenGiftBadgeIncoming) {
return (
<Toast onClose={hideToast}>
{i18n('message--giftBadge--unopened--toast--incoming')}
</Toast>
);
}
if (toastType === ToastType.CannotOpenGiftBadgeOutgoing) {
return (
<Toast onClose={hideToast}>
{i18n('message--giftBadge--unopened--toast--outgoing')}
</Toast>
);
}
if (toastType === ToastType.CannotStartGroupCall) {
return (
<Toast onClose={hideToast}>
@ -173,6 +189,10 @@ export function ToastManager({
return <Toast onClose={hideToast}>{i18n('pinnedConversationsFull')}</Toast>;
}
if (toastType === ToastType.ReactionFailed) {
return <Toast onClose={hideToast}>{i18n('Reactions--error')}</Toast>;
}
if (toastType === ToastType.StoryMuted) {
return (
<Toast onClose={hideToast} timeout={SHORT_TIMEOUT}>
@ -221,6 +241,22 @@ export function ToastManager({
);
}
if (toastType === ToastType.TapToViewExpiredIncoming) {
return (
<Toast onClose={hideToast}>
{i18n('Message--tap-to-view--incoming--expired-toast')}
</Toast>
);
}
if (toastType === ToastType.TapToViewExpiredOutgoing) {
return (
<Toast onClose={hideToast}>
{i18n('Message--tap-to-view--outgoing--expired-toast')}
</Toast>
);
}
if (toastType === ToastType.UnableToLoadAttachment) {
return <Toast onClose={hideToast}>{i18n('unableToLoadAttachment')}</Toast>;
}