diff --git a/web/pages/create.tsx b/web/pages/create.tsx index 9cb0466e..09e2c3e1 100644 --- a/web/pages/create.tsx +++ b/web/pages/create.tsx @@ -89,16 +89,16 @@ export function NewContract(props: { question: string; tag?: string }) { // const [anteError, setAnteError] = useState() // By default, close the market a week from today const [closeDate, setCloseDate] = useState(weekFrom(dayjs())) - const [resolutionDate, setResolutionDate] = useState(weekFrom(closeDate)) const [closeHoursMinutes, setCloseHoursMinutes] = useState('23:59') + const [resolutionDate, setResolutionDate] = useState(weekFrom(closeDate)) + const [resolutionHoursMinutes, setResolutionHoursMinutes] = useState('23:59') const [probErrorText, setProbErrorText] = useState('') const [marketInfoText, setMarketInfoText] = useState('') + const [resolutionInfoText, setResolutionInfoText] = useState('') const [isSubmitting, setIsSubmitting] = useState(false) - const closeTime = closeDate - ? dayjs(`${closeDate}T${closeHoursMinutes}`).valueOf() - : undefined - const automaticResolutionTime = resolutionDate ? dayjs(resolutionDate).valueOf() : undefined + const closeTime = closeDate ? dayjs(`${closeDate}T${closeHoursMinutes}`).valueOf() : undefined + const automaticResolutionTime = resolutionDate ? dayjs(`${resolutionDate}TT${resolutionHoursMinutes}`).valueOf() : undefined const balance = creator?.balance || 0 @@ -376,80 +376,76 @@ export function NewContract(props: { question: string; tag?: string }) { {outcomeType === 'BINARY' && ( -
+
-
- - - - - - -
+ + { + setResolutionInfoText((choice === 'COMBINED' ? 'Automatic resolution is still experimental.' : '')) + setResolutionType(choice as resolutionType) + }} + choicesMap={{ + 'Manual': 'MANUAL', + 'Combined': 'COMBINED', + }} + isSubmitting={isSubmitting} + className={'col-span-4 sm:col-span-3'} + /> + {resolutionInfoText && ( +
+ {resolutionInfoText} +
+ )} {resolutionType === 'COMBINED' && ( -
- - Question resolves automatically as: +
+ + + setAutomaticResolution(choice as resolution)} + choicesMap={{ + 'YES': 'YES', + 'NO': 'NO', + 'MKT': 'PROB', + 'CANCEL': 'N/A', + }} + isSubmitting={isSubmitting} + className={'col-span-4 sm:col-span-3'} + /> + e.stopPropagation()} onChange={(e) => - setResolutionDate( - dayjs(e.target.value).format('YYYY-MM-DDT23:59') || '' - ) + setResolutionDate(dayjs(e.target.value).format('YYYY-MM-DDT23:59') || '') } min={Date.parse(closeDate??"")} // TODO: Fix: Market can be created with dates in the past disabled={isSubmitting} value={dayjs(resolutionDate).format('YYYY-MM-DD')} /> + e.stopPropagation()} + onChange={(e) => setResolutionHoursMinutes(e.target.value)} + min={'00:00'} + disabled={isSubmitting} + value={closeHoursMinutes} + /> +
)}
)} -