From 18d6d72c41639d1c328b350322159be7a34e51b9 Mon Sep 17 00:00:00 2001 From: Djordje Vlaisavljevic Date: Thu, 25 Jan 2024 19:27:55 +0000 Subject: [PATCH] Updated free tier placeholder value ENG-556 (#19585) refs ENG-556 --- .../settings/membership/tiers/TierDetailModal.tsx | 4 ++-- .../settings/membership/tiers/TierDetailPreview.tsx | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/admin-x-settings/src/components/settings/membership/tiers/TierDetailModal.tsx b/apps/admin-x-settings/src/components/settings/membership/tiers/TierDetailModal.tsx index e4a256307d..5b6ee9908a 100644 --- a/apps/admin-x-settings/src/components/settings/membership/tiers/TierDetailModal.tsx +++ b/apps/admin-x-settings/src/components/settings/membership/tiers/TierDetailModal.tsx @@ -26,7 +26,7 @@ const TierDetailModalContent: React.FC<{tier?: Tier}> = ({tier}) => { const [hasFreeTrial, setHasFreeTrial] = React.useState(!!tier?.trial_days); const handleError = useHandleError(); const {localSettings, siteData} = useSettingGroup(); - const [siteTitle, portalPlansJson] = getSettingValues(localSettings, ['title', 'portal_plans']) as string[]; + const [portalPlansJson] = getSettingValues(localSettings, ['portal_plans']) as string[]; const hasPortalImprovements = useFeatureFlag('portalImprovements'); const allowNameChange = !isFreeTier || hasPortalImprovements; const portalPlans = JSON.parse(portalPlansJson?.toString() || '[]') as string[]; @@ -223,7 +223,7 @@ const TierDetailModalContent: React.FC<{tier?: Tier}> = ({tier}) => { updateForm(state => ({...state, description: e.target.value}))} diff --git a/apps/admin-x-settings/src/components/settings/membership/tiers/TierDetailPreview.tsx b/apps/admin-x-settings/src/components/settings/membership/tiers/TierDetailPreview.tsx index e9fbe60479..f68d03dd91 100644 --- a/apps/admin-x-settings/src/components/settings/membership/tiers/TierDetailPreview.tsx +++ b/apps/admin-x-settings/src/components/settings/membership/tiers/TierDetailPreview.tsx @@ -1,10 +1,8 @@ import React, {useState} from 'react'; import clsx from 'clsx'; -import useSettingGroup from '../../../../hooks/useSettingGroup'; import {Button, Heading, Icon} from '@tryghost/admin-x-design-system'; import {TierFormState} from './TierDetailModal'; import {currencyToDecimal, getSymbol} from '../../../../utils/currency'; -import {getSettingValues} from '@tryghost/admin-x-framework/api/settings'; import {numberWithCommas} from '../../../../utils/helpers'; interface TierDetailPreviewProps { @@ -70,8 +68,6 @@ const DiscountLabel: React.FC<{discount: number}> = ({discount}) => { const TierDetailPreview: React.FC = ({tier, isFreeTier}) => { const [showingYearly, setShowingYearly] = useState(false); - const {localSettings} = useSettingGroup(); - const siteTitle = getSettingValues(localSettings, ['title']) as string[]; const name = tier?.name || ''; const description = tier?.description || ''; @@ -111,7 +107,7 @@ const TierDetailPreview: React.FC = ({tier, isFreeTier})
-
{description || (isFreeTier ? `Free preview of ${siteTitle}` : 'Full access to premium content')}
+
{description || (isFreeTier ? `Free preview` : 'Full access to premium content')}