using the type "resolution"

This commit is contained in:
Milli 2022-06-03 00:36:24 +02:00
parent 01adc91a67
commit 5315eb3600
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ import {
} from 'common/calculate'
import { getExpectedValue } from 'common/calculate-dpm'
import { User } from 'common/user'
import { Contract, NumericContract } from 'common/contract'
import { Contract, NumericContract, resolution } from 'common/contract'
import {
formatLargeNumber,
formatMoney,
@ -264,7 +264,7 @@ export function getColor(contract: Contract, previewProb?: number) {
const { resolution } = contract
if (resolution) {
return (
OUTCOME_TO_COLOR[resolution as 'YES' | 'NO' | 'CANCEL' | 'MKT'] ??
OUTCOME_TO_COLOR[resolution as resolution] ??
// If resolved to a FR answer, use 'primary'
'primary'
)

View File

@ -41,7 +41,7 @@ export function OutcomeLabel(props: {
}
export function BinaryOutcomeLabel(props: {
outcome: 'YES' | 'NO' | 'CANCEL' | 'MKT'
outcome: resolution
}) {
const { outcome } = props
@ -53,7 +53,7 @@ export function BinaryOutcomeLabel(props: {
export function BinaryContractOutcomeLabel(props: {
contract: BinaryContract
resolution: 'YES' | 'NO' | 'CANCEL' | 'MKT'
resolution: resolution
}) {
const { contract, resolution } = props