0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Fixed stats labels

refs https://github.com/TryGhost/Product/issues/3891
This commit is contained in:
Djordje Vlaisavljevic 2023-09-22 14:48:34 +01:00
parent 99e455a4f5
commit 16cb8d2599

View file

@ -47,6 +47,9 @@ const IncomingRecommendationItem: React.FC<{mention: Mention, stats: ReferrerHis
window.open(cleanedSource, '_blank'); window.open(cleanedSource, '_blank');
}; };
const freeMembersLabel = (signups - paidConversions) === 1 ? 'free member' : 'free members';
const paidConversionsLabel = (paidConversions === 1) ? 'paid member' : 'paid members';
return ( return (
<TableRow hideActions> <TableRow hideActions>
<TableCell onClick={showDetails}> <TableCell onClick={showDetails}>
@ -60,12 +63,12 @@ const IncomingRecommendationItem: React.FC<{mention: Mention, stats: ReferrerHis
</div> </div>
</TableCell> </TableCell>
<TableCell className='hidden align-middle md:!visible md:!table-cell' onClick={showDetails}> <TableCell className='hidden align-middle md:!visible md:!table-cell' onClick={showDetails}>
{(signups - paidConversions) === 0 ? <span className="text-grey-500">-</span> : (<div className='-mt-px flex grow items-end gap-1'><span>{signups - paidConversions}</span><span className='-mb-px whitespace-nowrap text-sm lowercase text-grey-700'>free members</span></div>)} {(signups - paidConversions) === 0 ? <span className="text-grey-500">-</span> : (<div className='-mt-px flex grow items-end gap-1'><span>{signups - paidConversions}</span><span className='-mb-px whitespace-nowrap text-sm lowercase text-grey-700'>{freeMembersLabel}</span></div>)}
</TableCell> </TableCell>
{hasPaidColumn && {hasPaidColumn &&
<TableCell className='hidden align-middle md:!visible md:!table-cell' onClick={showDetails}> <TableCell className='hidden align-middle md:!visible md:!table-cell' onClick={showDetails}>
{paidConversions === 0 && <span className="text-grey-500">-</span>} {paidConversions === 0 && <span className="text-grey-500">-</span>}
{paidConversions > 0 && (<div className='-mt-px flex grow items-end gap-1'><span>{paidConversions}</span><span className='whitespace-nowrap text-xs text-grey-700'>paid members</span></div>)} {paidConversions > 0 && (<div className='-mt-px flex grow items-end gap-1'><span>{paidConversions}</span><span className='whitespace-nowrap text-xs text-grey-700'>{paidConversionsLabel}</span></div>)}
</TableCell> </TableCell>
} }
</TableRow> </TableRow>