fix(app): Make some modals use GenericErrorModal instead of ConfirmModal (#1023)

This commit is contained in:
PilkeySEK authored and GitHub committed 2026-06-19 22:10:49 +01:00
1 parent fa3e852575
commit 0f3f059454
30 files changed
+99 -243

No files matched your search

@@ -1,10 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; import {observer} from 'mobx-react-lite';
import {GenericErrorModal} from './GenericErrorModal';
const FEATURE_TEMPORARILY_DISABLED_DESCRIPTOR = msg({ const FEATURE_TEMPORARILY_DISABLED_DESCRIPTOR = msg({
message: 'Feature temporarily disabled', message: 'Feature temporarily disabled',
@@ -17,13 +16,9 @@ const THIS_FEATURE_HAS_BEEN_TEMPORARILY_DISABLED_PLEASE_TRY_DESCRIPTOR = msg({
export const FeatureTemporarilyDisabledModal = observer(() => { export const FeatureTemporarilyDisabledModal = observer(() => {
const {i18n} = useLingui(); const {i18n} = useLingui();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(FEATURE_TEMPORARILY_DISABLED_DESCRIPTOR)} title={i18n._(FEATURE_TEMPORARILY_DISABLED_DESCRIPTOR)}
description={i18n._(THIS_FEATURE_HAS_BEEN_TEMPORARILY_DISABLED_PLEASE_TRY_DESCRIPTOR)} message={i18n._(THIS_FEATURE_HAS_BEEN_TEMPORARILY_DISABLED_PLEASE_TRY_DESCRIPTOR)}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="app.feature-temporarily-disabled-modal.confirm-modal" data-flx="app.feature-temporarily-disabled-modal.confirm-modal"
/> />
); );
@@ -3,7 +3,7 @@
import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal';
import {PREMIUM_PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants'; import {PREMIUM_PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants';
import {Limits} from '@app/features/app/utils/UserLimits'; 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 * as PremiumModalCommands from '@app/features/premium/commands/PremiumModalCommands';
import {shouldShowPremiumFeatures} from '@app/features/premium/utils/PremiumUtils'; import {shouldShowPremiumFeatures} from '@app/features/premium/utils/PremiumUtils';
import type {User} from '@app/features/user/models/User'; 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 {msg, plural} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; import {observer} from 'mobx-react-lite';
import {GenericErrorModal} from './GenericErrorModal';
const BOOKMARK_LIMIT_REACHED_DESCRIPTOR = msg({ const BOOKMARK_LIMIT_REACHED_DESCRIPTOR = msg({
message: 'Bookmark limit reached', message: 'Bookmark limit reached',
@@ -56,26 +57,18 @@ export const MaxBookmarksModal = observer(({user}: MaxBookmarksModalProps) => {
); );
if (!showPremium) { if (!showPremium) {
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(BOOKMARK_LIMIT_REACHED_DESCRIPTOR)} title={i18n._(BOOKMARK_LIMIT_REACHED_DESCRIPTOR)}
description={i18n._(YOU_VE_REACHED_THE_MAXIMUM_NUMBER_OF_BOOKMARKS_DESCRIPTOR, {bookmarksText})} message={i18n._(YOU_VE_REACHED_THE_MAXIMUM_NUMBER_OF_BOOKMARKS_DESCRIPTOR, {bookmarksText})}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="app.max-bookmarks-modal.confirm-modal" data-flx="app.max-bookmarks-modal.confirm-modal"
/> />
); );
} }
if (!canUpgradeBookmarks) { if (!canUpgradeBookmarks) {
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(BOOKMARK_LIMIT_REACHED_DESCRIPTOR)} title={i18n._(BOOKMARK_LIMIT_REACHED_DESCRIPTOR)}
description={i18n._(YOU_VE_REACHED_THE_MAXIMUM_NUMBER_OF_BOOKMARKS_2_DESCRIPTOR, {bookmarksText})} message={i18n._(YOU_VE_REACHED_THE_MAXIMUM_NUMBER_OF_BOOKMARKS_2_DESCRIPTOR, {bookmarksText})}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="app.max-bookmarks-modal.confirm-modal--2" data-flx="app.max-bookmarks-modal.confirm-modal--2"
/> />
); );
@@ -3,7 +3,7 @@
import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal';
import {PREMIUM_PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants'; import {PREMIUM_PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants';
import {Limits} from '@app/features/app/utils/UserLimits'; 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 * as PremiumModalCommands from '@app/features/premium/commands/PremiumModalCommands';
import {shouldShowPremiumFeatures} from '@app/features/premium/utils/PremiumUtils'; import {shouldShowPremiumFeatures} from '@app/features/premium/utils/PremiumUtils';
import Users from '@app/features/user/state/Users'; 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 {msg, plural} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; import {observer} from 'mobx-react-lite';
import {GenericErrorModal} from './GenericErrorModal';
const SAVED_MEDIA_LIMIT_REACHED_DESCRIPTOR = msg({ const SAVED_MEDIA_LIMIT_REACHED_DESCRIPTOR = msg({
message: 'Saved media limit reached', message: 'Saved media limit reached',
@@ -50,13 +51,9 @@ export const MaxFavoriteMemesModal = observer(() => {
); );
if (!showPremium) { if (!showPremium) {
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(SAVED_MEDIA_LIMIT_REACHED_DESCRIPTOR)} title={i18n._(SAVED_MEDIA_LIMIT_REACHED_DESCRIPTOR)}
description={i18n._(YOU_VE_REACHED_THE_MAXIMUM_LIMIT_OF_THIS_DESCRIPTOR, {freeItemsText})} message={i18n._(YOU_VE_REACHED_THE_MAXIMUM_LIMIT_OF_THIS_DESCRIPTOR, {freeItemsText})}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="app.max-favorite-memes-modal.confirm-modal" data-flx="app.max-favorite-memes-modal.confirm-modal"
/> />
); );
@@ -1,10 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; import {observer} from 'mobx-react-lite';
import {GenericErrorModal} from './GenericErrorModal';
const ROLE_NAME_CANNOT_BE_BLANK_DESCRIPTOR = msg({ const ROLE_NAME_CANNOT_BE_BLANK_DESCRIPTOR = msg({
message: 'Role name is required', message: 'Role name is required',
@@ -17,13 +16,9 @@ const YOU_CANNOT_SAVE_A_ROLE_WITH_A_BLANK_DESCRIPTOR = msg({
export const RoleNameBlankModal = observer(() => { export const RoleNameBlankModal = observer(() => {
const {i18n} = useLingui(); const {i18n} = useLingui();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(ROLE_NAME_CANNOT_BE_BLANK_DESCRIPTOR)} title={i18n._(ROLE_NAME_CANNOT_BE_BLANK_DESCRIPTOR)}
description={i18n._(YOU_CANNOT_SAVE_A_ROLE_WITH_A_BLANK_DESCRIPTOR)} message={i18n._(YOU_CANNOT_SAVE_A_ROLE_WITH_A_BLANK_DESCRIPTOR)}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="app.role-name-blank-modal.confirm-modal" data-flx="app.role-name-blank-modal.confirm-modal"
/> />
); );
@@ -1,10 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; import {observer} from 'mobx-react-lite';
import {GenericErrorModal} from './GenericErrorModal';
const GATEWAY_CONNECTION_REQUIRED_DESCRIPTOR = msg({ const GATEWAY_CONNECTION_REQUIRED_DESCRIPTOR = msg({
message: 'Gateway connection required', message: 'Gateway connection required',
@@ -18,13 +17,9 @@ const YOU_MUST_BE_CONNECTED_TO_THE_GATEWAY_TO_DESCRIPTOR = msg({
export const TemporaryInviteRequiresPresenceModal = observer(() => { export const TemporaryInviteRequiresPresenceModal = observer(() => {
const {i18n} = useLingui(); const {i18n} = useLingui();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(GATEWAY_CONNECTION_REQUIRED_DESCRIPTOR)} title={i18n._(GATEWAY_CONNECTION_REQUIRED_DESCRIPTOR)}
description={i18n._(YOU_MUST_BE_CONNECTED_TO_THE_GATEWAY_TO_DESCRIPTOR)} message={i18n._(YOU_MUST_BE_CONNECTED_TO_THE_GATEWAY_TO_DESCRIPTOR)}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="app.temporary-invite-requires-presence-modal.confirm-modal" data-flx="app.temporary-invite-requires-presence-modal.confirm-modal"
/> />
); );
@@ -2,7 +2,6 @@
import {Routes} from '@app/app/Routes'; import {Routes} from '@app/app/Routes';
import Accessibility from '@app/features/accessibility/state/Accessibility'; 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 {ChannelItem} from '@app/features/app/components/layout/ChannelItem';
import channelItemStyles from '@app/features/app/components/layout/ChannelItem.module.css'; import channelItemStyles from '@app/features/app/components/layout/ChannelItem.module.css';
import {ChannelItemContent} from '@app/features/app/components/layout/ChannelItemContent'; 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 Channels from '@app/features/channel/state/Channels';
import * as GuildCommands from '@app/features/guild/commands/GuildCommands'; import * as GuildCommands from '@app/features/guild/commands/GuildCommands';
import type {Guild} from '@app/features/guild/models/Guild'; 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 {isKeyboardActivationKey} from '@app/features/input/utils/KeyboardUtils';
import * as RouterUtils from '@app/features/navigation/utils/RouterUtils'; import * as RouterUtils from '@app/features/navigation/utils/RouterUtils';
import Permission from '@app/features/permissions/state/Permission'; import Permission from '@app/features/permissions/state/Permission';
@@ -58,6 +57,7 @@ import {observer} from 'mobx-react-lite';
import type {MotionValue} from 'motion'; import type {MotionValue} from 'motion';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import {useDragLayer} from 'react-dnd'; import {useDragLayer} from 'react-dnd';
import {GenericErrorModal} from '../alerts/GenericErrorModal';
const CATEGORY_FULL_DESCRIPTOR = msg({ const CATEGORY_FULL_DESCRIPTOR = msg({
message: 'Category full', message: 'Category full',
@@ -185,15 +185,11 @@ export const ChannelListContent = observer(({guild, scrollY}: {guild: Guild; scr
if (failureCode(error) === APIErrorCodes.MAX_CATEGORY_CHANNELS) { if (failureCode(error) === APIErrorCodes.MAX_CATEGORY_CHANNELS) {
ModalCommands.push( ModalCommands.push(
ModalCommands.modal(() => ( ModalCommands.modal(() => (
<ConfirmModal <GenericErrorModal
title={i18n._(CATEGORY_FULL_DESCRIPTOR)} title={i18n._(CATEGORY_FULL_DESCRIPTOR)}
description={i18n._(THIS_CATEGORY_ALREADY_CONTAINS_THE_MAXIMUM_OF_CHANNELS_DESCRIPTOR, { message={i18n._(THIS_CATEGORY_ALREADY_CONTAINS_THE_MAXIMUM_OF_CHANNELS_DESCRIPTOR, {
maxChannelsPerCategory: MAX_CHANNELS_PER_CATEGORY, maxChannelsPerCategory: MAX_CHANNELS_PER_CATEGORY,
})} })}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="app.channel-list-content.handle-channel-drop.confirm-modal" data-flx="app.channel-list-content.handle-channel-drop.confirm-modal"
/> />
)), )),
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {OKAY_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import * as ModalCommands from '@app/features/ui/commands/ModalCommands'; import * as ModalCommands from '@app/features/ui/commands/ModalCommands';
import {modal} from '@app/features/ui/commands/ModalCommands'; import {modal} from '@app/features/ui/commands/ModalCommands';
import {msg} from '@lingui/core/macro'; 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 ContentBlockedModal = observer(() => {
const {i18n} = useLingui(); const {i18n} = useLingui();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(CONTENT_BLOCKED_DESCRIPTOR)} title={i18n._(CONTENT_BLOCKED_DESCRIPTOR)}
description={i18n._(YOUR_ACTION_COULD_NOT_BE_COMPLETED_BECAUSE_IT_DESCRIPTOR)} message={i18n._(YOUR_ACTION_COULD_NOT_BE_COMPLETED_BECAUSE_IT_DESCRIPTOR)}
primaryText={i18n._(OKAY_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="auth.content-blocked-handler.content-blocked-modal.confirm-modal" data-flx="auth.content-blocked-handler.content-blocked-modal.confirm-modal"
/> />
); );
@@ -1,8 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {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 * as ModalCommands from '@app/features/ui/commands/ModalCommands';
import {modal} from '@app/features/ui/commands/ModalCommands'; import {modal} from '@app/features/ui/commands/ModalCommands';
import type {I18n} from '@lingui/core'; import type {I18n} from '@lingui/core';
@@ -21,16 +20,13 @@ interface ShowAnimatedAvifUnsupportedModalOptions {
export function showAnimatedAvifUnsupportedModal({i18n}: ShowAnimatedAvifUnsupportedModalOptions): void { export function showAnimatedAvifUnsupportedModal({i18n}: ShowAnimatedAvifUnsupportedModalOptions): void {
ModalCommands.push( ModalCommands.push(
modal(() => ( modal(() => (
<ConfirmModal <GenericErrorModal
title={i18n._(ANIMATED_NOT_SUPPORTED_DESCRIPTOR, {avifFormatLabel: AVIF_FORMAT_LABEL})} title={i18n._(ANIMATED_NOT_SUPPORTED_DESCRIPTOR, {avifFormatLabel: AVIF_FORMAT_LABEL})}
description={ message={
<Trans> <Trans>
Animated {AVIF_FORMAT_LABEL} files aren't supported. Upload a static {AVIF_FORMAT_LABEL} file instead. Animated {AVIF_FORMAT_LABEL} files aren't supported. Upload a static {AVIF_FORMAT_LABEL} file instead.
</Trans> </Trans>
} }
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
primaryVariant="primary"
onPrimary={() => {}}
data-flx="expressions.animated-avif-modal-utils.show-animated-avif-unsupported-modal.confirm-modal" data-flx="expressions.animated-avif-modal-utils.show-animated-avif-unsupported-modal.confirm-modal"
/> />
)), )),
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {msg} from '@lingui/core/macro'; import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; 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(() => { export const GuildAtCapacityModal = observer(() => {
const {i18n} = useLingui(); const {i18n} = useLingui();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(COMMUNITY_AT_CAPACITY_DESCRIPTOR)} title={i18n._(COMMUNITY_AT_CAPACITY_DESCRIPTOR)}
description={i18n._(THIS_COMMUNITY_HAS_REACHED_ITS_MAXIMUM_MEMBER_LIMIT_DESCRIPTOR)} message={i18n._(THIS_COMMUNITY_HAS_REACHED_ITS_MAXIMUM_MEMBER_LIMIT_DESCRIPTOR)}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="guild.guild-at-capacity-modal.confirm-modal" data-flx="guild.guild-at-capacity-modal.confirm-modal"
/> />
); );
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import type {User} from '@app/features/user/models/User'; import type {User} from '@app/features/user/models/User';
import {msg, plural} from '@lingui/core/macro'; import {msg, plural} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
@@ -20,9 +19,9 @@ export const MaxGuildsModal = observer(({user}: MaxGuildsModalProps) => {
const {i18n} = useLingui(); const {i18n} = useLingui();
const maxGuilds = user.maxGuilds; const maxGuilds = user.maxGuilds;
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(TOO_MANY_COMMUNITIES_DESCRIPTOR)} title={i18n._(TOO_MANY_COMMUNITIES_DESCRIPTOR)}
description={plural( message={plural(
{count: maxGuilds}, {count: maxGuilds},
{ {
one: "You've reached the maximum number of communities you can join (# community). Leave a community before joining another one.", one: "You've reached the maximum number of communities you can join (# community). Leave a community before joining another one.",
@@ -30,10 +29,6 @@ export const MaxGuildsModal = observer(({user}: MaxGuildsModalProps) => {
"You've reached the maximum number of communities you can join (# communities). Leave a community before joining another one.", "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" data-flx="guild.max-guilds-modal.confirm-modal"
/> />
); );
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {OKAY_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {msg} from '@lingui/core/macro'; import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; 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(() => { export const NewAccountGuildLimitModal = observer(() => {
const {i18n} = useLingui(); const {i18n} = useLingui();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(SLOW_DOWN_DESCRIPTOR)} title={i18n._(SLOW_DOWN_DESCRIPTOR)}
description={i18n._(NEW_ACCOUNTS_ARE_LIMITED_TO_JOINING_10_COMMUNITIES_DESCRIPTOR)} message={i18n._(NEW_ACCOUNTS_ARE_LIMITED_TO_JOINING_10_COMMUNITIES_DESCRIPTOR)}
primaryText={i18n._(OKAY_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="guild.new-account-guild-limit-modal.confirm-modal" data-flx="guild.new-account-guild-limit-modal.confirm-modal"
/> />
); );
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal';
import {GlobalLimits} from '@app/features/app/utils/GlobalLimits'; import {GlobalLimits} from '@app/features/app/utils/GlobalLimits';
import {EmojiListHeader, EmojiListItem} from '@app/features/emoji/components/emojis/EmojiListItem'; 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 {UploadDropZone} from '@app/features/guild/components/UploadDropZone';
import {UploadSlotInfo} from '@app/features/guild/components/UploadSlotInfo'; import {UploadSlotInfo} from '@app/features/guild/components/UploadSlotInfo';
import Guilds from '@app/features/guild/state/Guilds'; 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 {openFilePicker} from '@app/features/messaging/utils/FilePickerUtils';
import {formatFileSize} from '@app/features/messaging/utils/FileUtils'; import {formatFileSize} from '@app/features/messaging/utils/FileUtils';
import Permission from '@app/features/permissions/state/Permission'; import Permission from '@app/features/permissions/state/Permission';
@@ -251,11 +252,9 @@ const GuildEmojiTab: React.FC<{guildId: string}> = observer(function GuildEmojiT
if (availableSlots <= 0) { if (availableSlots <= 0) {
ModalCommands.push( ModalCommands.push(
modal(() => ( modal(() => (
<ConfirmModal <GenericErrorModal
title={i18n._(NO_EMOJI_SLOTS_AVAILABLE_DESCRIPTOR)} title={i18n._(NO_EMOJI_SLOTS_AVAILABLE_DESCRIPTOR)}
description={i18n._(EMOJI_SLOTS_FULL_DESCRIPTION_DESCRIPTOR)} message={i18n._(EMOJI_SLOTS_FULL_DESCRIPTION_DESCRIPTOR)}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
data-flx="guild.guild-tabs.guild-emoji-tab.handle-file-select.confirm-modal" data-flx="guild.guild-tabs.guild-emoji-tab.handle-file-select.confirm-modal"
/> />
)), )),
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal';
import {StatusSlate} from '@app/features/app/components/dialogs/shared/StatusSlate'; import {StatusSlate} from '@app/features/app/components/dialogs/shared/StatusSlate';
import {GlobalLimits} from '@app/features/app/utils/GlobalLimits'; 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 {UploadDropZone} from '@app/features/guild/components/UploadDropZone';
import {UploadSlotInfo} from '@app/features/guild/components/UploadSlotInfo'; import {UploadSlotInfo} from '@app/features/guild/components/UploadSlotInfo';
import Guilds from '@app/features/guild/state/Guilds'; import Guilds from '@app/features/guild/state/Guilds';
import { import {OKAY_DESCRIPTOR, TRY_AGAIN_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
OKAY_DESCRIPTOR,
TRY_AGAIN_DESCRIPTOR,
UNDERSTOOD_DESCRIPTOR,
} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {openFilePicker} from '@app/features/messaging/utils/FilePickerUtils'; import {openFilePicker} from '@app/features/messaging/utils/FilePickerUtils';
import {formatFileSize} from '@app/features/messaging/utils/FileUtils'; import {formatFileSize} from '@app/features/messaging/utils/FileUtils';
import Permission from '@app/features/permissions/state/Permission'; import Permission from '@app/features/permissions/state/Permission';
@@ -163,11 +160,9 @@ const GuildStickersTab: React.FC<{guildId: string}> = observer(function GuildSti
const showNoStickerSlotsModal = useCallback(() => { const showNoStickerSlotsModal = useCallback(() => {
ModalCommands.push( ModalCommands.push(
modal(() => ( modal(() => (
<ConfirmModal <GenericErrorModal
title={i18n._(NO_STICKER_SLOTS_AVAILABLE_DESCRIPTOR)} title={i18n._(NO_STICKER_SLOTS_AVAILABLE_DESCRIPTOR)}
description={i18n._(STICKER_SLOTS_FULL_DESCRIPTION_DESCRIPTOR)} message={i18n._(STICKER_SLOTS_FULL_DESCRIPTION_DESCRIPTOR)}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
data-flx="guild.guild-tabs.guild-stickers-tab.no-sticker-slots-confirm-modal" data-flx="guild.guild-tabs.guild-stickers-tab.no-sticker-slots-confirm-modal"
/> />
)), )),
@@ -1,8 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants';
import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {msg} from '@lingui/core/macro'; import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; import {observer} from 'mobx-react-lite';
@@ -27,17 +26,13 @@ interface InvitesDisabledModalProps {
export const InvitesDisabledModal = observer(({isRaidDetected = false}: InvitesDisabledModalProps) => { export const InvitesDisabledModal = observer(({isRaidDetected = false}: InvitesDisabledModalProps) => {
const {i18n} = useLingui(); const {i18n} = useLingui();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(INVITES_PAUSED_DESCRIPTOR)} title={i18n._(INVITES_PAUSED_DESCRIPTOR)}
description={ message={
isRaidDetected isRaidDetected
? i18n._(DETECTED_A_POTENTIAL_RAID_IN_THIS_COMMUNITY_SO_DESCRIPTOR, {productName: PRODUCT_NAME}) ? i18n._(DETECTED_A_POTENTIAL_RAID_IN_THIS_COMMUNITY_SO_DESCRIPTOR, {productName: PRODUCT_NAME})
: i18n._(COMMUNITY_ADMINS_HAVE_PAUSED_INVITES_SO_YOU_CAN_DESCRIPTOR) : i18n._(COMMUNITY_ADMINS_HAVE_PAUSED_INVITES_SO_YOU_CAN_DESCRIPTOR)
} }
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="invite.invites-disabled-modal.confirm-modal" data-flx="invite.invites-disabled-modal.confirm-modal"
/> />
); );
@@ -1,10 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 { import {CANNOT_SEND_MESSAGES_IN_CHANNEL_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
CANNOT_SEND_MESSAGES_IN_CHANNEL_DESCRIPTOR,
UNDERSTOOD_DESCRIPTOR,
} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {msg} from '@lingui/core/macro'; import {msg} from '@lingui/core/macro';
import {Trans, useLingui} from '@lingui/react/macro'; import {Trans, useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; import {observer} from 'mobx-react-lite';
@@ -46,13 +43,9 @@ export const AttachmentPermissionDeniedModal = observer(
i18n._(CANNOT_SEND_MESSAGES_IN_CHANNEL_DESCRIPTOR) i18n._(CANNOT_SEND_MESSAGES_IN_CHANNEL_DESCRIPTOR)
); );
return ( return (
<ConfirmModal <GenericErrorModal
title={title} title={title}
description={description} message={description}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="messaging.attachment-permission-denied-modal.confirm-modal" data-flx="messaging.attachment-permission-denied-modal.confirm-modal"
/> />
); );
@@ -1,9 +1,8 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {ExternalLink} from '@app/features/app/components/shared/ExternalLink';
import {PRODUCT_NAME, SUPPORT_EMAIL, SUPPORT_EMAIL_MAILTO} from '@app/features/app/config/I18nDisplayConstants'; 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 {MULTIPART_ATTACHMENT_FALLBACK_MAX_REQUEST_SIZE} from '@app/features/messaging/utils/AttachmentUploadFallbackUtils';
import {formatFileSize} from '@app/features/messaging/utils/FileUtils'; import {formatFileSize} from '@app/features/messaging/utils/FileUtils';
import {msg} from '@lingui/core/macro'; import {msg} from '@lingui/core/macro';
@@ -18,9 +17,9 @@ export const AttachmentUploadConnectivityModal = observer(() => {
const {i18n} = useLingui(); const {i18n} = useLingui();
const fallbackSizeFormatted = formatFileSize(MULTIPART_ATTACHMENT_FALLBACK_MAX_REQUEST_SIZE); const fallbackSizeFormatted = formatFileSize(MULTIPART_ATTACHMENT_FALLBACK_MAX_REQUEST_SIZE);
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(ATTACHMENT_UPLOAD_UNAVAILABLE_DESCRIPTOR)} title={i18n._(ATTACHMENT_UPLOAD_UNAVAILABLE_DESCRIPTOR)}
description={ message={
<Trans> <Trans>
We couldn't reach the attachment upload service. {PRODUCT_NAME} can fall back to the standard upload path for 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 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. if this keeps happening.
</Trans> </Trans>
} }
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="messaging.attachment-upload-connectivity-modal.confirm-modal" data-flx="messaging.attachment-upload-connectivity-modal.confirm-modal"
/> />
); );
@@ -1,13 +1,10 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal';
import {PREMIUM_PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants'; import {PREMIUM_PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants';
import {Limits} from '@app/features/app/utils/UserLimits'; import {Limits} from '@app/features/app/utils/UserLimits';
import { import {CANCEL_DESCRIPTOR, GET_PREMIUM_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
CANCEL_DESCRIPTOR,
GET_PREMIUM_DESCRIPTOR,
UNDERSTOOD_DESCRIPTOR,
} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {formatFileSize} from '@app/features/messaging/utils/FileUtils'; import {formatFileSize} from '@app/features/messaging/utils/FileUtils';
import * as PremiumModalCommands from '@app/features/premium/commands/PremiumModalCommands'; import * as PremiumModalCommands from '@app/features/premium/commands/PremiumModalCommands';
import {shouldShowPremiumFeatures} from '@app/features/premium/utils/PremiumUtils'; 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}); : i18n._(ONE_OR_MORE_FILES_YOU_RE_TRYING_TO_DESCRIPTOR, {maxSizeFormatted});
if (!showPremium || !canUpgradeAttachmentLimit) { if (!showPremium || !canUpgradeAttachmentLimit) {
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(FILE_SIZE_TOO_LARGE_DESCRIPTOR)} title={i18n._(FILE_SIZE_TOO_LARGE_DESCRIPTOR)}
description={!showPremium ? `${baseDescription} ${i18n._(INSTANCE_ADMIN_LIMIT_DESCRIPTOR)}` : baseDescription} message={!showPremium ? `${baseDescription} ${i18n._(INSTANCE_ADMIN_LIMIT_DESCRIPTOR)}` : baseDescription}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="messaging.file-size-too-large-modal.confirm-modal" data-flx="messaging.file-size-too-large-modal.confirm-modal"
/> />
); );
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {OKAY_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {msg} from '@lingui/core/macro'; import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; import {observer} from 'mobx-react-lite';
@@ -17,13 +16,9 @@ const WAIT_A_MOMENT_BEFORE_DELETING_MORE_MESSAGES_DESCRIPTOR = msg({
export const MessageDeleteTooQuickModal = observer(() => { export const MessageDeleteTooQuickModal = observer(() => {
const {i18n} = useLingui(); const {i18n} = useLingui();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(YOU_RE_DELETING_MESSAGES_TOO_QUICKLY_DESCRIPTOR)} title={i18n._(YOU_RE_DELETING_MESSAGES_TOO_QUICKLY_DESCRIPTOR)}
description={i18n._(WAIT_A_MOMENT_BEFORE_DELETING_MORE_MESSAGES_DESCRIPTOR)} message={i18n._(WAIT_A_MOMENT_BEFORE_DELETING_MORE_MESSAGES_DESCRIPTOR)}
primaryText={i18n._(OKAY_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="messaging.message-delete-too-quick-modal.confirm-modal" data-flx="messaging.message-delete-too-quick-modal.confirm-modal"
/> />
); );
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import Users from '@app/features/user/state/Users'; import Users from '@app/features/user/state/Users';
import {msg, plural} from '@lingui/core/macro'; import {msg, plural} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
@@ -16,19 +15,15 @@ export const TooManyAttachmentsModal = observer(() => {
const currentUser = Users.currentUser; const currentUser = Users.currentUser;
const maxAttachments = currentUser?.maxAttachmentsPerMessage ?? 10; const maxAttachments = currentUser?.maxAttachmentsPerMessage ?? 10;
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(WHOA_THIS_IS_HEAVY_DESCRIPTOR)} title={i18n._(WHOA_THIS_IS_HEAVY_DESCRIPTOR)}
description={plural( message={plural(
{count: maxAttachments}, {count: maxAttachments},
{ {
one: 'You can only upload # file at a time. Try again with fewer files.', one: 'You can only upload # file at a time. Try again with fewer files.',
other: 'You can only upload # files at a time. Try again with fewer files.', other: 'You can only upload # files at a time. Try again with fewer files.',
}, },
)} )}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="messaging.too-many-attachments-modal.confirm-modal" data-flx="messaging.too-many-attachments-modal.confirm-modal"
/> />
); );
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {msg} from '@lingui/core/macro'; import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; 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(() => { export const TooManyReactionsModal = observer(() => {
const {i18n} = useLingui(); const {i18n} = useLingui();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(WHOA_THIS_IS_HEAVY_DESCRIPTOR)} title={i18n._(WHOA_THIS_IS_HEAVY_DESCRIPTOR)}
description={i18n._(THIS_IS_ONE_HEAVY_MESSAGE_SOME_REACTIONS_NEED_DESCRIPTOR)} message={i18n._(THIS_IS_ONE_HEAVY_MESSAGE_SOME_REACTIONS_NEED_DESCRIPTOR)}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="messaging.too-many-reactions-modal.confirm-modal" data-flx="messaging.too-many-reactions-modal.confirm-modal"
/> />
); );
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {msg} from '@lingui/core/macro'; import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; 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(() => { export const MatureContentRejectedModal = observer(() => {
const {i18n} = useLingui(); const {i18n} = useLingui();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(MATURE_CONTENT_NOT_ALLOWED_DESCRIPTOR)} title={i18n._(MATURE_CONTENT_NOT_ALLOWED_DESCRIPTOR)}
description={i18n._(THIS_CHANNEL_IS_NOT_MARKED_FOR_MATURE_CONTENT_DESCRIPTOR)} message={i18n._(THIS_CHANNEL_IS_NOT_MARKED_FOR_MATURE_CONTENT_DESCRIPTOR)}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="moderation.mature-content-rejected-modal.confirm-modal" data-flx="moderation.mature-content-rejected-modal.confirm-modal"
/> />
); );
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {msg} from '@lingui/core/macro'; import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; 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(() => { export const UserBannedFromGuildModal = observer(() => {
const {i18n} = useLingui(); const {i18n} = useLingui();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(YOU_RE_BANNED_DESCRIPTOR)} title={i18n._(YOU_RE_BANNED_DESCRIPTOR)}
description={i18n._(YOU_ARE_BANNED_FROM_THIS_COMMUNITY_AND_CANNOT_DESCRIPTOR)} message={i18n._(YOU_ARE_BANNED_FROM_THIS_COMMUNITY_AND_CANNOT_DESCRIPTOR)}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="moderation.user-banned-from-guild-modal.confirm-modal" data-flx="moderation.user-banned-from-guild-modal.confirm-modal"
/> />
); );
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {msg} from '@lingui/core/macro'; import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; 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(() => { export const UserIpBannedFromGuildModal = observer(() => {
const {i18n} = useLingui(); const {i18n} = useLingui();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(YOUR_IP_IS_BANNED_DESCRIPTOR)} title={i18n._(YOUR_IP_IS_BANNED_DESCRIPTOR)}
description={i18n._(YOUR_IP_ADDRESS_IS_BANNED_FROM_THIS_COMMUNITY_DESCRIPTOR)} message={i18n._(YOUR_IP_ADDRESS_IS_BANNED_FROM_THIS_COMMUNITY_DESCRIPTOR)}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="moderation.user-ip-banned-from-guild-modal.confirm-modal" data-flx="moderation.user-ip-banned-from-guild-modal.confirm-modal"
/> />
); );
@@ -1,8 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {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 {isDesktop} from '@app/features/ui/utils/NativeUtils';
import {msg} from '@lingui/core/macro'; import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
@@ -74,13 +73,9 @@ export const MediaPermissionBlockedModal = observer(({kind}: {kind: MediaPermiss
const {i18n} = useLingui(); const {i18n} = useLingui();
const desktop = isDesktop(); const desktop = isDesktop();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(titleDescriptorForKind(kind))} title={i18n._(titleDescriptorForKind(kind))}
description={i18n._(bodyDescriptorForKind(kind, desktop), {productName: PRODUCT_NAME})} message={i18n._(bodyDescriptorForKind(kind, desktop), {productName: PRODUCT_NAME})}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="permissions.media-permission-blocked-modal.confirm-modal" data-flx="permissions.media-permission-blocked-modal.confirm-modal"
/> />
); );
@@ -1,10 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 { import {
MINUTES_AND_SECONDS_DURATION_DESCRIPTOR, MINUTES_AND_SECONDS_DURATION_DESCRIPTOR,
MINUTES_DURATION_PLURAL_DESCRIPTOR, MINUTES_DURATION_PLURAL_DESCRIPTOR,
OKAY_DESCRIPTOR,
SECONDS_DURATION_PLURAL_DESCRIPTOR, SECONDS_DURATION_PLURAL_DESCRIPTOR,
} from '@app/features/i18n/utils/CommonMessageDescriptors'; } from '@app/features/i18n/utils/CommonMessageDescriptors';
import {msg} from '@lingui/core/macro'; 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 i18n._(MINUTES_AND_SECONDS_DURATION_DESCRIPTOR, {minutes, seconds: remainingSeconds});
}; };
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(SLOWMODE_ACTIVE_DESCRIPTOR)} title={i18n._(SLOWMODE_ACTIVE_DESCRIPTOR)}
description={i18n._(SLOWMODE_WAIT_DURATION_DESCRIPTOR, {duration: formatTime(retryAfter)})} message={i18n._(SLOWMODE_WAIT_DURATION_DESCRIPTOR, {duration: formatTime(retryAfter)})}
primaryText={i18n._(OKAY_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="slowmode.slowmode-rate-limited-modal.confirm-modal" data-flx="slowmode.slowmode-rate-limited-modal.confirm-modal"
/> />
); );
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal';
import { import {
ANIMATED_AVATAR_FORMATS, ANIMATED_AVATAR_FORMATS,
@@ -33,7 +34,6 @@ import {
FAILED_TO_PROCESS_CROPPED_IMAGE_DESCRIPTOR, FAILED_TO_PROCESS_CROPPED_IMAGE_DESCRIPTOR,
GET_PREMIUM_DESCRIPTOR, GET_PREMIUM_DESCRIPTOR,
INVALID_IMAGE_TRY_ANOTHER_DESCRIPTOR, INVALID_IMAGE_TRY_ANOTHER_DESCRIPTOR,
UNDERSTOOD_DESCRIPTOR,
} from '@app/features/i18n/utils/CommonMessageDescriptors'; } from '@app/features/i18n/utils/CommonMessageDescriptors';
import {openFilePicker} from '@app/features/messaging/utils/FilePickerUtils'; import {openFilePicker} from '@app/features/messaging/utils/FilePickerUtils';
import * as PremiumModalCommands from '@app/features/premium/commands/PremiumModalCommands'; import * as PremiumModalCommands from '@app/features/premium/commands/PremiumModalCommands';
@@ -233,16 +233,14 @@ export const AvatarUploader = observer(
} else { } else {
ModalCommands.push( ModalCommands.push(
modal(() => ( modal(() => (
<ConfirmModal <GenericErrorModal
title={i18n._(ANIMATED_AVATARS_NOT_AVAILABLE_DESCRIPTOR)} title={i18n._(ANIMATED_AVATARS_NOT_AVAILABLE_DESCRIPTOR)}
description={ message={
<Trans> <Trans>
Animated avatars ({ANIMATED_AVATAR_FORMATS}) are not available on this instance. Upload a static Animated avatars ({ANIMATED_AVATAR_FORMATS}) are not available on this instance. Upload a static
image instead. image instead.
</Trans> </Trans>
} }
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
data-flx="user.my-profile-tab.avatar-uploader.handle-avatar-upload.confirm-modal--2" data-flx="user.my-profile-tab.avatar-uploader.handle-avatar-upload.confirm-modal--2"
/> />
)), )),
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {msg} from '@lingui/core/macro'; import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; import {observer} from 'mobx-react-lite';
@@ -19,13 +18,9 @@ const SCREEN_SHARING_FAILED_BODY_DESCRIPTOR = msg({
export const ScreenShareFailedModal = observer(() => { export const ScreenShareFailedModal = observer(() => {
const {i18n} = useLingui(); const {i18n} = useLingui();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(SCREEN_SHARING_FAILED_DESCRIPTOR)} title={i18n._(SCREEN_SHARING_FAILED_DESCRIPTOR)}
description={i18n._(SCREEN_SHARING_FAILED_BODY_DESCRIPTOR)} message={i18n._(SCREEN_SHARING_FAILED_BODY_DESCRIPTOR)}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="voice.screen-share-failed-modal.confirm-modal" data-flx="voice.screen-share-failed-modal.confirm-modal"
/> />
); );
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {msg} from '@lingui/core/macro'; import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; import {observer} from 'mobx-react-lite';
@@ -26,17 +25,13 @@ export const ScreenShareUnsupportedModal = observer(
({variant = 'unsupported'}: {variant?: 'unsupported' | 'portal-empty'}) => { ({variant = 'unsupported'}: {variant?: 'unsupported' | 'portal-empty'}) => {
const {i18n} = useLingui(); const {i18n} = useLingui();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(SCREEN_SHARING_NOT_SUPPORTED_DESCRIPTOR)} title={i18n._(SCREEN_SHARING_NOT_SUPPORTED_DESCRIPTOR)}
description={i18n._( message={i18n._(
variant === 'portal-empty' variant === 'portal-empty'
? SCREEN_SHARING_PORTAL_EMPTY_DESCRIPTOR ? SCREEN_SHARING_PORTAL_EMPTY_DESCRIPTOR
: SCREEN_SHARING_IS_NOT_SUPPORTED_ON_THIS_DEVICE_DESCRIPTOR, : SCREEN_SHARING_IS_NOT_SUPPORTED_ON_THIS_DEVICE_DESCRIPTOR,
)} )}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="voice.screen-share-unsupported-modal.confirm-modal" data-flx="voice.screen-share-unsupported-modal.confirm-modal"
/> />
); );
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // 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 {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {msg} from '@lingui/core/macro'; import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro'; import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite'; 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(() => { export const TtsUnsupportedModal = observer(() => {
const {i18n} = useLingui(); const {i18n} = useLingui();
return ( return (
<ConfirmModal <GenericErrorModal
title={i18n._(TEXT_TO_SPEECH_NOT_SUPPORTED_DESCRIPTOR)} title={i18n._(TEXT_TO_SPEECH_NOT_SUPPORTED_DESCRIPTOR)}
description={i18n._(TEXT_TO_SPEECH_IS_NOT_SUPPORTED_BY_YOUR_DESCRIPTOR)} message={i18n._(TEXT_TO_SPEECH_IS_NOT_SUPPORTED_BY_YOUR_DESCRIPTOR)}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
hideCloseButton
data-flx="voice.tts-unsupported-modal.confirm-modal" data-flx="voice.tts-unsupported-modal.confirm-modal"
/> />
); );
@@ -2,8 +2,7 @@
import assert from 'node:assert/strict'; import assert from 'node:assert/strict';
import i18n from '@app/app/I18n'; import i18n from '@app/app/I18n';
import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal'; import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal';
import {UNDERSTOOD_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
import {SoundType} from '@app/features/notification/utils/SoundUtils'; import {SoundType} from '@app/features/notification/utils/SoundUtils';
import * as ModalCommands from '@app/features/ui/commands/ModalCommands'; import * as ModalCommands from '@app/features/ui/commands/ModalCommands';
import * as SoundCommands from '@app/features/ui/commands/SoundCommands'; import * as SoundCommands from '@app/features/ui/commands/SoundCommands';
@@ -524,12 +523,9 @@ class VoiceEngineV2AppScreenShareExecutionAdapter extends Store {
showScreenShareEndedModalInternal(description: string): void { showScreenShareEndedModalInternal(description: string): void {
ModalCommands.pushWithKey( ModalCommands.pushWithKey(
ModalCommands.modal(() => ( ModalCommands.modal(() => (
<ConfirmModal <GenericErrorModal
title={i18n._(SCREEN_SHARE_ENDED_DESCRIPTOR)} title={i18n._(SCREEN_SHARE_ENDED_DESCRIPTOR)}
description={description} message={description}
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
onPrimary={() => {}}
secondaryText={false}
data-flx="voice.screen-share-manager.screen-share-ended-modal" data-flx="voice.screen-share-manager.screen-share-ended-modal"
/> />
)), )),