Skip to content

Commit

Permalink
browse: Show new bettors today
Browse files Browse the repository at this point in the history
  • Loading branch information
jahooma committed Jun 26, 2024
1 parent c391419 commit daddc14
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions web/components/contract/contract-table-col-formats.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChatIcon, UserIcon } from '@heroicons/react/solid'
import { ChatIcon, UserIcon, ArrowNarrowUpIcon } from '@heroicons/react/solid'
import { Contract } from 'common/contract'
import { useNumContractComments } from 'web/hooks/use-comments'
import { shortenNumber } from 'web/lib/util/formatNumber'
Expand All @@ -14,20 +14,31 @@ export type ColumnFormat = {

export const traderColumn = {
header: 'Traders',
content: (contract: Contract) =>
contract.outcomeType == 'BOUNTIED_QUESTION' ? (
content: (contract: Contract) => {
const { outcomeType, uniqueBettorCount, uniqueBettorCountDay } = contract

return outcomeType == 'BOUNTIED_QUESTION' ? (
<div className="text-ink-700 h-min align-top">
<BountiedContractComments contractId={contract.id} />
</div>
) : (
<div className="text-ink-700 h-min align-top">
<Row className="align-center h-full shrink-0 items-center gap-0.5">
<UserIcon className="text-ink-400 h-4 w-4" />
{shortenNumber(contract.uniqueBettorCount ?? 0)}
{shortenNumber(uniqueBettorCount ?? 0)}
{uniqueBettorCountDay > 0 && (
<ArrowNarrowUpIcon className="-mr-1 h-4 w-4 text-teal-500" />
)}
{uniqueBettorCountDay > 0 && (
<span className="text-sm text-teal-500">
{uniqueBettorCountDay}
</span>
)}
</Row>
</div>
),
width: 'w-16',
)
},
width: 'w-[100px]',
}

export const probColumn = {
Expand Down

0 comments on commit daddc14

Please sign in to comment.