accept challenge button

This commit is contained in:
mantikoros 2022-08-02 16:44:05 -07:00
parent 754d4cb489
commit a16814b9c7
2 changed files with 9 additions and 6 deletions

View File

@ -28,7 +28,7 @@ export function AcceptChallengeButton(props: {
setErrorText('')
}, [open])
if (!user) return <SignUpPrompt label={'Sign up to accept this challenge'} />
if (!user) return <SignUpPrompt label="Accept this bet" className="mt-4" />
const iAcceptChallenge = () => {
setLoading(true)

View File

@ -2,17 +2,20 @@ 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'
export function SignUpPrompt(props: { label?: string }) {
const { label } = props
export function SignUpPrompt(props: { label?: string; className?: string }) {
const { label, className } = props
const user = useUser()
return user === null ? (
<button
className="btn flex-1 whitespace-nowrap border-none bg-gradient-to-r from-indigo-500 to-blue-500 px-10 text-lg font-medium normal-case hover:from-indigo-600 hover:to-blue-600"
<Button
onClick={withTracking(firebaseLogin, 'sign up to bet')}
className={className}
size="lg"
color="gradient"
>
{label ?? 'Sign up to bet!'}
</button>
</Button>
) : null
}