Hide bet panels

This commit is contained in:
James Grugett 2022-05-06 15:18:36 -04:00
parent 147d49a913
commit dc032c502a
2 changed files with 9 additions and 5 deletions

View File

@ -16,6 +16,7 @@ export function ContractTabs(props: {
comments: Comment[]
}) {
const { contract, user, comments } = props
const { outcomeType } = contract
const bets = useBets(contract.id) ?? props.bets
// Decending creation time.
@ -47,7 +48,7 @@ export function ContractTabs(props: {
}
betRowClassName="!mt-0 xl:hidden"
/>
{contract.outcomeType === 'FREE_RESPONSE' && (
{outcomeType === 'FREE_RESPONSE' && (
<Col className={'mt-8 flex w-full '}>
<div className={'text-md mt-8 mb-2 text-left'}>General Comments</div>
<div className={'mb-4 w-full border-b border-gray-200'} />
@ -81,8 +82,10 @@ export function ContractTabs(props: {
<Tabs
tabs={[
{ title: 'Comments', content: commentActivity },
{ title: 'Bets', content: betActivity },
...(!user || !userBets?.length
...(outcomeType === 'NUMERIC'
? []
: [{ title: 'Bets', content: betActivity }]),
...(!user || !userBets?.length || outcomeType === 'NUMERIC'
? []
: [{ title: 'Your bets', content: yourTrades }]),
]}

View File

@ -54,6 +54,7 @@ function NumericBuyPanel(props: {
undefined
)
const [betAmount, setBetAmount] = useState<number | undefined>(undefined)
const [valueError, setValueError] = useState<string | undefined>()
const [error, setError] = useState<string | undefined>()
const [isSubmitting, setIsSubmitting] = useState(false)
const [wasSubmitted, setWasSubmitted] = useState(false)
@ -129,8 +130,8 @@ function NumericBuyPanel(props: {
max={max}
inputClassName="w-full max-w-none"
onChange={(bucket) => onBucketChange(bucket ? `${bucket}` : undefined)}
error={error}
setError={setError}
error={valueError}
setError={setValueError}
disabled={isSubmitting}
/>