manifold/web/components/sign-up-prompt.tsx
2022-09-08 00:16:48 -05:00

26 lines
646 B
TypeScript

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, SizeType } from './button'
export function BetSignUpPrompt(props: {
label?: string
className?: string
size?: SizeType
}) {
const { label, className, size = 'lg' } = props
const user = useUser()
return user === null ? (
<Button
onClick={withTracking(firebaseLogin, 'sign up to bet')}
className={className}
size={size}
color="gradient"
>
{label ?? 'Sign up to trade!'}
</Button>
) : null
}