Kill counts of comments and trades on contract page (#900)

This commit is contained in:
Marshall Polaris 2022-09-20 15:53:35 -07:00 committed by GitHub
parent 589bf9651d
commit be4def49a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,9 +47,7 @@ export function ContractTabs(props: {
l.amount > 0 l.amount > 0
) )
// Load comments here, so the badge count will be correct const comments = useComments(contract.id) ?? props.comments
const updatedComments = useComments(contract.id)
const comments = updatedComments ?? props.comments
const betActivity = lps != null && ( const betActivity = lps != null && (
<ContractBetsActivity <ContractBetsActivity
@ -107,18 +105,10 @@ export function ContractTabs(props: {
return ( return (
<Tabs <Tabs
currentPageForAnalytics="contract" currentPageForAnalytics={'contract'}
tabs={[ tabs={[
{ { title: 'Comments', content: commentActivity },
title: 'Comments', { title: capitalize(PAST_BETS), content: betActivity },
content: commentActivity,
badge: `${comments.length}`,
},
{
title: capitalize(PAST_BETS),
content: betActivity,
badge: `${visibleBets.length + visibleLps.length}`,
},
...(!user || !userBets?.length ...(!user || !userBets?.length
? [] ? []
: [ : [