0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

refactor(console): update feature tag in card titles (#5136)

This commit is contained in:
Xiao Yijun 2023-12-21 14:29:43 +08:00 committed by GitHub
parent 8a457f3045
commit 1729def3dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 11 deletions

View file

@ -76,12 +76,12 @@ function GuideCard({ data, onClick, hasBorder, hasButton }: Props) {
<div className={styles.infoWrapper}> <div className={styles.infoWrapper}>
<div className={styles.flexRow}> <div className={styles.flexRow}>
<div className={styles.name}>{name}</div> <div className={styles.name}>{name}</div>
{hasPaywall && ( {/**
<FeatureTag * Todo @xiaoyijun [Pricing] Remove feature flag
isVisible={isM2mDisabled} * Note: In the new pricing plan, the machine to machine feature is available for Free plan.
for="upsell" */}
plan={isDevFeaturesEnabled ? ReservedPlanId.Pro : ReservedPlanId.Hobby} {hasPaywall && !isDevFeaturesEnabled && (
/> <FeatureTag isVisible={isM2mDisabled} for="upsell" plan={ReservedPlanId.Hobby} />
)} )}
</div> </div>
<div className={styles.description} title={description}> <div className={styles.description} title={description}>

View file

@ -12,7 +12,7 @@ import EnterpriseSsoConnectorEmpty from '@/assets/images/sso-connector-empty.svg
import ItemPreview from '@/components/ItemPreview'; import ItemPreview from '@/components/ItemPreview';
import ListPage from '@/components/ListPage'; import ListPage from '@/components/ListPage';
import { defaultPageSize } from '@/consts'; import { defaultPageSize } from '@/consts';
import { isCloud } from '@/consts/env'; import { isCloud, isDevFeaturesEnabled } from '@/consts/env';
import { subscriptionPage } from '@/consts/pages'; import { subscriptionPage } from '@/consts/pages';
import { TenantsContext } from '@/contexts/TenantsProvider'; import { TenantsContext } from '@/contexts/TenantsProvider';
import Button from '@/ds-components/Button'; import Button from '@/ds-components/Button';
@ -65,7 +65,11 @@ function EnterpriseSsoConnectors() {
<ListPage <ListPage
title={{ title={{
isBeta: true, isBeta: true,
paywall: conditional((!isSsoEnabled || isDevTenant) && ReservedPlanId.Hobby), paywall: conditional(
(!isSsoEnabled || isDevTenant) &&
// Todo @xiaoyijun [Pricing] Remove feature flag
(isDevFeaturesEnabled ? ReservedPlanId.Pro : ReservedPlanId.Hobby)
),
title: 'enterprise_sso.title', title: 'enterprise_sso.title',
subtitle: 'enterprise_sso.subtitle', subtitle: 'enterprise_sso.subtitle',
}} }}

View file

@ -5,6 +5,7 @@ import { Trans, useTranslation } from 'react-i18next';
import ContactUsPhraseLink from '@/components/ContactUsPhraseLink'; import ContactUsPhraseLink from '@/components/ContactUsPhraseLink';
import PageMeta from '@/components/PageMeta'; import PageMeta from '@/components/PageMeta';
import { isDevFeaturesEnabled } from '@/consts/env';
import { TenantsContext } from '@/contexts/TenantsProvider'; import { TenantsContext } from '@/contexts/TenantsProvider';
import CardTitle from '@/ds-components/CardTitle'; import CardTitle from '@/ds-components/CardTitle';
import InlineNotification from '@/ds-components/InlineNotification'; import InlineNotification from '@/ds-components/InlineNotification';
@ -28,7 +29,11 @@ function PageWrapper({ children }: Props) {
<PageMeta titleKey="mfa.title" /> <PageMeta titleKey="mfa.title" />
<CardTitle <CardTitle
isBeta isBeta
paywall={cond((!isMfaEnabled || isDevTenant) && ReservedPlanId.Hobby)} paywall={cond(
(!isMfaEnabled || isDevTenant) &&
// Todo @xiaoyijun [Pricing] Remove feature flag
(isDevFeaturesEnabled ? ReservedPlanId.Pro : ReservedPlanId.Hobby)
)}
title="mfa.title" title="mfa.title"
subtitle="mfa.description" subtitle="mfa.description"
className={styles.cardTitle} className={styles.cardTitle}

View file

@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next';
import Plus from '@/assets/icons/plus.svg'; import Plus from '@/assets/icons/plus.svg';
import PageMeta from '@/components/PageMeta'; import PageMeta from '@/components/PageMeta';
import { isCloud } from '@/consts/env'; import { isCloud, isDevFeaturesEnabled } from '@/consts/env';
import { subscriptionPage } from '@/consts/pages'; import { subscriptionPage } from '@/consts/pages';
import { TenantsContext } from '@/contexts/TenantsProvider'; import { TenantsContext } from '@/contexts/TenantsProvider';
import Button from '@/ds-components/Button'; import Button from '@/ds-components/Button';
@ -71,7 +71,11 @@ function Organizations({ tab }: Props) {
<div className={pageLayout.headline}> <div className={pageLayout.headline}>
<CardTitle <CardTitle
isBeta isBeta
paywall={cond((isOrganizationsDisabled || isDevTenant) && ReservedPlanId.Hobby)} paywall={cond(
(isOrganizationsDisabled || isDevTenant) &&
// Todo @xiaoyijun [Pricing] Remove feature flag
(isDevFeaturesEnabled ? ReservedPlanId.Pro : ReservedPlanId.Hobby)
)}
title="organizations.title" title="organizations.title"
subtitle="organizations.subtitle" subtitle="organizations.subtitle"
/> />