From 43c67b282025413e78e25c352367ec5c11d2ce21 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Sat, 15 Jan 2022 17:30:48 -0600 Subject: [PATCH] create page info tooltips; small bug fix: use balance instead of remainingBalance --- web/pages/create.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/web/pages/create.tsx b/web/pages/create.tsx index d25612c4..d6fde636 100644 --- a/web/pages/create.tsx +++ b/web/pages/create.tsx @@ -13,6 +13,8 @@ import { createContract } from '../lib/firebase/api-call' import { Row } from '../components/layout/row' import { AmountInput } from '../components/amount-input' import { MINIMUM_ANTE } from '../../common/antes' +import { InfoTooltip } from '../components/info-tooltip' +import { CREATOR_FEE } from '../../common/fees' // Allow user to create a new contract export default function NewContract() { @@ -44,10 +46,8 @@ export default function NewContract() { const [isSubmitting, setIsSubmitting] = useState(false) const closeTime = dateToMillis(closeDate) || undefined - // We'd like this to look like "Apr 2, 2022, 23:59:59 PM PT" but timezones are hard with dayjs - const formattedCloseTime = closeTime ? new Date(closeTime).toString() : '' - const remainingBalance = (creator?.balance || 0) - (ante || 0) + const balance = creator?.balance || 0 const isValid = initialProb > 0 && @@ -55,7 +55,7 @@ export default function NewContract() { question.length > 0 && ante !== undefined && ante >= MINIMUM_ANTE && - ante <= remainingBalance && + ante <= balance && // If set, closeTime must be in the future closeTime && closeTime > Date.now() @@ -162,7 +162,8 @@ export default function NewContract() {
-
+