diff --git a/web/components/contract/contract-details.tsx b/web/components/contract/contract-details.tsx index 1587f8fc..a67c702a 100644 --- a/web/components/contract/contract-details.tsx +++ b/web/components/contract/contract-details.tsx @@ -109,8 +109,8 @@ export function ContractDetails(props: { disabled?: boolean }) { const { contract, bets, isCreator, disabled } = props - const { closeTime, creatorName, creatorUsername } = contract - const { volumeLabel, automaticResolutionDate, resolvedDate } = contractMetrics(contract) + const { closeTime, automaticResolutionTime, creatorName, creatorUsername } = contract + const { volumeLabel, resolvedDate } = contractMetrics(contract) return ( @@ -157,6 +157,7 @@ export function ContractDetails(props: { {/* {' - '}{' '} */} @@ -164,16 +165,6 @@ export function ContractDetails(props: { )} )} - - {!resolvedDate && contract.automaticResolutionTime && ( - - {automaticResolutionDate + ": " + contract.automaticResolution} - - )} - @@ -206,10 +197,11 @@ export function contractTextDetails(contract: Contract) { function EditableCloseDate(props: { closeTime: number + resolveTime: number | undefined contract: Contract isCreator: boolean }) { - const { closeTime, contract, isCreator } = props + const { closeTime, resolveTime, contract, isCreator } = props const [isEditingCloseTime, setIsEditingCloseTime] = useState(false) const [closeDate, setCloseDate] = useState( @@ -250,15 +242,30 @@ function EditableCloseDate(props: { /> ) : ( - Date.now() ? 'Trading ends:' : 'Trading ended:'} - time={closeTime} - > - {isSameYear - ? dayjs(closeTime).format('MMM D') - : dayjs(closeTime).format('MMM D, YYYY')} - {isSameDay && <> ({fromNow(closeTime)})} - + <> + Date.now() ? 'Trading ends:' : 'Trading ended:'} + time={closeTime} + > + {isSameYear + ? dayjs(closeTime).format('MMM D') + : dayjs(closeTime).format('MMM D, YYYY')} + {isSameDay && <> ({fromNow(closeTime)})} + + {resolveTime && ( + Date.now() ? 'Market resolves as \'MKT\':' : ''} + time={resolveTime} + > + {"/ "} + {isSameYear + ? dayjs(resolveTime).format('MMM D') + : dayjs(resolveTime).format('MMM D, YYYY')} + {isSameDay && <> ({fromNow(resolveTime)})} + {": 'MKT'"} + + )} + )} {isCreator &&