multiple choice betting fix
This commit is contained in:
parent
e17a59ae23
commit
fd90bc353b
|
@ -184,6 +184,7 @@ export function AnswerBetPanel(props: {
|
|||
<Spacer h={6} />
|
||||
{user ? (
|
||||
<WarningConfirmationButton
|
||||
marketType="freeResponse"
|
||||
amount={betAmount}
|
||||
warning={warning}
|
||||
onSubmit={submitBet}
|
||||
|
@ -191,8 +192,7 @@ export function AnswerBetPanel(props: {
|
|||
disabled={!!betDisabled}
|
||||
openModalButtonClass={clsx(
|
||||
'btn self-stretch',
|
||||
betDisabled ? 'btn-disabled' : 'btn-primary',
|
||||
isSubmitting ? 'loading' : ''
|
||||
betDisabled ? 'btn-disabled' : 'btn-primary'
|
||||
)}
|
||||
/>
|
||||
) : (
|
||||
|
|
|
@ -393,6 +393,7 @@ export function BuyPanel(props: {
|
|||
|
||||
{user && (
|
||||
<WarningConfirmationButton
|
||||
marketType="binary"
|
||||
amount={betAmount}
|
||||
outcome={outcome}
|
||||
warning={warning}
|
||||
|
@ -401,7 +402,7 @@ export function BuyPanel(props: {
|
|||
openModalButtonClass={clsx(
|
||||
'btn mb-2 flex-1',
|
||||
betDisabled
|
||||
? 'btn-disabled bg-greyscale-1'
|
||||
? 'btn-disabled bg-greyscale-2'
|
||||
: outcome === 'NO'
|
||||
? 'border-none bg-red-400 hover:bg-red-500'
|
||||
: 'border-none bg-teal-500 hover:bg-teal-600'
|
||||
|
|
|
@ -9,6 +9,7 @@ import { formatMoney } from 'common/util/format'
|
|||
export function WarningConfirmationButton(props: {
|
||||
amount: number | undefined
|
||||
outcome?: 'YES' | 'NO' | undefined
|
||||
marketType: 'freeResponse' | 'binary'
|
||||
warning?: string
|
||||
onSubmit: () => void
|
||||
disabled?: boolean
|
||||
|
@ -25,15 +26,24 @@ export function WarningConfirmationButton(props: {
|
|||
openModalButtonClass,
|
||||
submitButtonClassName,
|
||||
outcome,
|
||||
marketType,
|
||||
} = props
|
||||
{
|
||||
console.log(outcome)
|
||||
}
|
||||
|
||||
if (!warning) {
|
||||
return (
|
||||
<button
|
||||
className={clsx(
|
||||
openModalButtonClass,
|
||||
isSubmitting ? 'loading' : '',
|
||||
(disabled || !outcome) && 'btn-disabled bg-greyscale-2'
|
||||
isSubmitting ? 'loading btn-disabled' : '',
|
||||
disabled && 'btn-disabled',
|
||||
marketType === 'binary'
|
||||
? !outcome
|
||||
? 'btn-disabled bg-greyscale-2'
|
||||
: ''
|
||||
: ''
|
||||
)}
|
||||
onClick={onSubmit}
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue
Block a user