0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

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.
This commit is contained in:
Sanne de Vries 2024-11-04 12:07:23 +01:00 committed by GitHub
parent 0316c3f16e
commit 599a526dd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,7 +6,7 @@ type Props = {
isPaid: boolean isPaid: boolean
}; };
const CTABox: React.FC<Props> = ({isFirst, isPaid}) => { const CTABox: React.FC<Props> = ({isFirst, isPaid}) => {
const {accentColor, publication, member, t} = useAppContext(); const {accentColor, publication, member, t, commentCount} = useAppContext();
const buttonStyle = { const buttonStyle = {
backgroundColor: accentColor backgroundColor: accentColor
@ -16,7 +16,7 @@ const CTABox: React.FC<Props> = ({isFirst, isPaid}) => {
color: accentColor 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 = () => { const handleSignUpClick = () => {
window.location.href = (isPaid && member) ? '#/portal/account/plans' : '#/portal/signup'; window.location.href = (isPaid && member) ? '#/portal/account/plans' : '#/portal/signup';