From 5b0ea2192bf8ec4aeb592d22850e237bdcd6411d Mon Sep 17 00:00:00 2001 From: Xiao Yijun Date: Fri, 17 Nov 2023 21:19:53 +0800 Subject: [PATCH] feat(console): add pricing link for dev tenant notification (#4908) --- .../PlanCardItem/index.tsx | 4 +++- .../SelectTenantPlanModal/index.tsx | 5 ++--- packages/console/src/consts/external-links.ts | 1 + .../src/ds-components/TextLink/index.tsx | 19 ++++++------------- .../index.module.scss | 4 ++-- .../DevelopmentTenantNotification/index.tsx | 16 ++++++++++++++-- 6 files changed, 28 insertions(+), 21 deletions(-) diff --git a/packages/console/src/components/CreateTenantModal/SelectTenantPlanModal/PlanCardItem/index.tsx b/packages/console/src/components/CreateTenantModal/SelectTenantPlanModal/PlanCardItem/index.tsx index d374e05c5..79bba0049 100644 --- a/packages/console/src/components/CreateTenantModal/SelectTenantPlanModal/PlanCardItem/index.tsx +++ b/packages/console/src/components/CreateTenantModal/SelectTenantPlanModal/PlanCardItem/index.tsx @@ -7,6 +7,7 @@ import ArrowRight from '@/assets/icons/arrow-right.svg'; import PlanDescription from '@/components/PlanDescription'; import PlanName from '@/components/PlanName'; import PlanQuotaList from '@/components/PlanQuotaList'; +import { pricingLink } from '@/consts'; import { comingSoonQuotaKeys } from '@/consts/plan-quotas'; import { ReservedPlanId } from '@/consts/subscriptions'; import { TenantsContext } from '@/contexts/TenantsProvider'; @@ -102,9 +103,10 @@ function PlanCardItem({ plan, onSelect }: Props) {
} target="_blank" + rel="noopener" className={styles.link} > diff --git a/packages/console/src/components/CreateTenantModal/SelectTenantPlanModal/index.tsx b/packages/console/src/components/CreateTenantModal/SelectTenantPlanModal/index.tsx index b00a0255d..5550c1e1f 100644 --- a/packages/console/src/components/CreateTenantModal/SelectTenantPlanModal/index.tsx +++ b/packages/console/src/components/CreateTenantModal/SelectTenantPlanModal/index.tsx @@ -4,6 +4,7 @@ import Modal from 'react-modal'; import { useCloudApi, toastResponseError } from '@/cloud/hooks/use-cloud-api'; import { type TenantResponse } from '@/cloud/types/router'; +import { pricingLink } from '@/consts'; import { ReservedPlanId } from '@/consts/subscriptions'; import DangerousRaw from '@/ds-components/DangerousRaw'; import ModalLayout from '@/ds-components/ModalLayout'; @@ -67,9 +68,7 @@ function SelectTenantPlanModal({ tenantData, onClose }: Props) { subtitle={ , - }} + components={{ a: }} > {t('upsell.create_tenant.description')} diff --git a/packages/console/src/consts/external-links.ts b/packages/console/src/consts/external-links.ts index 1ce56639c..f69d443dc 100644 --- a/packages/console/src/consts/external-links.ts +++ b/packages/console/src/consts/external-links.ts @@ -11,6 +11,7 @@ export const reservationLink = buildUrl('https://calendly.com/logto/30min', { month: new Date().toISOString().slice(0, 7), }); export const trustAndSecurityLink = 'https://logto.io/trust-and-security'; +export const pricingLink = 'https://logto.io/pricing'; /** Docs link */ export const envTagsFeatureLink = '/docs/recipes/environment-tags'; diff --git a/packages/console/src/ds-components/TextLink/index.tsx b/packages/console/src/ds-components/TextLink/index.tsx index f71984cc7..8bd15147a 100644 --- a/packages/console/src/ds-components/TextLink/index.tsx +++ b/packages/console/src/ds-components/TextLink/index.tsx @@ -16,28 +16,21 @@ type Props = AnchorHTMLAttributes & function TextLink({ to, children, icon, isTrailingIcon = false, className, ...rest }: Props) { const { getTo } = useTenantPathname(); + const styleClassNames = classNames(styles.link, isTrailingIcon && styles.trailingIcon, className); + if (to) { return ( - + {icon} - {/* eslint-disable-next-line react/jsx-no-useless-fragment */} - <>{children} + {children} ); } return ( - + {icon} - {/* eslint-disable-next-line react/jsx-no-useless-fragment */} - <>{children} + {children} ); } diff --git a/packages/console/src/pages/GetStarted/DevelopmentTenantNotification/index.module.scss b/packages/console/src/pages/GetStarted/DevelopmentTenantNotification/index.module.scss index af15a7825..58b688fae 100644 --- a/packages/console/src/pages/GetStarted/DevelopmentTenantNotification/index.module.scss +++ b/packages/console/src/pages/GetStarted/DevelopmentTenantNotification/index.module.scss @@ -21,8 +21,8 @@ .title { font: var(--font-title-2); - .highlight { - color: var(--color-text-link); + .link { + font: var(--font-title-2); } } diff --git a/packages/console/src/pages/GetStarted/DevelopmentTenantNotification/index.tsx b/packages/console/src/pages/GetStarted/DevelopmentTenantNotification/index.tsx index 1c8c549b2..4c2f4d316 100644 --- a/packages/console/src/pages/GetStarted/DevelopmentTenantNotification/index.tsx +++ b/packages/console/src/pages/GetStarted/DevelopmentTenantNotification/index.tsx @@ -3,9 +3,10 @@ import { Trans, useTranslation } from 'react-i18next'; import CongratsDark from '@/assets/images/congrats-dark.svg'; import Congrats from '@/assets/images/congrats.svg'; -import { envTagsFeatureLink } from '@/consts'; +import { envTagsFeatureLink, pricingLink } from '@/consts'; import { LinkButton } from '@/ds-components/Button'; import DynamicT from '@/ds-components/DynamicT'; +import TextLink from '@/ds-components/TextLink'; import useDocumentationUrl from '@/hooks/use-documentation-url'; import useTheme from '@/hooks/use-theme'; @@ -22,7 +23,18 @@ function DevelopmentTenantNotification() {
- }}> + + ), + }} + > {t('tenants.dev_tenant_notification.title')}