Fix bet modal probability sticking (#793)

* Fix button group styles
* Reset prob strike-out when bet modal closed
This commit is contained in:
Sinclair Chen 2022-08-23 14:31:52 -07:00 committed by GitHub
parent bea94d58c5
commit 7da4eb8fe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,7 @@ import { formatMoney } from 'common/util/format'
export function BetInline(props: { export function BetInline(props: {
contract: CPMMBinaryContract | PseudoNumericContract contract: CPMMBinaryContract | PseudoNumericContract
className?: string className?: string
setProbAfter: (probAfter: number) => void setProbAfter: (probAfter: number | undefined) => void
onClose: () => void onClose: () => void
}) { }) {
const { contract, className, setProbAfter, onClose } = props const { contract, className, setProbAfter, onClose } = props
@ -82,7 +82,7 @@ export function BetInline(props: {
<div className="text-xl">Bet</div> <div className="text-xl">Bet</div>
<YesNoSelector <YesNoSelector
className="space-x-0" className="space-x-0"
btnClassName="rounded-none first:rounded-l-2xl last:rounded-r-2xl" btnClassName="rounded-l-none rounded-r-none first:rounded-l-2xl last:rounded-r-2xl"
selected={outcome} selected={outcome}
onSelect={setOutcome} onSelect={setOutcome}
isPseudoNumeric={isPseudoNumeric} isPseudoNumeric={isPseudoNumeric}
@ -113,7 +113,12 @@ export function BetInline(props: {
</Button> </Button>
)} )}
<SignUpPrompt size="xs" /> <SignUpPrompt size="xs" />
<button onClick={onClose}> <button
onClick={() => {
setProbAfter(undefined)
onClose()
}}
>
<XIcon className="ml-1 h-6 w-6" /> <XIcon className="ml-1 h-6 w-6" />
</button> </button>
</Row> </Row>