diff --git a/web/components/bet-inline.tsx b/web/components/bet-inline.tsx index 7b12a297..76db2ef4 100644 --- a/web/components/bet-inline.tsx +++ b/web/components/bet-inline.tsx @@ -9,6 +9,8 @@ import { BuyAmountInput } from './amount-input' import { Button } from './button' import { Row } from './layout/row' import { YesNoSelector } from './yes-no-selector' +import { useUser } from 'web/hooks/use-user' +import { SignUpPrompt } from './sign-up-prompt' export function BetInline(props: { contract: CPMMBinaryContract | PseudoNumericContract @@ -16,8 +18,9 @@ export function BetInline(props: { }) { const { contract, className } = props - const [outcome, setOutcome] = useState<'YES' | 'NO'>('YES') + const user = useUser() + const [outcome, setOutcome] = useState<'YES' | 'NO'>('YES') const [amount, setAmount] = useState() const [error, setError] = useState() @@ -64,18 +67,21 @@ export function BetInline(props: { error="" // handle error ourselves setError={setError} /> - + {user && ( + + )} + ) } diff --git a/web/components/button.tsx b/web/components/button.tsx index 57b2add9..843f74ca 100644 --- a/web/components/button.tsx +++ b/web/components/button.tsx @@ -1,20 +1,23 @@ import { ReactNode } from 'react' import clsx from 'clsx' +export type SizeType = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' +export type ColorType = + | 'green' + | 'red' + | 'blue' + | 'indigo' + | 'yellow' + | 'gray' + | 'gradient' + | 'gray-white' + export function Button(props: { className?: string onClick?: () => void children?: ReactNode - size?: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' - color?: - | 'green' - | 'red' - | 'blue' - | 'indigo' - | 'yellow' - | 'gray' - | 'gradient' - | 'gray-white' + size?: SizeType + color?: ColorType type?: 'button' | 'reset' | 'submit' disabled?: boolean }) { diff --git a/web/components/sign-up-prompt.tsx b/web/components/sign-up-prompt.tsx index 8882ccfd..6a55fc28 100644 --- a/web/components/sign-up-prompt.tsx +++ b/web/components/sign-up-prompt.tsx @@ -2,17 +2,21 @@ import React from 'react' import { useUser } from 'web/hooks/use-user' import { firebaseLogin } from 'web/lib/firebase/users' import { withTracking } from 'web/lib/service/analytics' -import { Button } from './button' +import { Button, SizeType } from './button' -export function SignUpPrompt(props: { label?: string; className?: string }) { - const { label, className } = props +export function SignUpPrompt(props: { + label?: string + className?: string + size?: SizeType +}) { + const { label, className, size = 'lg' } = props const user = useUser() return user === null ? (