0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-17 22:04:19 -05:00

fix(console): add pro tag for custom JWT page (#5901)

This commit is contained in:
Darcy Ye 2024-05-21 14:26:09 +08:00 committed by GitHub
parent 05dbf5427d
commit 888c80ff99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,8 +1,12 @@
import { LogtoJwtTokenKeyType } from '@logto/schemas';
import { useCallback, useState } from 'react';
import { LogtoJwtTokenKeyType, ReservedPlanId } from '@logto/schemas';
import { cond } from '@silverhand/essentials';
import { useCallback, useContext, useState } from 'react';
import { useTranslation } from 'react-i18next';
import FormCard, { FormCardSkeleton } from '@/components/FormCard';
import { isCloud } from '@/consts/env';
import { SubscriptionDataContext } from '@/contexts/SubscriptionDataProvider';
import { TenantsContext } from '@/contexts/TenantsProvider';
import CardTitle from '@/ds-components/CardTitle';
import FormField from '@/ds-components/FormField';
@ -15,6 +19,10 @@ import useJwtCustomizer from './use-jwt-customizer';
function CustomizeJwt() {
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
const { isDevTenant } = useContext(TenantsContext);
const { currentPlan } = useContext(SubscriptionDataContext);
const isCustomJwtEnabled = !isCloud || currentPlan.quota.customJwtEnabled;
const [deleteModalTokenType, setDeleteModalTokenType] = useState<LogtoJwtTokenKeyType>();
const onDeleteHandler = useCallback((tokenType: LogtoJwtTokenKeyType) => {
@ -27,6 +35,7 @@ function CustomizeJwt() {
return (
<main className={styles.mainContent}>
<CardTitle
paywall={cond((!isCustomJwtEnabled || isDevTenant) && ReservedPlanId.Pro)}
title="jwt_claims.title"
subtitle="jwt_claims.description"
className={styles.header}