ContractCard: color resolution text

This commit is contained in:
mantikoros 2021-12-14 11:43:51 -06:00
parent 9cbfbc5275
commit 72f77c668f

View File

@ -24,6 +24,17 @@ export function ContractDetails(props: { contract: Contract }) {
function ContractCard(props: { contract: Contract }) { function ContractCard(props: { contract: Contract }) {
const { contract } = props const { contract } = props
const { probPercent } = compute(contract) const { probPercent } = compute(contract)
const { resolution } = contract
const resolutionColor = (
resolution === 'YES'
? 'text-primary'
: resolution === 'NO'
? 'text-red-400'
: resolution === 'CANCEL'
? 'text-yellow-400'
: ''
)
return ( return (
<Link href={`/contract/${contract.id}`}> <Link href={`/contract/${contract.id}`}>
@ -42,7 +53,7 @@ function ContractCard(props: { contract: Contract }) {
{/* Right side of card */} {/* Right side of card */}
<Col> <Col>
<Col className="text-4xl mx-auto items-end"> <Col className={'text-4xl mx-auto items-end ' + resolutionColor}>
{contract.resolution || ( {contract.resolution || (
<div className="text-primary"> <div className="text-primary">
{probPercent} {probPercent}