From 599a526dd7c30283aba76c73d18204fd861911a7 Mon Sep 17 00:00:00 2001 From: Sanne de Vries <65487235+sanne-san@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:07:23 +0100 Subject: [PATCH] Used comment count to determine which text to show in the CTA box (#21512) REF PLG-251 - This change uses commentCount instead of isFirst to ensure that the CTA box text is correct regardless of layout. --- apps/comments-ui/src/components/content/CTABox.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/comments-ui/src/components/content/CTABox.tsx b/apps/comments-ui/src/components/content/CTABox.tsx index e4b988342c..6290d728cb 100644 --- a/apps/comments-ui/src/components/content/CTABox.tsx +++ b/apps/comments-ui/src/components/content/CTABox.tsx @@ -6,7 +6,7 @@ type Props = { isPaid: boolean }; const CTABox: React.FC = ({isFirst, isPaid}) => { - const {accentColor, publication, member, t} = useAppContext(); + const {accentColor, publication, member, t, commentCount} = useAppContext(); const buttonStyle = { backgroundColor: accentColor @@ -16,7 +16,7 @@ const CTABox: React.FC = ({isFirst, isPaid}) => { color: accentColor }; - const titleText = (isFirst ? t('Start the conversation') : t('Join the discussion')); + const titleText = (commentCount === 0 ? t('Start the conversation') : t('Join the discussion')); const handleSignUpClick = () => { window.location.href = (isPaid && member) ? '#/portal/account/plans' : '#/portal/signup';