James suggestions

This commit is contained in:
ingawei 2022-09-26 17:07:13 -07:00
parent 67fbd024f1
commit ed3d1c76e7
3 changed files with 18 additions and 41 deletions

View File

@ -41,20 +41,15 @@ export function AmountInput(props: {
return ( return (
<> <>
<Col className={className}> <Col className={className}>
<label> <label className={clsx(isMobile ? 'font-sm' : 'font-lg')}>
<span <span className={clsx('text-greyscale-4 absolute ml-2 mt-[9px]')}>
className={clsx(
'text-greyscale-4 absolute ml-2 mt-[9px]',
isMobile ? 'font-sm' : 'font-lg'
)}
>
{label} {label}
</span> </span>
<input <input
className={clsx( className={clsx(
'placeholder:text-greyscale-4 border-greyscale-2 rounded-md pl-9', 'placeholder:text-greyscale-4 border-greyscale-2 rounded-md pl-9',
error && 'input-error', error && 'input-error',
isMobile ? 'font-sm w-24' : 'font-lg', isMobile ? 'w-24' : '',
inputClassName inputClassName
)} )}
ref={inputRef} ref={inputRef}

View File

@ -83,17 +83,9 @@ export function BinaryMobileBetting(props: { contract: BinaryContract }) {
const { contract } = props const { contract } = props
const user = useUser() const user = useUser()
if (user) { if (user) {
return ( return <SignedInBinaryMobileBetting contract={contract} user={user} />
<>
<SignedInBinaryMobileBetting contract={contract} user={user} />
</>
)
} else { } else {
return ( return <BetSignUpPrompt className="w-full" />
<>
<BetSignUpPrompt className="w-full" />
</>
)
} }
} }

View File

@ -182,7 +182,6 @@ export function BuyPanel(props: {
const windowSize = useWindowSize() const windowSize = useWindowSize()
const initialOutcome = const initialOutcome =
windowSize.width && windowSize.width >= 1280 ? 'YES' : undefined windowSize.width && windowSize.width >= 1280 ? 'YES' : undefined
console.log('initialOutcome>', initialOutcome)
const [outcome, setOutcome] = useState<'YES' | 'NO' | undefined>( const [outcome, setOutcome] = useState<'YES' | 'NO' | undefined>(
initialOutcome initialOutcome
) )
@ -304,28 +303,19 @@ export function BuyPanel(props: {
return ( return (
<Col className={hidden ? 'hidden' : ''}> <Col className={hidden ? 'hidden' : ''}>
{!mobileView && (
<>
<YesNoSelector <YesNoSelector
className="mb-4" className="mb-4"
btnClassName="flex-1" btnClassName="flex-1"
selected={outcome} selected={outcome}
onSelect={(choice) => onBetChoice(choice)} onSelect={(choice) => {
if (mobileView) {
mobileOnBetChoice(choice)
} else {
onBetChoice(choice)
}
}}
isPseudoNumeric={isPseudoNumeric} isPseudoNumeric={isPseudoNumeric}
/> />
</>
)}
{mobileView && (
<>
<YesNoSelector
className="mb-4"
btnClassName="flex-1"
selected={outcome}
onSelect={(choice) => mobileOnBetChoice(choice)}
isPseudoNumeric={isPseudoNumeric}
/>
</>
)}
<Col <Col
className={clsx( className={clsx(