Fix Free Response card layouts
This commit is contained in:
parent
98510f233d
commit
1b17d3a102
|
@ -94,7 +94,7 @@ export function ContractCard(props: {
|
||||||
<div>
|
<div>
|
||||||
<Col
|
<Col
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'relative gap-3 rounded-lg bg-white p-6 pr-7 shadow-md hover:bg-gray-100',
|
'relative gap-3 rounded-lg bg-white py-4 pl-6 pr-7 shadow-md hover:bg-gray-100',
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
@ -112,6 +112,13 @@ export function ContractCard(props: {
|
||||||
{question}
|
{question}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
{outcomeType === 'FREE_RESPONSE' && (
|
||||||
|
<FreeResponseTopAnswer
|
||||||
|
contract={contract as FullContract<DPM, FreeResponse>}
|
||||||
|
truncate="long"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<MiscDetails
|
<MiscDetails
|
||||||
contract={contract}
|
contract={contract}
|
||||||
showHotVolume={showHotVolume}
|
showHotVolume={showHotVolume}
|
||||||
|
@ -216,6 +223,25 @@ export function BinaryResolutionOrChance(props: {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function FreeResponseTopAnswer(props: {
|
||||||
|
contract: FreeResponseContract
|
||||||
|
truncate: 'short' | 'long' | 'none'
|
||||||
|
className?: string
|
||||||
|
}) {
|
||||||
|
const { contract, truncate, className } = props
|
||||||
|
const { resolution } = contract
|
||||||
|
|
||||||
|
const topAnswer = getTopAnswer(contract)
|
||||||
|
|
||||||
|
return topAnswer ? (
|
||||||
|
<AnswerLabel
|
||||||
|
className="!text-gray-600"
|
||||||
|
answer={topAnswer}
|
||||||
|
truncate={truncate}
|
||||||
|
/>
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
|
||||||
export function FreeResponseResolutionOrChance(props: {
|
export function FreeResponseResolutionOrChance(props: {
|
||||||
contract: FreeResponseContract
|
contract: FreeResponseContract
|
||||||
truncate: 'short' | 'long' | 'none'
|
truncate: 'short' | 'long' | 'none'
|
||||||
|
@ -242,11 +268,6 @@ export function FreeResponseResolutionOrChance(props: {
|
||||||
) : (
|
) : (
|
||||||
topAnswer && (
|
topAnswer && (
|
||||||
<Row className="items-center gap-6">
|
<Row className="items-center gap-6">
|
||||||
<AnswerLabel
|
|
||||||
className="!text-gray-600"
|
|
||||||
answer={topAnswer}
|
|
||||||
truncate={truncate}
|
|
||||||
/>
|
|
||||||
<Col className={clsx('text-3xl', textColor)}>
|
<Col className={clsx('text-3xl', textColor)}>
|
||||||
<div>
|
<div>
|
||||||
{formatPercent(getOutcomeProbability(contract, topAnswer.id))}
|
{formatPercent(getOutcomeProbability(contract, topAnswer.id))}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user