pseudo numeric embeds
This commit is contained in:
parent
a44b3606fe
commit
e8f155e3a8
|
|
@ -7,6 +7,7 @@ import {
|
||||||
BinaryResolutionOrChance,
|
BinaryResolutionOrChance,
|
||||||
FreeResponseResolutionOrChance,
|
FreeResponseResolutionOrChance,
|
||||||
NumericResolutionOrExpectation,
|
NumericResolutionOrExpectation,
|
||||||
|
PseudoNumericResolutionOrExpectation,
|
||||||
} from 'web/components/contract/contract-card'
|
} from 'web/components/contract/contract-card'
|
||||||
import { ContractDetails } from 'web/components/contract/contract-details'
|
import { ContractDetails } from 'web/components/contract/contract-details'
|
||||||
import { ContractProbGraph } from 'web/components/contract/contract-prob-graph'
|
import { ContractProbGraph } from 'web/components/contract/contract-prob-graph'
|
||||||
|
|
@ -79,6 +80,7 @@ function ContractEmbed(props: { contract: Contract; bets: Bet[] }) {
|
||||||
const { question, outcomeType } = contract
|
const { question, outcomeType } = contract
|
||||||
|
|
||||||
const isBinary = outcomeType === 'BINARY'
|
const isBinary = outcomeType === 'BINARY'
|
||||||
|
const isPseudoNumeric = outcomeType === 'PSEUDO_NUMERIC'
|
||||||
|
|
||||||
const href = `https://${DOMAIN}${contractPath(contract)}`
|
const href = `https://${DOMAIN}${contractPath(contract)}`
|
||||||
|
|
||||||
|
|
@ -110,13 +112,18 @@ function ContractEmbed(props: { contract: Contract; bets: Bet[] }) {
|
||||||
|
|
||||||
{isBinary && (
|
{isBinary && (
|
||||||
<Row className="items-center gap-4">
|
<Row className="items-center gap-4">
|
||||||
{/* this fails typechecking, but it doesn't explode because we will
|
<BetRow contract={contract} betPanelClassName="scale-75" />
|
||||||
never */}
|
|
||||||
<BetRow contract={contract as any} betPanelClassName="scale-75" />
|
|
||||||
<BinaryResolutionOrChance contract={contract} />
|
<BinaryResolutionOrChance contract={contract} />
|
||||||
</Row>
|
</Row>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{isPseudoNumeric && (
|
||||||
|
<Row className="items-center gap-4">
|
||||||
|
<BetRow contract={contract} betPanelClassName="scale-75" />
|
||||||
|
<PseudoNumericResolutionOrExpectation contract={contract} />
|
||||||
|
</Row>
|
||||||
|
)}
|
||||||
|
|
||||||
{outcomeType === 'FREE_RESPONSE' && (
|
{outcomeType === 'FREE_RESPONSE' && (
|
||||||
<FreeResponseResolutionOrChance
|
<FreeResponseResolutionOrChance
|
||||||
contract={contract}
|
contract={contract}
|
||||||
|
|
@ -133,7 +140,7 @@ function ContractEmbed(props: { contract: Contract; bets: Bet[] }) {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mx-1" style={{ paddingBottom }}>
|
<div className="mx-1" style={{ paddingBottom }}>
|
||||||
{isBinary && (
|
{(isBinary || isPseudoNumeric) && (
|
||||||
<ContractProbGraph
|
<ContractProbGraph
|
||||||
contract={contract}
|
contract={contract}
|
||||||
bets={bets}
|
bets={bets}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user