diff --git a/web/components/contract/add-comment-bounty.tsx b/web/components/contract/add-comment-bounty.tsx index 68f2bbf9..686bca18 100644 --- a/web/components/contract/add-comment-bounty.tsx +++ b/web/components/contract/add-comment-bounty.tsx @@ -3,42 +3,27 @@ import { useUser } from 'web/hooks/use-user' import { useState } from 'react' import { addCommentBounty } from 'web/lib/firebase/api' import { track } from 'web/lib/service/analytics' -import { InfoTooltip } from 'web/components/info-tooltip' -import { BETTORS, PRESENT_BET } from 'common/user' import { Row } from 'web/components/layout/row' -import { AmountInput } from 'web/components/amount-input' import clsx from 'clsx' import { formatMoney } from 'common/util/format' +import { COMMENT_BOUNTY_AMOUNT } from 'common/economy' +import { Button } from 'web/components/button' export function AddCommentBountyPanel(props: { contract: Contract }) { const { contract } = props const { id: contractId, slug } = contract const user = useUser() - - const [amount, setAmount] = useState(undefined) + const amount = COMMENT_BOUNTY_AMOUNT const [error, setError] = useState(undefined) const [isSuccess, setIsSuccess] = useState(false) const [isLoading, setIsLoading] = useState(false) - const onAmountChange = (amount: number | undefined) => { - setIsSuccess(false) - setAmount(amount) - - // Check for errors. - if (amount !== undefined) { - if (user && user.balance < amount) { - setError('Insufficient balance') - } else if (amount < 1) { - setError('Minimum amount: ' + formatMoney(1)) - } else { - setError(undefined) - } - } - } - const submit = () => { - if (!amount) return + if ((user?.balance ?? 0) < amount) { + setError('Insufficient balance') + return + } setIsLoading(true) setIsSuccess(false) @@ -57,28 +42,20 @@ export function AddCommentBountyPanel(props: { contract: Contract }) { return ( <>
- Contribute your M$ to make this market more accurate.{' '} - + Add a {formatMoney(amount)} bounty for good comments that the creator + can award.
- - - + Add {formatMoney(amount)} bounty + + {error} {isSuccess && amount && ( diff --git a/web/components/contract/contract-tabs.tsx b/web/components/contract/contract-tabs.tsx index 202ae53e..4fbadeb6 100644 --- a/web/components/contract/contract-tabs.tsx +++ b/web/components/contract/contract-tabs.tsx @@ -28,6 +28,7 @@ import { formatMoney } from 'common/util/format' import { Button } from 'web/components/button' import { MINUTE_MS } from 'common/util/time' import { useUser } from 'web/hooks/use-user' +import { COMMENT_BOUNTY_AMOUNT } from 'common/economy' export function ContractTabs(props: { contract: Contract @@ -53,7 +54,9 @@ export function ContractTabs(props: { : '' }`, tooltip: openCommentBounties - ? 'The creator of this market will award bounties to good comments' + ? `The creator of this market will award bounties of ${formatMoney( + COMMENT_BOUNTY_AMOUNT + )} to good comments` : undefined, content: , }, diff --git a/web/components/contract/liquidity-bounty-panel.tsx b/web/components/contract/liquidity-bounty-panel.tsx index f4c69a37..e5770f60 100644 --- a/web/components/contract/liquidity-bounty-panel.tsx +++ b/web/components/contract/liquidity-bounty-panel.tsx @@ -41,6 +41,10 @@ export function LiquidityBountyPanel(props: { contract: Contract }) { return ( , + }, (isCreator || isAdmin) && isCPMM && { title: (isAdmin ? '[Admin] ' : '') + 'Subsidize', @@ -56,10 +60,7 @@ export function LiquidityBountyPanel(props: { contract: Contract }) { /> ), }, - { - title: 'Bounty Comments', - content: , - }, + isCPMM && { title: 'Pool', content: ,