cast to NumericContract

This commit is contained in:
mantikoros 2022-05-18 15:14:21 -04:00
parent 8cecc74ada
commit a9faa7a31f
4 changed files with 12 additions and 5 deletions

View File

@ -174,7 +174,7 @@ export function NumericResolution(props: {
const { contract, className } = props
const { resolution } = contract
const resolutionValue = getValueFromBucket(resolution, contract)
const resolutionValue = getValueFromBucket(resolution ?? '', contract)
return (
<Col className={clsx(resolution ? 'text-3xl' : 'text-xl', className)}>

View File

@ -74,7 +74,7 @@ export const ContractOverview = (props: {
)}
{outcomeType === 'NUMERIC' && resolution && (
<NumericResolution contract={contract} />
<NumericResolution contract={contract as NumericContract} />
)}
<ContractDetails

View File

@ -10,6 +10,7 @@ import {
FreeResponse,
FreeResponseContract,
FullContract,
NumericContract,
} from 'common/contract'
import { formatPercent } from 'common/util/format'
import { ClientRender } from './client-render'
@ -27,7 +28,7 @@ export function OutcomeLabel(props: {
if (contract.outcomeType === 'NUMERIC')
return (
<span className="text-blue-500">
{getValueFromBucket(outcome, contract)}
{getValueFromBucket(outcome, contract as NumericContract)}
</span>
)

View File

@ -1,5 +1,11 @@
import { Bet } from 'common/bet'
import { Contract, DPM, FreeResponse, FullContract } from 'common/contract'
import {
Contract,
DPM,
FreeResponse,
FullContract,
NumericContract,
} from 'common/contract'
import { DOMAIN } from 'common/envs/constants'
import { AnswersGraph } from 'web/components/answers/answers-graph'
import {
@ -122,7 +128,7 @@ function ContractEmbed(props: { contract: Contract; bets: Bet[] }) {
)}
{outcomeType === 'NUMERIC' && resolution && (
<NumericResolution contract={contract} />
<NumericResolution contract={contract as NumericContract} />
)}
</Row>