Clean up extra wrapper and CSS on BetRow (#178)

This commit is contained in:
Marshall Polaris 2022-05-11 14:35:50 -07:00 committed by GitHub
parent 02ed9bf7e1
commit 1063897c7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 38 deletions

View File

@ -303,6 +303,7 @@ function BuyPanel(props: {
<> <>
<YesNoSelector <YesNoSelector
className="mb-4" className="mb-4"
btnClassName="flex-1"
selected={betChoice} selected={betChoice}
onSelect={(choice) => onBetChoice(choice)} onSelect={(choice) => onBetChoice(choice)}
/> />

View File

@ -15,9 +15,9 @@ import { useSaveShares } from './use-save-shares'
export default function BetRow(props: { export default function BetRow(props: {
contract: FullContract<DPM | CPMM, Binary> contract: FullContract<DPM | CPMM, Binary>
className?: string className?: string
labelClassName?: string btnClassName?: string
}) { }) {
const { className, labelClassName, contract } = props const { className, btnClassName, contract } = props
const [open, setOpen] = useState(false) const [open, setOpen] = useState(false)
const [betChoice, setBetChoice] = useState<'YES' | 'NO' | undefined>( const [betChoice, setBetChoice] = useState<'YES' | 'NO' | undefined>(
undefined undefined
@ -31,12 +31,9 @@ export default function BetRow(props: {
return ( return (
<> <>
<Row className={clsx('mt-2 justify-end space-x-3', className)}>
{/* <div className={clsx('mr-2 text-gray-400', labelClassName)}>
Place a trade
</div> */}
<YesNoSelector <YesNoSelector
btnClassName="btn-sm w-24" className={clsx('mt-2 justify-end', className)}
btnClassName={clsx('btn-sm w-24', btnClassName)}
onSelect={(choice) => { onSelect={(choice) => {
setOpen(true) setOpen(true)
setBetChoice(choice) setBetChoice(choice)
@ -62,7 +59,6 @@ export default function BetRow(props: {
) : undefined ) : undefined
} }
/> />
</Row>
<Modal open={open} setOpen={setOpen}> <Modal open={open} setOpen={setOpen}>
<BetPanelSwitcher <BetPanelSwitcher
contract={contract} contract={contract}

View File

@ -53,9 +53,7 @@ export const ContractOverview = (props: {
<Row className="items-center justify-between gap-4 xl:hidden"> <Row className="items-center justify-between gap-4 xl:hidden">
<BinaryResolutionOrChance contract={contract} /> <BinaryResolutionOrChance contract={contract} />
{tradingAllowed(contract) && ( {tradingAllowed(contract) && <BetRow contract={contract} />}
<BetRow contract={contract} labelClassName="hidden" />
)}
</Row> </Row>
) : ( ) : (
outcomeType === 'FREE_RESPONSE' && outcomeType === 'FREE_RESPONSE' &&

View File

@ -22,7 +22,7 @@ export function YesNoSelector(props: {
} = props } = props
const commonClassNames = const commonClassNames =
'inline-flex flex-1 items-center justify-center rounded-3xl border-2 p-2' 'inline-flex items-center justify-center rounded-3xl border-2 p-2'
return ( return (
<Row className={clsx('space-x-3', className)}> <Row className={clsx('space-x-3', className)}>