Hide bet panels
This commit is contained in:
parent
147d49a913
commit
dc032c502a
|
@ -16,6 +16,7 @@ export function ContractTabs(props: {
|
||||||
comments: Comment[]
|
comments: Comment[]
|
||||||
}) {
|
}) {
|
||||||
const { contract, user, comments } = props
|
const { contract, user, comments } = props
|
||||||
|
const { outcomeType } = contract
|
||||||
|
|
||||||
const bets = useBets(contract.id) ?? props.bets
|
const bets = useBets(contract.id) ?? props.bets
|
||||||
// Decending creation time.
|
// Decending creation time.
|
||||||
|
@ -47,7 +48,7 @@ export function ContractTabs(props: {
|
||||||
}
|
}
|
||||||
betRowClassName="!mt-0 xl:hidden"
|
betRowClassName="!mt-0 xl:hidden"
|
||||||
/>
|
/>
|
||||||
{contract.outcomeType === 'FREE_RESPONSE' && (
|
{outcomeType === 'FREE_RESPONSE' && (
|
||||||
<Col className={'mt-8 flex w-full '}>
|
<Col className={'mt-8 flex w-full '}>
|
||||||
<div className={'text-md mt-8 mb-2 text-left'}>General Comments</div>
|
<div className={'text-md mt-8 mb-2 text-left'}>General Comments</div>
|
||||||
<div className={'mb-4 w-full border-b border-gray-200'} />
|
<div className={'mb-4 w-full border-b border-gray-200'} />
|
||||||
|
@ -81,8 +82,10 @@ export function ContractTabs(props: {
|
||||||
<Tabs
|
<Tabs
|
||||||
tabs={[
|
tabs={[
|
||||||
{ title: 'Comments', content: commentActivity },
|
{ title: 'Comments', content: commentActivity },
|
||||||
{ title: 'Bets', content: betActivity },
|
...(outcomeType === 'NUMERIC'
|
||||||
...(!user || !userBets?.length
|
? []
|
||||||
|
: [{ title: 'Bets', content: betActivity }]),
|
||||||
|
...(!user || !userBets?.length || outcomeType === 'NUMERIC'
|
||||||
? []
|
? []
|
||||||
: [{ title: 'Your bets', content: yourTrades }]),
|
: [{ title: 'Your bets', content: yourTrades }]),
|
||||||
]}
|
]}
|
||||||
|
|
|
@ -54,6 +54,7 @@ function NumericBuyPanel(props: {
|
||||||
undefined
|
undefined
|
||||||
)
|
)
|
||||||
const [betAmount, setBetAmount] = useState<number | undefined>(undefined)
|
const [betAmount, setBetAmount] = useState<number | undefined>(undefined)
|
||||||
|
const [valueError, setValueError] = useState<string | undefined>()
|
||||||
const [error, setError] = useState<string | undefined>()
|
const [error, setError] = useState<string | undefined>()
|
||||||
const [isSubmitting, setIsSubmitting] = useState(false)
|
const [isSubmitting, setIsSubmitting] = useState(false)
|
||||||
const [wasSubmitted, setWasSubmitted] = useState(false)
|
const [wasSubmitted, setWasSubmitted] = useState(false)
|
||||||
|
@ -129,8 +130,8 @@ function NumericBuyPanel(props: {
|
||||||
max={max}
|
max={max}
|
||||||
inputClassName="w-full max-w-none"
|
inputClassName="w-full max-w-none"
|
||||||
onChange={(bucket) => onBucketChange(bucket ? `${bucket}` : undefined)}
|
onChange={(bucket) => onBucketChange(bucket ? `${bucket}` : undefined)}
|
||||||
error={error}
|
error={valueError}
|
||||||
setError={setError}
|
setError={setValueError}
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user