diff --git a/packages/console/src/ds-components/CardTitle/index.module.scss b/packages/console/src/ds-components/CardTitle/index.module.scss index 8cc4bc614..7b72f0777 100644 --- a/packages/console/src/ds-components/CardTitle/index.module.scss +++ b/packages/console/src/ds-components/CardTitle/index.module.scss @@ -5,6 +5,9 @@ .title { color: var(--color-text); + display: flex; + align-items: center; + gap: _.unit(2); } .titleEllipsis { diff --git a/packages/console/src/ds-components/CardTitle/index.tsx b/packages/console/src/ds-components/CardTitle/index.tsx index 1c20e3c32..5b38820b7 100644 --- a/packages/console/src/ds-components/CardTitle/index.tsx +++ b/packages/console/src/ds-components/CardTitle/index.tsx @@ -1,6 +1,6 @@ import type { AdminConsoleKey } from '@logto/phrases'; import classNames from 'classnames'; -import type { ReactElement } from 'react'; +import type { ReactElement, ReactNode } from 'react'; import { useTranslation } from 'react-i18next'; import type DangerousRaw from '../DangerousRaw'; @@ -12,6 +12,7 @@ import * as styles from './index.module.scss'; export type Props = { title: AdminConsoleKey | ReactElement; subtitle?: AdminConsoleKey | ReactElement; + titleTag?: ReactNode; size?: 'small' | 'medium' | 'large'; learnMoreLink?: string; isWordWrapEnabled?: boolean; @@ -24,6 +25,7 @@ export type Props = { function CardTitle({ title, subtitle, + titleTag, size = 'large', isWordWrapEnabled = false, learnMoreLink, @@ -35,6 +37,7 @@ function CardTitle({
{typeof title === 'string' ? : title} + {titleTag}
{Boolean(subtitle ?? learnMoreLink) && (
diff --git a/packages/console/src/pages/Mfa/PageWrapper/index.tsx b/packages/console/src/pages/Mfa/PageWrapper/index.tsx index 42d83ff4d..d19d93d43 100644 --- a/packages/console/src/pages/Mfa/PageWrapper/index.tsx +++ b/packages/console/src/pages/Mfa/PageWrapper/index.tsx @@ -1,7 +1,11 @@ -import { type ReactNode } from 'react'; +import { conditional } from '@silverhand/essentials'; +import { useContext, type ReactNode } from 'react'; import PageMeta from '@/components/PageMeta'; +import ProTag from '@/components/ProTag'; +import { TenantsContext } from '@/contexts/TenantsProvider'; import CardTitle from '@/ds-components/CardTitle'; +import useSubscriptionPlan from '@/hooks/use-subscription-plan'; import * as styles from './index.module.scss'; @@ -10,10 +14,20 @@ type Props = { }; function PageWrapper({ children }: Props) { + const { currentTenantId } = useContext(TenantsContext); + const { data: currentPlan } = useSubscriptionPlan(currentTenantId); + // Note: fallback to true for OSS version + const isMfaEnabled = currentPlan?.quota.mfaEnabled ?? true; + return (
- + )} + subtitle="mfa.description" + className={styles.cardTitle} + /> {children}
);