diff --git a/web/components/bet-button.tsx b/web/components/bet-button.tsx index 2aadbc78..0bd3702f 100644 --- a/web/components/bet-button.tsx +++ b/web/components/bet-button.tsx @@ -32,17 +32,6 @@ export default function BetButton(props: { return ( <> - {user && ( -
- {hasYesShares - ? `(${Math.floor(yesShares)} ${ - isPseudoNumeric ? 'HIGHER' : 'YES' - })` - : hasNoShares - ? `(${Math.floor(noShares)} ${isPseudoNumeric ? 'LOWER' : 'NO'})` - : ''} -
- )} {user ? ( - ) -} - -// Return a number from 0 to 1 for this contract -// Resolved contracts are set to 1, for coloring purposes (even if NO) -function getProb(contract: Contract) { - const { outcomeType, resolution, resolutionProbability } = contract - return resolutionProbability - ? resolutionProbability - : resolution - ? 1 - : outcomeType === 'BINARY' - ? getBinaryProb(contract) - : outcomeType === 'PSEUDO_NUMERIC' - ? getProbability(contract) - : outcomeType === 'FREE_RESPONSE' || outcomeType === 'MULTIPLE_CHOICE' - ? getOutcomeProbability(contract, getTopAnswer(contract)?.id || '') - : outcomeType === 'NUMERIC' - ? getNumericScale(contract) - : 1 // Should not happen -} - -function getNumericScale(contract: NumericContract) { - const { min, max } = contract - const ev = getExpectedValue(contract) - return (ev - min) / (max - min) -} diff --git a/web/components/contract/quick-bet-arrows.tsx b/web/components/contract/quick-bet.tsx similarity index 98% rename from web/components/contract/quick-bet-arrows.tsx rename to web/components/contract/quick-bet.tsx index 678963bf..7b19306f 100644 --- a/web/components/contract/quick-bet-arrows.tsx +++ b/web/components/contract/quick-bet.tsx @@ -38,7 +38,7 @@ import { getBinaryProb } from 'common/contract-details' const BET_SIZE = 10 -export function QuickBetArrows(props: { +export function QuickBet(props: { contract: BinaryContract | PseudoNumericContract user: User className?: string @@ -243,7 +243,7 @@ export function ProbBar(props: { contract: Contract; previewProb?: number }) { ) } -export function quickOutcome(contract: Contract, direction: 'UP' | 'DOWN') { +function quickOutcome(contract: Contract, direction: 'UP' | 'DOWN') { const { outcomeType } = contract if (outcomeType === 'BINARY' || outcomeType === 'PSEUDO_NUMERIC') {