manifold/web/components/sign-up-prompt.tsx
2022-09-08 07:40:16 -06:00

26 lines
648 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 predict!'}
</Button>
) : null
}