This commit is contained in:
github-actions[bot] 2022-10-11 21:29:40 +00:00 committed by GitHub
commit cd3a9d9614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 9 deletions

View File

@ -21,7 +21,6 @@ import {
import {
AnswerLabel,
BinaryContractOutcomeLabel,
BinaryOutcomeLabel,
CancelLabel,
FreeResponseOutcomeLabel,
} from '../outcome-label'
@ -430,17 +429,16 @@ export function ContractCardProbChange(props: {
'items-center justify-between gap-4 pl-6 pr-4 pb-2 text-sm'
)}
>
<Row className="gap-1">
<Row className="gap-1 text-gray-700">
<div className="text-gray-500">Position</div>
{formatMoney(metrics.payout)}
<BinaryOutcomeLabel outcome={outcome} />
{formatMoney(metrics.payout)} {outcome}
</Row>
{dayMetrics && (
<>
<Row className="items-center">
<div className="mr-1 text-gray-500">Daily profit</div>
<ProfitBadgeMana amount={dayMetrics.profit} />
<ProfitBadgeMana amount={dayMetrics.profit} gray />
</Row>
</>
)}

View File

@ -28,10 +28,17 @@ export function ProfitBadge(props: {
)
}
export function ProfitBadgeMana(props: { amount: number; className?: string }) {
const { amount, className } = props
const colors =
amount > 0 ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800'
export function ProfitBadgeMana(props: {
amount: number
gray?: boolean
className?: string
}) {
const { amount, gray, className } = props
const colors = gray
? 'bg-gray-100 text-gray-700'
: amount > 0
? 'bg-gray-100 text-green-800'
: 'bg-gray-100 text-red-800'
const formatted =
ENV_CONFIG.moneyMoniker + (amount > 0 ? '+' : '') + amount.toFixed(0)