From 8839ffc492dbb026583278f02d9273ec034af424 Mon Sep 17 00:00:00 2001 From: jahooma Date: Tue, 11 Jan 2022 23:40:41 -0600 Subject: [PATCH] Require close date for new markets. Update description placeholder to say it's optional. --- web/pages/create.tsx | 51 ++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/web/pages/create.tsx b/web/pages/create.tsx index 36096990..3cd6430f 100644 --- a/web/pages/create.tsx +++ b/web/pages/create.tsx @@ -50,7 +50,8 @@ export default function NewContract() { question.length > 0 && (ante === undefined || (ante >= 0 && ante <= remainingBalance)) && // If set, closeTime must be in the future - (!closeTime || closeTime > Date.now()) + closeTime && + closeTime > Date.now() async function submit() { // TODO: Tell users why their contract is invalid @@ -74,7 +75,8 @@ export default function NewContract() { await router.push(path(result.contract as Contract)) } - const descriptionPlaceholder = `e.g. This market will resolve to “Yes” if, by June 2, 2021, 11:59:59 PM ET, Paxlovid (also known under PF-07321332)...` + // const descriptionPlaceholder = `e.g. This market will resolve to “Yes” if, by June 2, 2021, 11:59:59 PM ET, Paxlovid (also known under PF-07321332)...` + const descriptionPlaceholder = `(Optional) Provide more detail on how you will resolve this market.` if (!creator) return <> @@ -134,6 +136,28 @@ export default function NewContract() { +
+ + e.stopPropagation()} + onChange={(e) => setCloseDate(e.target.value || '')} + min={new Date().toISOString().split('T')[0]} + disabled={isSubmitting} + value={closeDate} + /> +
+ + + +
- - - -
- - e.stopPropagation()} - onChange={(e) => setCloseDate(e.target.value || '')} - min={new Date().toISOString().split('T')[0]} - disabled={isSubmitting} - value={closeDate} - /> -
-