From 0f3f059454ce4002830da122481339678e9a0655 Mon Sep 17 00:00:00 2001 From: PilkeySEK <156579268+PilkeySEK@users.noreply.github.com> Date: Fri, 19 Jun 2026 23:10:49 +0200 Subject: [PATCH] fix(app): Make some modals use GenericErrorModal instead of ConfirmModal (#1023) --- .../FeatureTemporarilyDisabledModal.tsx | 11 +++-------- .../components/alerts/MaxBookmarksModal.tsx | 19 ++++++------------- .../alerts/MaxFavoriteMemesModal.tsx | 11 ++++------- .../components/alerts/RoleNameBlankModal.tsx | 11 +++-------- .../TemporaryInviteRequiresPresenceModal.tsx | 11 +++-------- .../components/layout/ChannelListContent.tsx | 12 ++++-------- .../auth/components/ContentBlockedHandler.tsx | 11 +++-------- .../utils/AnimatedAvifModalUtils.tsx | 10 +++------- .../alerts/GuildAtCapacityModal.tsx | 11 +++-------- .../components/alerts/MaxGuildsModal.tsx | 11 +++-------- .../alerts/NewAccountGuildLimitModal.tsx | 11 +++-------- .../modals/guild_tabs/GuildEmojiTab.tsx | 9 ++++----- .../modals/guild_tabs/GuildStickersTab.tsx | 13 ++++--------- .../alerts/InvitesDisabledModal.tsx | 11 +++-------- .../AttachmentPermissionDeniedModal.tsx | 15 ++++----------- .../AttachmentUploadConnectivityModal.tsx | 11 +++-------- .../alerts/FileSizeTooLargeModal.tsx | 15 ++++----------- .../alerts/MessageDeleteTooQuickModal.tsx | 11 +++-------- .../alerts/TooManyAttachmentsModal.tsx | 11 +++-------- .../alerts/TooManyReactionsModal.tsx | 11 +++-------- .../alerts/MatureContentRejectedModal.tsx | 11 +++-------- .../alerts/UserBannedFromGuildModal.tsx | 11 +++-------- .../alerts/UserIpBannedFromGuildModal.tsx | 11 +++-------- .../MediaPermissionBlockedModal.tsx | 11 +++-------- .../alerts/SlowmodeRateLimitedModal.tsx | 11 +++-------- .../tabs/my_profile_tab/AvatarUploader.tsx | 8 +++----- .../alerts/ScreenShareFailedModal.tsx | 11 +++-------- .../alerts/ScreenShareUnsupportedModal.tsx | 11 +++-------- .../components/alerts/TtsUnsupportedModal.tsx | 11 +++-------- ...EngineV2AppScreenShareExecutionAdapter.tsx | 10 +++------- 30 files changed, 99 insertions(+), 243 deletions(-) diff --git a/fluxer_app/src/features/app/components/alerts/FeatureTemporarilyDisabledModal.tsx b/fluxer_app/src/features/app/components/alerts/FeatureTemporarilyDisabledModal.tsx index 0c54f7cfb..c0c76f44f 100644 --- a/fluxer_app/src/features/app/components/alerts/FeatureTemporarilyDisabledModal.tsx +++ b/fluxer_app/src/features/app/components/alerts/FeatureTemporarilyDisabledModal.tsx @@ -1,10 +1,9 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; import {msg} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; +import {GenericErrorModal} from './GenericErrorModal'; const FEATURE_TEMPORARILY_DISABLED_DESCRIPTOR = msg({ message: 'Feature temporarily disabled', @@ -17,13 +16,9 @@ const THIS_FEATURE_HAS_BEEN_TEMPORARILY_DISABLED_PLEASE_TRY_DESCRIPTOR = msg({ export const FeatureTemporarilyDisabledModal = observer(() => { const {i18n} = useLingui(); return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(THIS_FEATURE_HAS_BEEN_TEMPORARILY_DISABLED_PLEASE_TRY_DESCRIPTOR)} data-flx="app.feature-temporarily-disabled-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/app/components/alerts/MaxBookmarksModal.tsx b/fluxer_app/src/features/app/components/alerts/MaxBookmarksModal.tsx index 3a3575711..41218b3f4 100644 --- a/fluxer_app/src/features/app/components/alerts/MaxBookmarksModal.tsx +++ b/fluxer_app/src/features/app/components/alerts/MaxBookmarksModal.tsx @@ -3,7 +3,7 @@ import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; import {PREMIUM_PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants'; import {Limits} from '@app/features/app/utils/UserLimits'; -import {CLOSE_DESCRIPTOR, UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {CLOSE_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; import * as PremiumModalCommands from '@app/features/premium/commands/PremiumModalCommands'; import {shouldShowPremiumFeatures} from '@app/features/premium/utils/PremiumUtils'; import type {User} from '@app/features/user/models/User'; @@ -11,6 +11,7 @@ import {MAX_BOOKMARKS_PREMIUM} from '@fluxer/constants/src/LimitConstants'; import {msg, plural} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; +import {GenericErrorModal} from './GenericErrorModal'; const BOOKMARK_LIMIT_REACHED_DESCRIPTOR = msg({ message: 'Bookmark limit reached', @@ -56,26 +57,18 @@ export const MaxBookmarksModal = observer(({user}: MaxBookmarksModalProps) => { ); if (!showPremium) { return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(YOU_VE_REACHED_THE_MAXIMUM_NUMBER_OF_BOOKMARKS_DESCRIPTOR, {bookmarksText})} data-flx="app.max-bookmarks-modal.confirm-modal" /> ); } if (!canUpgradeBookmarks) { return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(YOU_VE_REACHED_THE_MAXIMUM_NUMBER_OF_BOOKMARKS_2_DESCRIPTOR, {bookmarksText})} data-flx="app.max-bookmarks-modal.confirm-modal--2" /> ); diff --git a/fluxer_app/src/features/app/components/alerts/MaxFavoriteMemesModal.tsx b/fluxer_app/src/features/app/components/alerts/MaxFavoriteMemesModal.tsx index e32ece36f..30ea552e0 100644 --- a/fluxer_app/src/features/app/components/alerts/MaxFavoriteMemesModal.tsx +++ b/fluxer_app/src/features/app/components/alerts/MaxFavoriteMemesModal.tsx @@ -3,7 +3,7 @@ import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; import {PREMIUM_PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants'; import {Limits} from '@app/features/app/utils/UserLimits'; -import {CLOSE_DESCRIPTOR, UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {CLOSE_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; import * as PremiumModalCommands from '@app/features/premium/commands/PremiumModalCommands'; import {shouldShowPremiumFeatures} from '@app/features/premium/utils/PremiumUtils'; import Users from '@app/features/user/state/Users'; @@ -11,6 +11,7 @@ import {MAX_FAVORITE_MEMES_PREMIUM} from '@fluxer/constants/src/LimitConstants'; import {msg, plural} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; +import {GenericErrorModal} from './GenericErrorModal'; const SAVED_MEDIA_LIMIT_REACHED_DESCRIPTOR = msg({ message: 'Saved media limit reached', @@ -50,13 +51,9 @@ export const MaxFavoriteMemesModal = observer(() => { ); if (!showPremium) { return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(YOU_VE_REACHED_THE_MAXIMUM_LIMIT_OF_THIS_DESCRIPTOR, {freeItemsText})} data-flx="app.max-favorite-memes-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/app/components/alerts/RoleNameBlankModal.tsx b/fluxer_app/src/features/app/components/alerts/RoleNameBlankModal.tsx index f382a0caa..707f61d53 100644 --- a/fluxer_app/src/features/app/components/alerts/RoleNameBlankModal.tsx +++ b/fluxer_app/src/features/app/components/alerts/RoleNameBlankModal.tsx @@ -1,10 +1,9 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; import {msg} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; +import {GenericErrorModal} from './GenericErrorModal'; const ROLE_NAME_CANNOT_BE_BLANK_DESCRIPTOR = msg({ message: 'Role name is required', @@ -17,13 +16,9 @@ const YOU_CANNOT_SAVE_A_ROLE_WITH_A_BLANK_DESCRIPTOR = msg({ export const RoleNameBlankModal = observer(() => { const {i18n} = useLingui(); return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(YOU_CANNOT_SAVE_A_ROLE_WITH_A_BLANK_DESCRIPTOR)} data-flx="app.role-name-blank-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/app/components/alerts/TemporaryInviteRequiresPresenceModal.tsx b/fluxer_app/src/features/app/components/alerts/TemporaryInviteRequiresPresenceModal.tsx index b1338dba4..b595ccbdf 100644 --- a/fluxer_app/src/features/app/components/alerts/TemporaryInviteRequiresPresenceModal.tsx +++ b/fluxer_app/src/features/app/components/alerts/TemporaryInviteRequiresPresenceModal.tsx @@ -1,10 +1,9 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; import {msg} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; +import {GenericErrorModal} from './GenericErrorModal'; const GATEWAY_CONNECTION_REQUIRED_DESCRIPTOR = msg({ message: 'Gateway connection required', @@ -18,13 +17,9 @@ const YOU_MUST_BE_CONNECTED_TO_THE_GATEWAY_TO_DESCRIPTOR = msg({ export const TemporaryInviteRequiresPresenceModal = observer(() => { const {i18n} = useLingui(); return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(YOU_MUST_BE_CONNECTED_TO_THE_GATEWAY_TO_DESCRIPTOR)} data-flx="app.temporary-invite-requires-presence-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/app/components/layout/ChannelListContent.tsx b/fluxer_app/src/features/app/components/layout/ChannelListContent.tsx index eebe3cce4..31eac55a6 100644 --- a/fluxer_app/src/features/app/components/layout/ChannelListContent.tsx +++ b/fluxer_app/src/features/app/components/layout/ChannelListContent.tsx @@ -2,7 +2,6 @@ import {Routes} from '@app/app/Routes'; import Accessibility from '@app/features/accessibility/state/Accessibility'; -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; import {ChannelItem} from '@app/features/app/components/layout/ChannelItem'; import channelItemStyles from '@app/features/app/components/layout/ChannelItem.module.css'; import {ChannelItemContent} from '@app/features/app/components/layout/ChannelItemContent'; @@ -28,7 +27,7 @@ import {useRovingFocusList} from '@app/features/app/hooks/useRovingFocusList'; import Channels from '@app/features/channel/state/Channels'; import * as GuildCommands from '@app/features/guild/commands/GuildCommands'; import type {Guild} from '@app/features/guild/models/Guild'; -import {MEMBERS_DESCRIPTOR, UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {MEMBERS_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; import {isKeyboardActivationKey} from '@app/features/input/utils/KeyboardUtils'; import * as RouterUtils from '@app/features/navigation/utils/RouterUtils'; import Permission from '@app/features/permissions/state/Permission'; @@ -58,6 +57,7 @@ import {observer} from 'mobx-react-lite'; import type {MotionValue} from 'motion'; import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; import {useDragLayer} from 'react-dnd'; +import {GenericErrorModal} from '../alerts/GenericErrorModal'; const CATEGORY_FULL_DESCRIPTOR = msg({ message: 'Category full', @@ -185,15 +185,11 @@ export const ChannelListContent = observer(({guild, scrollY}: {guild: Guild; scr if (failureCode(error) === APIErrorCodes.MAX_CATEGORY_CHANNELS) { ModalCommands.push( ModalCommands.modal(() => ( - {}} - secondaryText={false} - hideCloseButton data-flx="app.channel-list-content.handle-channel-drop.confirm-modal" /> )), diff --git a/fluxer_app/src/features/auth/components/ContentBlockedHandler.tsx b/fluxer_app/src/features/auth/components/ContentBlockedHandler.tsx index 3a60ae34a..a39efe86e 100644 --- a/fluxer_app/src/features/auth/components/ContentBlockedHandler.tsx +++ b/fluxer_app/src/features/auth/components/ContentBlockedHandler.tsx @@ -1,7 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {OKAY_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import * as ModalCommands from '@app/features/ui/commands/ModalCommands'; import {modal} from '@app/features/ui/commands/ModalCommands'; import {msg} from '@lingui/core/macro'; @@ -21,13 +20,9 @@ const YOUR_ACTION_COULD_NOT_BE_COMPLETED_BECAUSE_IT_DESCRIPTOR = msg({ const ContentBlockedModal = observer(() => { const {i18n} = useLingui(); return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(YOUR_ACTION_COULD_NOT_BE_COMPLETED_BECAUSE_IT_DESCRIPTOR)} data-flx="auth.content-blocked-handler.content-blocked-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/expressions/utils/AnimatedAvifModalUtils.tsx b/fluxer_app/src/features/expressions/utils/AnimatedAvifModalUtils.tsx index d8c6717f7..7bf6b530a 100644 --- a/fluxer_app/src/features/expressions/utils/AnimatedAvifModalUtils.tsx +++ b/fluxer_app/src/features/expressions/utils/AnimatedAvifModalUtils.tsx @@ -1,8 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {AVIF_FORMAT_LABEL} from '@app/features/app/config/I18nDisplayConstants'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; import * as ModalCommands from '@app/features/ui/commands/ModalCommands'; import {modal} from '@app/features/ui/commands/ModalCommands'; import type {I18n} from '@lingui/core'; @@ -21,16 +20,13 @@ interface ShowAnimatedAvifUnsupportedModalOptions { export function showAnimatedAvifUnsupportedModal({i18n}: ShowAnimatedAvifUnsupportedModalOptions): void { ModalCommands.push( modal(() => ( - Animated {AVIF_FORMAT_LABEL} files aren't supported. Upload a static {AVIF_FORMAT_LABEL} file instead. } - primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)} - primaryVariant="primary" - onPrimary={() => {}} data-flx="expressions.animated-avif-modal-utils.show-animated-avif-unsupported-modal.confirm-modal" /> )), diff --git a/fluxer_app/src/features/guild/components/alerts/GuildAtCapacityModal.tsx b/fluxer_app/src/features/guild/components/alerts/GuildAtCapacityModal.tsx index 063407760..f0c519ae8 100644 --- a/fluxer_app/src/features/guild/components/alerts/GuildAtCapacityModal.tsx +++ b/fluxer_app/src/features/guild/components/alerts/GuildAtCapacityModal.tsx @@ -1,7 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {msg} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; @@ -17,13 +16,9 @@ const THIS_COMMUNITY_HAS_REACHED_ITS_MAXIMUM_MEMBER_LIMIT_DESCRIPTOR = msg({ export const GuildAtCapacityModal = observer(() => { const {i18n} = useLingui(); return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(THIS_COMMUNITY_HAS_REACHED_ITS_MAXIMUM_MEMBER_LIMIT_DESCRIPTOR)} data-flx="guild.guild-at-capacity-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/guild/components/alerts/MaxGuildsModal.tsx b/fluxer_app/src/features/guild/components/alerts/MaxGuildsModal.tsx index f046c7c31..51e6bcf54 100644 --- a/fluxer_app/src/features/guild/components/alerts/MaxGuildsModal.tsx +++ b/fluxer_app/src/features/guild/components/alerts/MaxGuildsModal.tsx @@ -1,7 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import type {User} from '@app/features/user/models/User'; import {msg, plural} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; @@ -20,9 +19,9 @@ export const MaxGuildsModal = observer(({user}: MaxGuildsModalProps) => { const {i18n} = useLingui(); const maxGuilds = user.maxGuilds; return ( - { "You've reached the maximum number of communities you can join (# communities). Leave a community before joining another one.", }, )} - primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)} - onPrimary={() => {}} - secondaryText={false} - hideCloseButton data-flx="guild.max-guilds-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/guild/components/alerts/NewAccountGuildLimitModal.tsx b/fluxer_app/src/features/guild/components/alerts/NewAccountGuildLimitModal.tsx index fb84a3b5f..98b40efdd 100644 --- a/fluxer_app/src/features/guild/components/alerts/NewAccountGuildLimitModal.tsx +++ b/fluxer_app/src/features/guild/components/alerts/NewAccountGuildLimitModal.tsx @@ -1,7 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {OKAY_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {msg} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; @@ -17,13 +16,9 @@ const NEW_ACCOUNTS_ARE_LIMITED_TO_JOINING_10_COMMUNITIES_DESCRIPTOR = msg({ export const NewAccountGuildLimitModal = observer(() => { const {i18n} = useLingui(); return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(NEW_ACCOUNTS_ARE_LIMITED_TO_JOINING_10_COMMUNITIES_DESCRIPTOR)} data-flx="guild.new-account-guild-limit-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildEmojiTab.tsx b/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildEmojiTab.tsx index 51c7312a2..106e06aef 100644 --- a/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildEmojiTab.tsx +++ b/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildEmojiTab.tsx @@ -1,5 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; import {GlobalLimits} from '@app/features/app/utils/GlobalLimits'; import {EmojiListHeader, EmojiListItem} from '@app/features/emoji/components/emojis/EmojiListItem'; @@ -18,7 +19,7 @@ import styles from '@app/features/guild/components/modals/guild_tabs/GuildEmojiT import {UploadDropZone} from '@app/features/guild/components/UploadDropZone'; import {UploadSlotInfo} from '@app/features/guild/components/UploadSlotInfo'; import Guilds from '@app/features/guild/state/Guilds'; -import {OKAY_DESCRIPTOR, UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {OKAY_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; import {openFilePicker} from '@app/features/messaging/utils/FilePickerUtils'; import {formatFileSize} from '@app/features/messaging/utils/FileUtils'; import Permission from '@app/features/permissions/state/Permission'; @@ -251,11 +252,9 @@ const GuildEmojiTab: React.FC<{guildId: string}> = observer(function GuildEmojiT if (availableSlots <= 0) { ModalCommands.push( modal(() => ( - {}} + message={i18n._(EMOJI_SLOTS_FULL_DESCRIPTION_DESCRIPTOR)} data-flx="guild.guild-tabs.guild-emoji-tab.handle-file-select.confirm-modal" /> )), diff --git a/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildStickersTab.tsx b/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildStickersTab.tsx index 0a84ca653..63adcf54f 100644 --- a/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildStickersTab.tsx +++ b/fluxer_app/src/features/guild/components/modals/guild_tabs/GuildStickersTab.tsx @@ -1,5 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; import {StatusSlate} from '@app/features/app/components/dialogs/shared/StatusSlate'; import {GlobalLimits} from '@app/features/app/utils/GlobalLimits'; @@ -18,11 +19,7 @@ import styles from '@app/features/guild/components/modals/guild_tabs/GuildSticke import {UploadDropZone} from '@app/features/guild/components/UploadDropZone'; import {UploadSlotInfo} from '@app/features/guild/components/UploadSlotInfo'; import Guilds from '@app/features/guild/state/Guilds'; -import { - OKAY_DESCRIPTOR, - TRY_AGAIN_DESCRIPTOR, - UNDERSTOOD_DESCRIPTOR, -} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {OKAY_DESCRIPTOR, TRY_AGAIN_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; import {openFilePicker} from '@app/features/messaging/utils/FilePickerUtils'; import {formatFileSize} from '@app/features/messaging/utils/FileUtils'; import Permission from '@app/features/permissions/state/Permission'; @@ -163,11 +160,9 @@ const GuildStickersTab: React.FC<{guildId: string}> = observer(function GuildSti const showNoStickerSlotsModal = useCallback(() => { ModalCommands.push( modal(() => ( - {}} + message={i18n._(STICKER_SLOTS_FULL_DESCRIPTION_DESCRIPTOR)} data-flx="guild.guild-tabs.guild-stickers-tab.no-sticker-slots-confirm-modal" /> )), diff --git a/fluxer_app/src/features/invite/components/alerts/InvitesDisabledModal.tsx b/fluxer_app/src/features/invite/components/alerts/InvitesDisabledModal.tsx index 5977570e7..1a15123a1 100644 --- a/fluxer_app/src/features/invite/components/alerts/InvitesDisabledModal.tsx +++ b/fluxer_app/src/features/invite/components/alerts/InvitesDisabledModal.tsx @@ -1,8 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; import {msg} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; @@ -27,17 +26,13 @@ interface InvitesDisabledModalProps { export const InvitesDisabledModal = observer(({isRaidDetected = false}: InvitesDisabledModalProps) => { const {i18n} = useLingui(); return ( - {}} - secondaryText={false} - hideCloseButton data-flx="invite.invites-disabled-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/messaging/components/alerts/AttachmentPermissionDeniedModal.tsx b/fluxer_app/src/features/messaging/components/alerts/AttachmentPermissionDeniedModal.tsx index 60566b363..d227f9a31 100644 --- a/fluxer_app/src/features/messaging/components/alerts/AttachmentPermissionDeniedModal.tsx +++ b/fluxer_app/src/features/messaging/components/alerts/AttachmentPermissionDeniedModal.tsx @@ -1,10 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import { - CANNOT_SEND_MESSAGES_IN_CHANNEL_DESCRIPTOR, - UNDERSTOOD_DESCRIPTOR, -} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; +import {CANNOT_SEND_MESSAGES_IN_CHANNEL_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; import {msg} from '@lingui/core/macro'; import {Trans, useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; @@ -46,13 +43,9 @@ export const AttachmentPermissionDeniedModal = observer( i18n._(CANNOT_SEND_MESSAGES_IN_CHANNEL_DESCRIPTOR) ); return ( - {}} - secondaryText={false} - hideCloseButton + message={description} data-flx="messaging.attachment-permission-denied-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/messaging/components/alerts/AttachmentUploadConnectivityModal.tsx b/fluxer_app/src/features/messaging/components/alerts/AttachmentUploadConnectivityModal.tsx index dd8aba9b9..1ff3ff7b5 100644 --- a/fluxer_app/src/features/messaging/components/alerts/AttachmentUploadConnectivityModal.tsx +++ b/fluxer_app/src/features/messaging/components/alerts/AttachmentUploadConnectivityModal.tsx @@ -1,9 +1,8 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {ExternalLink} from '@app/features/app/components/shared/ExternalLink'; import {PRODUCT_NAME, SUPPORT_EMAIL, SUPPORT_EMAIL_MAILTO} from '@app/features/app/config/I18nDisplayConstants'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; import {MULTIPART_ATTACHMENT_FALLBACK_MAX_REQUEST_SIZE} from '@app/features/messaging/utils/AttachmentUploadFallbackUtils'; import {formatFileSize} from '@app/features/messaging/utils/FileUtils'; import {msg} from '@lingui/core/macro'; @@ -18,9 +17,9 @@ export const AttachmentUploadConnectivityModal = observer(() => { const {i18n} = useLingui(); const fallbackSizeFormatted = formatFileSize(MULTIPART_ATTACHMENT_FALLBACK_MAX_REQUEST_SIZE); return ( - We couldn't reach the attachment upload service. {PRODUCT_NAME} can fall back to the standard upload path for messages up to {fallbackSizeFormatted} total, but these attachments exceed that combined limit and can't be @@ -34,10 +33,6 @@ export const AttachmentUploadConnectivityModal = observer(() => { if this keeps happening. } - primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)} - onPrimary={() => {}} - secondaryText={false} - hideCloseButton data-flx="messaging.attachment-upload-connectivity-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/messaging/components/alerts/FileSizeTooLargeModal.tsx b/fluxer_app/src/features/messaging/components/alerts/FileSizeTooLargeModal.tsx index cfee53fc2..e92272797 100644 --- a/fluxer_app/src/features/messaging/components/alerts/FileSizeTooLargeModal.tsx +++ b/fluxer_app/src/features/messaging/components/alerts/FileSizeTooLargeModal.tsx @@ -1,13 +1,10 @@ // SPDX-License-Identifier: AGPL-3.0-or-later +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; import {PREMIUM_PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants'; import {Limits} from '@app/features/app/utils/UserLimits'; -import { - CANCEL_DESCRIPTOR, - GET_PREMIUM_DESCRIPTOR, - UNDERSTOOD_DESCRIPTOR, -} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {CANCEL_DESCRIPTOR, GET_PREMIUM_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; import {formatFileSize} from '@app/features/messaging/utils/FileUtils'; import * as PremiumModalCommands from '@app/features/premium/commands/PremiumModalCommands'; import {shouldShowPremiumFeatures} from '@app/features/premium/utils/PremiumUtils'; @@ -76,13 +73,9 @@ export const FileSizeTooLargeModal = observer(({oversizedFileCount}: FileSizeToo : i18n._(ONE_OR_MORE_FILES_YOU_RE_TRYING_TO_DESCRIPTOR, {maxSizeFormatted}); if (!showPremium || !canUpgradeAttachmentLimit) { return ( - {}} - secondaryText={false} - hideCloseButton + message={!showPremium ? `${baseDescription} ${i18n._(INSTANCE_ADMIN_LIMIT_DESCRIPTOR)}` : baseDescription} data-flx="messaging.file-size-too-large-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/messaging/components/alerts/MessageDeleteTooQuickModal.tsx b/fluxer_app/src/features/messaging/components/alerts/MessageDeleteTooQuickModal.tsx index 28807b87e..364e8b3d1 100644 --- a/fluxer_app/src/features/messaging/components/alerts/MessageDeleteTooQuickModal.tsx +++ b/fluxer_app/src/features/messaging/components/alerts/MessageDeleteTooQuickModal.tsx @@ -1,7 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {OKAY_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {msg} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; @@ -17,13 +16,9 @@ const WAIT_A_MOMENT_BEFORE_DELETING_MORE_MESSAGES_DESCRIPTOR = msg({ export const MessageDeleteTooQuickModal = observer(() => { const {i18n} = useLingui(); return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(WAIT_A_MOMENT_BEFORE_DELETING_MORE_MESSAGES_DESCRIPTOR)} data-flx="messaging.message-delete-too-quick-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/messaging/components/alerts/TooManyAttachmentsModal.tsx b/fluxer_app/src/features/messaging/components/alerts/TooManyAttachmentsModal.tsx index f902c3827..5a5695b52 100644 --- a/fluxer_app/src/features/messaging/components/alerts/TooManyAttachmentsModal.tsx +++ b/fluxer_app/src/features/messaging/components/alerts/TooManyAttachmentsModal.tsx @@ -1,7 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import Users from '@app/features/user/state/Users'; import {msg, plural} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; @@ -16,19 +15,15 @@ export const TooManyAttachmentsModal = observer(() => { const currentUser = Users.currentUser; const maxAttachments = currentUser?.maxAttachmentsPerMessage ?? 10; return ( - {}} - secondaryText={false} - hideCloseButton data-flx="messaging.too-many-attachments-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/messaging/components/alerts/TooManyReactionsModal.tsx b/fluxer_app/src/features/messaging/components/alerts/TooManyReactionsModal.tsx index dfd258ffb..67449d603 100644 --- a/fluxer_app/src/features/messaging/components/alerts/TooManyReactionsModal.tsx +++ b/fluxer_app/src/features/messaging/components/alerts/TooManyReactionsModal.tsx @@ -1,7 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {msg} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; @@ -17,13 +16,9 @@ const THIS_IS_ONE_HEAVY_MESSAGE_SOME_REACTIONS_NEED_DESCRIPTOR = msg({ export const TooManyReactionsModal = observer(() => { const {i18n} = useLingui(); return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(THIS_IS_ONE_HEAVY_MESSAGE_SOME_REACTIONS_NEED_DESCRIPTOR)} data-flx="messaging.too-many-reactions-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/moderation/components/alerts/MatureContentRejectedModal.tsx b/fluxer_app/src/features/moderation/components/alerts/MatureContentRejectedModal.tsx index 7deecfdd7..5b520af4d 100644 --- a/fluxer_app/src/features/moderation/components/alerts/MatureContentRejectedModal.tsx +++ b/fluxer_app/src/features/moderation/components/alerts/MatureContentRejectedModal.tsx @@ -1,7 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {msg} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; @@ -18,13 +17,9 @@ const THIS_CHANNEL_IS_NOT_MARKED_FOR_MATURE_CONTENT_DESCRIPTOR = msg({ export const MatureContentRejectedModal = observer(() => { const {i18n} = useLingui(); return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(THIS_CHANNEL_IS_NOT_MARKED_FOR_MATURE_CONTENT_DESCRIPTOR)} data-flx="moderation.mature-content-rejected-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/moderation/components/alerts/UserBannedFromGuildModal.tsx b/fluxer_app/src/features/moderation/components/alerts/UserBannedFromGuildModal.tsx index d86a5f2e3..9986b5090 100644 --- a/fluxer_app/src/features/moderation/components/alerts/UserBannedFromGuildModal.tsx +++ b/fluxer_app/src/features/moderation/components/alerts/UserBannedFromGuildModal.tsx @@ -1,7 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {msg} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; @@ -17,13 +16,9 @@ const YOU_ARE_BANNED_FROM_THIS_COMMUNITY_AND_CANNOT_DESCRIPTOR = msg({ export const UserBannedFromGuildModal = observer(() => { const {i18n} = useLingui(); return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(YOU_ARE_BANNED_FROM_THIS_COMMUNITY_AND_CANNOT_DESCRIPTOR)} data-flx="moderation.user-banned-from-guild-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/moderation/components/alerts/UserIpBannedFromGuildModal.tsx b/fluxer_app/src/features/moderation/components/alerts/UserIpBannedFromGuildModal.tsx index a46d0caff..c74b64a7f 100644 --- a/fluxer_app/src/features/moderation/components/alerts/UserIpBannedFromGuildModal.tsx +++ b/fluxer_app/src/features/moderation/components/alerts/UserIpBannedFromGuildModal.tsx @@ -1,7 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {msg} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; @@ -17,13 +16,9 @@ const YOUR_IP_ADDRESS_IS_BANNED_FROM_THIS_COMMUNITY_DESCRIPTOR = msg({ export const UserIpBannedFromGuildModal = observer(() => { const {i18n} = useLingui(); return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(YOUR_IP_ADDRESS_IS_BANNED_FROM_THIS_COMMUNITY_DESCRIPTOR)} data-flx="moderation.user-ip-banned-from-guild-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/permissions/system/components/MediaPermissionBlockedModal.tsx b/fluxer_app/src/features/permissions/system/components/MediaPermissionBlockedModal.tsx index 5eca7458d..43329e2d7 100644 --- a/fluxer_app/src/features/permissions/system/components/MediaPermissionBlockedModal.tsx +++ b/fluxer_app/src/features/permissions/system/components/MediaPermissionBlockedModal.tsx @@ -1,8 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; import {isDesktop} from '@app/features/ui/utils/NativeUtils'; import {msg} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; @@ -74,13 +73,9 @@ export const MediaPermissionBlockedModal = observer(({kind}: {kind: MediaPermiss const {i18n} = useLingui(); const desktop = isDesktop(); return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(bodyDescriptorForKind(kind, desktop), {productName: PRODUCT_NAME})} data-flx="permissions.media-permission-blocked-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/slowmode/components/alerts/SlowmodeRateLimitedModal.tsx b/fluxer_app/src/features/slowmode/components/alerts/SlowmodeRateLimitedModal.tsx index bd8fbe14b..637ec2d4d 100644 --- a/fluxer_app/src/features/slowmode/components/alerts/SlowmodeRateLimitedModal.tsx +++ b/fluxer_app/src/features/slowmode/components/alerts/SlowmodeRateLimitedModal.tsx @@ -1,10 +1,9 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import { MINUTES_AND_SECONDS_DURATION_DESCRIPTOR, MINUTES_DURATION_PLURAL_DESCRIPTOR, - OKAY_DESCRIPTOR, SECONDS_DURATION_PLURAL_DESCRIPTOR, } from '@app/features/i18n/utils/CommonMessageDescriptors'; import {msg} from '@lingui/core/macro'; @@ -39,13 +38,9 @@ export const SlowmodeRateLimitedModal = observer(({retryAfter}: SlowmodeRateLimi return i18n._(MINUTES_AND_SECONDS_DURATION_DESCRIPTOR, {minutes, seconds: remainingSeconds}); }; return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(SLOWMODE_WAIT_DURATION_DESCRIPTOR, {duration: formatTime(retryAfter)})} data-flx="slowmode.slowmode-rate-limited-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/user/components/modals/tabs/my_profile_tab/AvatarUploader.tsx b/fluxer_app/src/features/user/components/modals/tabs/my_profile_tab/AvatarUploader.tsx index d5ede8cbb..5a3510fc0 100644 --- a/fluxer_app/src/features/user/components/modals/tabs/my_profile_tab/AvatarUploader.tsx +++ b/fluxer_app/src/features/user/components/modals/tabs/my_profile_tab/AvatarUploader.tsx @@ -1,5 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; import { ANIMATED_AVATAR_FORMATS, @@ -33,7 +34,6 @@ import { FAILED_TO_PROCESS_CROPPED_IMAGE_DESCRIPTOR, GET_PREMIUM_DESCRIPTOR, INVALID_IMAGE_TRY_ANOTHER_DESCRIPTOR, - UNDERSTOOD_DESCRIPTOR, } from '@app/features/i18n/utils/CommonMessageDescriptors'; import {openFilePicker} from '@app/features/messaging/utils/FilePickerUtils'; import * as PremiumModalCommands from '@app/features/premium/commands/PremiumModalCommands'; @@ -233,16 +233,14 @@ export const AvatarUploader = observer( } else { ModalCommands.push( modal(() => ( - Animated avatars ({ANIMATED_AVATAR_FORMATS}) are not available on this instance. Upload a static image instead. } - primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)} - onPrimary={() => {}} data-flx="user.my-profile-tab.avatar-uploader.handle-avatar-upload.confirm-modal--2" /> )), diff --git a/fluxer_app/src/features/voice/components/alerts/ScreenShareFailedModal.tsx b/fluxer_app/src/features/voice/components/alerts/ScreenShareFailedModal.tsx index 79b45899e..f249443a1 100644 --- a/fluxer_app/src/features/voice/components/alerts/ScreenShareFailedModal.tsx +++ b/fluxer_app/src/features/voice/components/alerts/ScreenShareFailedModal.tsx @@ -1,7 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {msg} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; @@ -19,13 +18,9 @@ const SCREEN_SHARING_FAILED_BODY_DESCRIPTOR = msg({ export const ScreenShareFailedModal = observer(() => { const {i18n} = useLingui(); return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(SCREEN_SHARING_FAILED_BODY_DESCRIPTOR)} data-flx="voice.screen-share-failed-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/voice/components/alerts/ScreenShareUnsupportedModal.tsx b/fluxer_app/src/features/voice/components/alerts/ScreenShareUnsupportedModal.tsx index 517d10342..f72046a68 100644 --- a/fluxer_app/src/features/voice/components/alerts/ScreenShareUnsupportedModal.tsx +++ b/fluxer_app/src/features/voice/components/alerts/ScreenShareUnsupportedModal.tsx @@ -1,7 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {msg} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; @@ -26,17 +25,13 @@ export const ScreenShareUnsupportedModal = observer( ({variant = 'unsupported'}: {variant?: 'unsupported' | 'portal-empty'}) => { const {i18n} = useLingui(); return ( - {}} - secondaryText={false} - hideCloseButton data-flx="voice.screen-share-unsupported-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/voice/components/alerts/TtsUnsupportedModal.tsx b/fluxer_app/src/features/voice/components/alerts/TtsUnsupportedModal.tsx index e1cad150b..9f20a4689 100644 --- a/fluxer_app/src/features/voice/components/alerts/TtsUnsupportedModal.tsx +++ b/fluxer_app/src/features/voice/components/alerts/TtsUnsupportedModal.tsx @@ -1,7 +1,6 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {msg} from '@lingui/core/macro'; import {useLingui} from '@lingui/react/macro'; import {observer} from 'mobx-react-lite'; @@ -19,13 +18,9 @@ const TEXT_TO_SPEECH_IS_NOT_SUPPORTED_BY_YOUR_DESCRIPTOR = msg({ export const TtsUnsupportedModal = observer(() => { const {i18n} = useLingui(); return ( - {}} - secondaryText={false} - hideCloseButton + message={i18n._(TEXT_TO_SPEECH_IS_NOT_SUPPORTED_BY_YOUR_DESCRIPTOR)} data-flx="voice.tts-unsupported-modal.confirm-modal" /> ); diff --git a/fluxer_app/src/features/voice/engine/v2/VoiceEngineV2AppScreenShareExecutionAdapter.tsx b/fluxer_app/src/features/voice/engine/v2/VoiceEngineV2AppScreenShareExecutionAdapter.tsx index b11667eb5..e5f6dbc2d 100644 --- a/fluxer_app/src/features/voice/engine/v2/VoiceEngineV2AppScreenShareExecutionAdapter.tsx +++ b/fluxer_app/src/features/voice/engine/v2/VoiceEngineV2AppScreenShareExecutionAdapter.tsx @@ -2,8 +2,7 @@ import assert from 'node:assert/strict'; import i18n from '@app/app/I18n'; -import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; -import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors'; +import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal'; import {SoundType} from '@app/features/notification/utils/SoundUtils'; import * as ModalCommands from '@app/features/ui/commands/ModalCommands'; import * as SoundCommands from '@app/features/ui/commands/SoundCommands'; @@ -524,12 +523,9 @@ class VoiceEngineV2AppScreenShareExecutionAdapter extends Store { showScreenShareEndedModalInternal(description: string): void { ModalCommands.pushWithKey( ModalCommands.modal(() => ( - {}} - secondaryText={false} + message={description} data-flx="voice.screen-share-manager.screen-share-ended-modal" /> )),