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 0cf103bfb3..da1f191050 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 @@ -18,7 +18,7 @@ interface IncomingRecommendationListProps { const IncomingRecommendationItem: React.FC<{mention: Mention, stats: ReferrerHistoryItem[]}> = ({mention, stats}) => { const cleanedSource = mention.source.replace('/.well-known/recommendations.json', ''); - const {signups, paidConversions, hasPaidColumn} = useMemo(() => { + const signups = useMemo(() => { // Note: this should match the `getDomainFromUrl` method from OutboundLinkTagger let cleanedDomain = cleanedSource; try { @@ -27,19 +27,12 @@ const IncomingRecommendationItem: React.FC<{mention: Mention, stats: ReferrerHis // Ignore invalid urls } - return stats.reduce((acc, stat) => { - acc.hasPaidColumn = acc.hasPaidColumn || stat.paid_conversions > 0; + return stats.reduce((s, stat) => { if (stat.source === cleanedDomain) { - acc.signups += stat.signups; - acc.paidConversions += stat.paid_conversions; - return acc; + return s + stat.signups; } - return acc; - }, { - signups: 0, - paidConversions: 0, - hasPaidColumn: false - }); + return s; + }, 0); }, [stats, cleanedSource]); const showDetails = () => { @@ -47,8 +40,7 @@ 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'; + const freeMembersLabel = (signups) === 1 ? 'free member' : 'free members'; return ( @@ -63,14 +55,8 @@ const IncomingRecommendationItem: React.FC<{mention: Mention, stats: ReferrerHis - {(signups - paidConversions) === 0 ? - : (
{signups - paidConversions}{freeMembersLabel}
)} + {signups === 0 ? - : (
{signups}{freeMembersLabel}
)}
- {hasPaidColumn && - - {paidConversions === 0 && -} - {paidConversions > 0 && (
{paidConversions}{paidConversionsLabel}
)} -
- }
); };