mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
fix(console): display mfa feature item in downgrade plan modal (#4922)
This commit is contained in:
parent
15fd06fb4b
commit
27fc7b9a3b
2 changed files with 3 additions and 22 deletions
|
@ -3,7 +3,6 @@ import { useMemo } from 'react';
|
|||
import { Trans, useTranslation } from 'react-i18next';
|
||||
|
||||
import PlanName from '@/components/PlanName';
|
||||
import { isDevFeaturesEnabled } from '@/consts/env';
|
||||
import { type SubscriptionPlan } from '@/types/subscriptions';
|
||||
|
||||
import PlanQuotaDiffCard from './PlanQuotaDiffCard';
|
||||
|
@ -17,19 +16,9 @@ type Props = {
|
|||
function DowngradeConfirmModalContent({ currentPlan, targetPlan }: Props) {
|
||||
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
|
||||
|
||||
const {
|
||||
quota: currentFullQuota,
|
||||
quota: { mfaEnabled: currentMfaEnabled, ...currentQuotaWithoutMfa },
|
||||
name: currentPlanName,
|
||||
} = currentPlan;
|
||||
const currentQuota = isDevFeaturesEnabled ? currentFullQuota : currentQuotaWithoutMfa;
|
||||
const { quota: currentQuota, name: currentPlanName } = currentPlan;
|
||||
|
||||
const {
|
||||
quota: targetFullQuota,
|
||||
quota: { mfaEnabled: targetMfaEnabled, ...targetQuotaWithoutMfa },
|
||||
name: targetPlanName,
|
||||
} = targetPlan;
|
||||
const targetQuota = isDevFeaturesEnabled ? targetFullQuota : targetQuotaWithoutMfa;
|
||||
const { quota: targetQuota, name: targetPlanName } = targetPlan;
|
||||
|
||||
const currentQuotaDiff = useMemo(
|
||||
() => diff(targetQuota, currentQuota),
|
||||
|
|
|
@ -5,7 +5,6 @@ import { Trans, useTranslation } from 'react-i18next';
|
|||
|
||||
import ContactUsPhraseLink from '@/components/ContactUsPhraseLink';
|
||||
import PlanName from '@/components/PlanName';
|
||||
import { isDevFeaturesEnabled } from '@/consts/env';
|
||||
import { planQuotaItemOrder } from '@/consts/plan-quotas';
|
||||
import {
|
||||
quotaItemLimitedPhrasesMap,
|
||||
|
@ -33,14 +32,7 @@ function NotEligibleSwitchPlanModalContent({ targetPlan, isDowngrade = false }:
|
|||
keyPrefix: 'admin_console.subscription.not_eligible_modal',
|
||||
});
|
||||
|
||||
const {
|
||||
id,
|
||||
name,
|
||||
quota: fullQuota,
|
||||
quota: { mfaEnabled, ...quotaWithoutMfa },
|
||||
} = targetPlan;
|
||||
|
||||
const quota = isDevFeaturesEnabled ? fullQuota : quotaWithoutMfa;
|
||||
const { id, name, quota } = targetPlan;
|
||||
|
||||
const orderedEntries = useMemo(() => {
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
|
|
Loading…
Reference in a new issue