Hide text only on quickbet

This commit is contained in:
Austin Chen 2022-05-23 23:38:10 -07:00
parent ef393292b2
commit 600b3fa7af
2 changed files with 18 additions and 3 deletions

View File

@ -106,8 +106,9 @@ export function BinaryResolutionOrChance(props: {
contract: FullContract<DPM | CPMM, Binary>
large?: boolean
className?: string
hideText?: boolean
}) {
const { contract, large, className } = props
const { contract, large, className, hideText } = props
const { resolution } = contract
const textColor = `text-${getColor(contract)}`
@ -128,6 +129,11 @@ export function BinaryResolutionOrChance(props: {
) : (
<>
<div className={textColor}>{getBinaryProbPercent(contract)}</div>
{!hideText && (
<div className={clsx(textColor, large ? 'text-xl' : 'text-base')}>
chance
</div>
)}
</>
)}
</Col>
@ -156,8 +162,9 @@ export function FreeResponseResolutionOrChance(props: {
contract: FreeResponseContract
truncate: 'short' | 'long' | 'none'
className?: string
hideText?: boolean
}) {
const { contract, truncate, className } = props
const { contract, truncate, className, hideText } = props
const { resolution } = contract
const topAnswer = getTopAnswer(contract)
@ -182,6 +189,7 @@ export function FreeResponseResolutionOrChance(props: {
<div>
{formatPercent(getOutcomeProbability(contract, topAnswer.id))}
</div>
{!hideText && <div className="text-base">chance</div>}
</Col>
</Row>
)
@ -193,8 +201,9 @@ export function FreeResponseResolutionOrChance(props: {
export function NumericResolutionOrExpectation(props: {
contract: NumericContract
className?: string
hideText?: boolean
}) {
const { contract, className } = props
const { contract, className, hideText } = props
const { resolution } = contract
const textColor = `text-${getColor(contract)}`
@ -213,6 +222,9 @@ export function NumericResolutionOrExpectation(props: {
<div className={clsx('text-3xl', textColor)}>
{formatLargeNumber(getExpectedValue(contract))}
</div>
{!hideText && (
<div className={clsx('text-base', textColor)}>expected</div>
)}
</>
)}
</Col>

View File

@ -170,6 +170,7 @@ export function QuickOutcomeView(props: { contract: Contract }) {
<BinaryResolutionOrChance
className="items-center"
contract={contract}
hideText
/>
)}
@ -177,6 +178,7 @@ export function QuickOutcomeView(props: { contract: Contract }) {
<NumericResolutionOrExpectation
className="items-center"
contract={contract as NumericContract}
hideText
/>
)}
@ -185,6 +187,7 @@ export function QuickOutcomeView(props: { contract: Contract }) {
className="self-end text-gray-600"
contract={contract as FullContract<DPM, FreeResponse>}
truncate="long"
hideText
/>
)}
</>