@@ -36,14 +22,11 @@ export function ContractCard(props: { contract: Contract }) {
-
- {resolutionText || (
-
- {probPercent}
-
chance
-
- )}
-
+
@@ -54,6 +37,55 @@ export function ContractCard(props: { contract: Contract }) {
)
}
+export function ResolutionOrChance(props: {
+ resolution?: 'YES' | 'NO' | 'MKT' | 'CANCEL'
+ probPercent: string
+ large?: boolean
+ className?: string
+}) {
+ const { resolution, probPercent, large, className } = props
+
+ const resolutionColor = {
+ YES: 'text-primary',
+ NO: 'text-red-400',
+ MKT: 'text-blue-400',
+ CANCEL: 'text-yellow-400',
+ '': '', // Empty if unresolved
+ }[resolution || '']
+
+ const resolutionText = {
+ YES: 'YES',
+ NO: 'NO',
+ MKT: 'MKT',
+ CANCEL: 'N/A',
+ '': '',
+ }[resolution || '']
+
+ return (
+
+ {resolution ? (
+ <>
+
+ Resolved
+
+ {resolutionText}
+ >
+ ) : (
+ <>
+ {probPercent}
+
+ chance
+
+ >
+ )}
+
+ )
+}
+
export function ContractDetails(props: { contract: Contract }) {
const { contract } = props
const { truePool, createdDate, resolvedDate } = compute(contract)
diff --git a/web/components/contract-overview.tsx b/web/components/contract-overview.tsx
index 3dc5230c..23f2e7fb 100644
--- a/web/components/contract-overview.tsx
+++ b/web/components/contract-overview.tsx
@@ -14,7 +14,7 @@ import { Row } from './layout/row'
import dayjs from 'dayjs'
import { Linkify } from './linkify'
import clsx from 'clsx'
-import { ContractDetails } from './contract-card'
+import { ContractDetails, ResolutionOrChance } from './contract-card'
function ContractDescription(props: {
contract: Contract
@@ -84,40 +84,6 @@ function ContractDescription(props: {
)
}
-function ResolutionOrChance(props: {
- resolution?: 'YES' | 'NO' | 'MKT' | 'CANCEL'
- probPercent: string
- className?: string
-}) {
- const { resolution, probPercent, className } = props
-
- const resolutionColor = {
- YES: 'text-primary',
- NO: 'text-red-400',
- MKT: 'text-blue-400',
- CANCEL: 'text-yellow-400',
- '': '', // Empty if unresolved
- }[resolution || '']
-
- return (
-
- {resolution ? (
- <>
- Resolved
-
- {resolution === 'CANCEL' ? 'N/A' : resolution}
-
- >
- ) : (
- <>
- {probPercent}
- chance
- >
- )}
-
- )
-}
-
export const ContractOverview = (props: {
contract: Contract
className?: string
@@ -141,6 +107,7 @@ export const ContractOverview = (props: {
className="md:hidden"
resolution={resolution}
probPercent={probPercent}
+ large
/>
@@ -150,6 +117,7 @@ export const ContractOverview = (props: {
className="hidden md:flex md:items-end"
resolution={resolution}
probPercent={probPercent}
+ large
/>