Add current prob to trades items

This commit is contained in:
James Grugett 2022-02-08 22:52:09 -06:00
parent 6214b6e425
commit e66564cd1f

View File

@ -18,6 +18,7 @@ import {
Contract, Contract,
getContractFromId, getContractFromId,
contractPath, contractPath,
contractMetrics,
} from '../lib/firebase/contracts' } from '../lib/firebase/contracts'
import { Row } from './layout/row' import { Row } from './layout/row'
import { UserLink } from './user-page' import { UserLink } from './user-page'
@ -121,7 +122,7 @@ function MyContractBets(props: { contract: Contract; bets: Bet[] }) {
const { resolution } = contract const { resolution } = contract
const [collapsed, setCollapsed] = useState(true) const [collapsed, setCollapsed] = useState(true)
const { probPercent } = contractMetrics(contract)
return ( return (
<div <div
tabIndex={0} tabIndex={0}
@ -150,19 +151,19 @@ function MyContractBets(props: { contract: Contract; bets: Bet[] }) {
/> />
</Row> </Row>
<Row className="gap-2 text-gray-500 text-sm"> <Row className="gap-2 text-gray-500 text-sm items-center">
{resolution ? (
<div>
Resolved <OutcomeLabel outcome={resolution} />
</div>
) : (
<div className="text-primary text-lg">{probPercent}</div>
)}
<div></div>
<UserLink <UserLink
name={contract.creatorName} name={contract.creatorName}
username={contract.creatorUsername} username={contract.creatorUsername}
/> />
{resolution && (
<>
<div></div>
<div className="whitespace-nowrap">
Resolved <OutcomeLabel outcome={resolution} />
</div>
</>
)}
</Row> </Row>
</Col> </Col>