Show gray probabilities for closed markets
This commit is contained in:
parent
a8abd4ecbb
commit
97bf1049b5
|
@ -48,11 +48,7 @@ export function ContractCard(props: {
|
||||||
|
|
||||||
<Row className="justify-between gap-4">
|
<Row className="justify-between gap-4">
|
||||||
<p className="font-medium text-indigo-700">{question}</p>
|
<p className="font-medium text-indigo-700">{question}</p>
|
||||||
<ResolutionOrChance
|
<ResolutionOrChance className="items-center" contract={contract} />
|
||||||
className="items-center"
|
|
||||||
resolution={resolution}
|
|
||||||
probPercent={probPercent}
|
|
||||||
/>
|
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -60,12 +56,14 @@ export function ContractCard(props: {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ResolutionOrChance(props: {
|
export function ResolutionOrChance(props: {
|
||||||
resolution?: 'YES' | 'NO' | 'MKT' | 'CANCEL'
|
contract: Contract
|
||||||
probPercent: string
|
|
||||||
large?: boolean
|
large?: boolean
|
||||||
className?: string
|
className?: string
|
||||||
}) {
|
}) {
|
||||||
const { resolution, probPercent, large, className } = props
|
const { contract, large, className } = props
|
||||||
|
const { resolution } = contract
|
||||||
|
const { probPercent } = contractMetrics(contract)
|
||||||
|
const marketClosed = (contract.closeTime || Infinity) < Date.now()
|
||||||
|
|
||||||
const resolutionColor = {
|
const resolutionColor = {
|
||||||
YES: 'text-primary',
|
YES: 'text-primary',
|
||||||
|
@ -75,6 +73,8 @@ export function ResolutionOrChance(props: {
|
||||||
'': '', // Empty if unresolved
|
'': '', // Empty if unresolved
|
||||||
}[resolution || '']
|
}[resolution || '']
|
||||||
|
|
||||||
|
const probColor = marketClosed ? 'text-gray-400' : 'text-primary'
|
||||||
|
|
||||||
const resolutionText = {
|
const resolutionText = {
|
||||||
YES: 'YES',
|
YES: 'YES',
|
||||||
NO: 'NO',
|
NO: 'NO',
|
||||||
|
@ -96,10 +96,8 @@ export function ResolutionOrChance(props: {
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<div className="text-primary">{probPercent}</div>
|
<div className={probColor}>{probPercent}</div>
|
||||||
<div
|
<div className={clsx(probColor, large ? 'text-xl' : 'text-base')}>
|
||||||
className={clsx('text-primary', large ? 'text-xl' : 'text-base')}
|
|
||||||
>
|
|
||||||
chance
|
chance
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -340,11 +340,7 @@ function FeedQuestion(props: { contract: Contract }) {
|
||||||
>
|
>
|
||||||
{question}
|
{question}
|
||||||
</SiteLink>
|
</SiteLink>
|
||||||
<ResolutionOrChance
|
<ResolutionOrChance className="items-center" contract={contract} />
|
||||||
className="items-center"
|
|
||||||
resolution={resolution}
|
|
||||||
probPercent={probPercent}
|
|
||||||
/>
|
|
||||||
</Col>
|
</Col>
|
||||||
<TruncatedComment
|
<TruncatedComment
|
||||||
comment={contract.description}
|
comment={contract.description}
|
||||||
|
|
|
@ -57,8 +57,7 @@ export const ContractOverview = (props: {
|
||||||
<Row className="items-center justify-between gap-4">
|
<Row className="items-center justify-between gap-4">
|
||||||
<ResolutionOrChance
|
<ResolutionOrChance
|
||||||
className="md:hidden"
|
className="md:hidden"
|
||||||
resolution={resolution}
|
contract={contract}
|
||||||
probPercent={probPercent}
|
|
||||||
large
|
large
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -75,12 +74,7 @@ export const ContractOverview = (props: {
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
<Col className="hidden items-end justify-between md:flex">
|
<Col className="hidden items-end justify-between md:flex">
|
||||||
<ResolutionOrChance
|
<ResolutionOrChance className="items-end" contract={contract} large />
|
||||||
className="items-end"
|
|
||||||
resolution={resolution}
|
|
||||||
probPercent={probPercent}
|
|
||||||
large
|
|
||||||
/>
|
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user