Show prob of FR answer as a bar chart (#200)

This commit is contained in:
Austin Chen 2022-05-12 14:04:51 -04:00 committed by GitHub
parent 25d3fbcc5f
commit e0d266887c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -948,6 +948,12 @@ function FeedAnswerGroup(props: {
/>
</Modal>
{type == 'answer' && (
<div
className="absolute -m-3 h-full rounded-tl-md bg-green-600 bg-opacity-10"
style={{ width: `${100 * Math.max(prob, 0.01)}%` }}
></div>
)}
<Row className="my-4 gap-3">
<div className="px-1">
<Avatar username={username} avatarUrl={avatarUrl} />
@ -980,9 +986,7 @@ function FeedAnswerGroup(props: {
<span
className={clsx(
'text-2xl',
tradingAllowed(contract)
? 'text-green-500'
: 'text-gray-500'
tradingAllowed(contract) ? 'text-primary' : 'text-gray-500'
)}
>
{probPercent}