From 5315eb36005c8fe4da442a851a7b9f30810ef9bc Mon Sep 17 00:00:00 2001 From: Milli Date: Fri, 3 Jun 2022 00:36:24 +0200 Subject: [PATCH] using the type "resolution" --- web/components/contract/quick-bet.tsx | 4 ++-- web/components/outcome-label.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/components/contract/quick-bet.tsx b/web/components/contract/quick-bet.tsx index 8f642656..e1a2eead 100644 --- a/web/components/contract/quick-bet.tsx +++ b/web/components/contract/quick-bet.tsx @@ -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' ) diff --git a/web/components/outcome-label.tsx b/web/components/outcome-label.tsx index 0ead4f94..f76b091b 100644 --- a/web/components/outcome-label.tsx +++ b/web/components/outcome-label.tsx @@ -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