diff --git a/web/components/contract/contract-card.tsx b/web/components/contract/contract-card.tsx index aa18befa..1f76ab38 100644 --- a/web/components/contract/contract-card.tsx +++ b/web/components/contract/contract-card.tsx @@ -1,7 +1,11 @@ import clsx from 'clsx' import Link from 'next/link' import { Row } from '../layout/row' -import { formatLargeNumber, formatPercent } from 'common/util/format' +import { + formatLargeNumber, + formatPercent, + formatWithCommas, +} from 'common/util/format' import { contractPath, getBinaryProbPercent } from 'web/lib/firebase/contracts' import { Col } from '../layout/col' import { @@ -37,8 +41,8 @@ import { Tooltip } from '../tooltip' import { SiteLink } from '../site-link' import { ProbOrNumericChange } from './prob-change-table' import { Card } from '../card' -import { ProfitBadgeMana } from '../profit-badge' import { floatingEqual } from 'common/util/math' +import { ENV_CONFIG } from 'common/envs/constants' export function ContractCard(props: { contract: Contract @@ -409,6 +413,12 @@ export function ContractCardProbChange(props: { const binaryOutcome = metrics && floatingEqual(metrics.totalShares.NO ?? 0, 0) ? 'YES' : 'NO' + const displayedProfit = dayMetrics + ? ENV_CONFIG.moneyMoniker + + (dayMetrics.profit > 0 ? '+' : '') + + dayMetrics.profit.toFixed(0) + : undefined + return ( - - {Math.floor(metrics.totalShares[binaryOutcome])}{' '} + + You: {formatWithCommas(metrics.totalShares[binaryOutcome])}{' '} {binaryOutcome === 'YES' ? yesOutcomeLabel : noOutcomeLabel} shares + {displayedProfit} today - - {dayMetrics && ( - <> - -
Daily profit
- -
- - )}
)}