Only show answer tooltips if truncated
This commit is contained in:
parent
0cbc0010c1
commit
d5b922affd
|
@ -90,13 +90,11 @@ export function FreeResponseOutcomeLabel(props: {
|
||||||
const chosen = contract.answers?.find((answer) => answer.id === resolution)
|
const chosen = contract.answers?.find((answer) => answer.id === resolution)
|
||||||
if (!chosen) return <AnswerNumberLabel number={resolution} />
|
if (!chosen) return <AnswerNumberLabel number={resolution} />
|
||||||
return (
|
return (
|
||||||
<Tooltip text={chosen.text}>
|
<AnswerLabel
|
||||||
<AnswerLabel
|
answer={chosen}
|
||||||
answer={chosen}
|
truncate={truncate}
|
||||||
truncate={truncate}
|
className={answerClassName}
|
||||||
className={answerClassName}
|
/>
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,11 +163,13 @@ export function AnswerLabel(props: {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span
|
<Tooltip text={truncated === text ? false : text}>
|
||||||
style={{ wordBreak: 'break-word' }}
|
<span
|
||||||
className={clsx('whitespace-pre-line break-words', className)}
|
style={{ wordBreak: 'break-word' }}
|
||||||
>
|
className={clsx('whitespace-pre-line break-words', className)}
|
||||||
{truncated}
|
>
|
||||||
</span>
|
{truncated}
|
||||||
|
</span>
|
||||||
|
</Tooltip>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user