From 16cb8d25991b779fb55de16d929a7608e1a4c69b Mon Sep 17 00:00:00 2001 From: Djordje Vlaisavljevic Date: Fri, 22 Sep 2023 14:48:34 +0100 Subject: [PATCH] Fixed stats labels refs https://github.com/TryGhost/Product/issues/3891 --- .../site/recommendations/IncomingRecommendationList.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/admin-x-settings/src/components/settings/site/recommendations/IncomingRecommendationList.tsx b/apps/admin-x-settings/src/components/settings/site/recommendations/IncomingRecommendationList.tsx index 9647064b7a..a28e3d0807 100644 --- a/apps/admin-x-settings/src/components/settings/site/recommendations/IncomingRecommendationList.tsx +++ b/apps/admin-x-settings/src/components/settings/site/recommendations/IncomingRecommendationList.tsx @@ -47,6 +47,9 @@ const IncomingRecommendationItem: React.FC<{mention: Mention, stats: ReferrerHis window.open(cleanedSource, '_blank'); }; + const freeMembersLabel = (signups - paidConversions) === 1 ? 'free member' : 'free members'; + const paidConversionsLabel = (paidConversions === 1) ? 'paid member' : 'paid members'; + return ( @@ -60,12 +63,12 @@ const IncomingRecommendationItem: React.FC<{mention: Mention, stats: ReferrerHis - {(signups - paidConversions) === 0 ? - : (
{signups - paidConversions}free members
)} + {(signups - paidConversions) === 0 ? - : (
{signups - paidConversions}{freeMembersLabel}
)}
{hasPaidColumn && {paidConversions === 0 && -} - {paidConversions > 0 && (
{paidConversions}paid members
)} + {paidConversions > 0 && (
{paidConversions}{paidConversionsLabel}
)}
}