mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
fix(app): Make some modals use GenericErrorModal instead of ConfirmModal (#1023)
This commit is contained in:
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
|
||||
|
||||
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 (
|
||||
<ConfirmModal
|
||||
<GenericErrorModal
|
||||
title={i18n._(FEATURE_TEMPORARILY_DISABLED_DESCRIPTOR)}
|
||||
description={i18n._(THIS_FEATURE_HAS_BEEN_TEMPORARILY_DISABLED_PLEASE_TRY_DESCRIPTOR)}
|
||||
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
|
||||
onPrimary={() => {}}
|
||||
secondaryText={false}
|
||||
hideCloseButton
|
||||
message={i18n._(THIS_FEATURE_HAS_BEEN_TEMPORARILY_DISABLED_PLEASE_TRY_DESCRIPTOR)}
|
||||
data-flx="app.feature-temporarily-disabled-modal.confirm-modal"
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -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 (
|
||||
<ConfirmModal
|
||||
<GenericErrorModal
|
||||
title={i18n._(BOOKMARK_LIMIT_REACHED_DESCRIPTOR)}
|
||||
description={i18n._(YOU_VE_REACHED_THE_MAXIMUM_NUMBER_OF_BOOKMARKS_DESCRIPTOR, {bookmarksText})}
|
||||
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
|
||||
onPrimary={() => {}}
|
||||
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 (
|
||||
<ConfirmModal
|
||||
<GenericErrorModal
|
||||
title={i18n._(BOOKMARK_LIMIT_REACHED_DESCRIPTOR)}
|
||||
description={i18n._(YOU_VE_REACHED_THE_MAXIMUM_NUMBER_OF_BOOKMARKS_2_DESCRIPTOR, {bookmarksText})}
|
||||
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
|
||||
onPrimary={() => {}}
|
||||
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"
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -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 (
|
||||
<ConfirmModal
|
||||
<GenericErrorModal
|
||||
title={i18n._(SAVED_MEDIA_LIMIT_REACHED_DESCRIPTOR)}
|
||||
description={i18n._(YOU_VE_REACHED_THE_MAXIMUM_LIMIT_OF_THIS_DESCRIPTOR, {freeItemsText})}
|
||||
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
|
||||
onPrimary={() => {}}
|
||||
secondaryText={false}
|
||||
hideCloseButton
|
||||
message={i18n._(YOU_VE_REACHED_THE_MAXIMUM_LIMIT_OF_THIS_DESCRIPTOR, {freeItemsText})}
|
||||
data-flx="app.max-favorite-memes-modal.confirm-modal"
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -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 (
|
||||
<ConfirmModal
|
||||
<GenericErrorModal
|
||||
title={i18n._(ROLE_NAME_CANNOT_BE_BLANK_DESCRIPTOR)}
|
||||
description={i18n._(YOU_CANNOT_SAVE_A_ROLE_WITH_A_BLANK_DESCRIPTOR)}
|
||||
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
|
||||
onPrimary={() => {}}
|
||||
secondaryText={false}
|
||||
hideCloseButton
|
||||
message={i18n._(YOU_CANNOT_SAVE_A_ROLE_WITH_A_BLANK_DESCRIPTOR)}
|
||||
data-flx="app.role-name-blank-modal.confirm-modal"
|
||||
/>
|
||||
);
|
||||
|
||||
+3
-8
@@ -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 (
|
||||
<ConfirmModal
|
||||
<GenericErrorModal
|
||||
title={i18n._(GATEWAY_CONNECTION_REQUIRED_DESCRIPTOR)}
|
||||
description={i18n._(YOU_MUST_BE_CONNECTED_TO_THE_GATEWAY_TO_DESCRIPTOR)}
|
||||
primaryText={i18n._(UNDERSTOOD_DESCRIPTOR)}
|
||||
onPrimary={() => {}}
|
||||
secondaryText={false}
|
||||
hideCloseButton
|
||||
message={i18n._(YOU_MUST_BE_CONNECTED_TO_THE_GATEWAY_TO_DESCRIPTOR)}
|
||||
data-flx="app.temporary-invite-requires-presence-modal.confirm-modal"
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user