"Sign up to bet" => "Place my bet"; "Sign in to comment" => "Add my comment"; rename button to BetSignUpPrompt

This commit is contained in:
mantikoros 2022-08-28 15:44:22 -05:00
parent 9c15d5b96c
commit 926929880a
9 changed files with 28 additions and 25 deletions

View File

@ -24,7 +24,7 @@ import {
} from 'common/calculate-dpm'
import { Bet } from 'common/bet'
import { track } from 'web/lib/service/analytics'
import { SignUpPrompt } from '../sign-up-prompt'
import { BetSignUpPrompt } from '../sign-up-prompt'
import { isIOS } from 'web/lib/util/device'
import { AlertBox } from '../alert-box'
@ -204,7 +204,7 @@ export function AnswerBetPanel(props: {
{isSubmitting ? 'Submitting...' : 'Submit trade'}
</button>
) : (
<SignUpPrompt />
<BetSignUpPrompt />
)}
</Col>
)

View File

@ -10,6 +10,7 @@ import { useSaveBinaryShares } from './use-save-binary-shares'
import { Col } from './layout/col'
import { Button } from 'web/components/button'
import { firebaseLogin } from 'web/lib/firebase/users'
import { BetSignUpPrompt } from './sign-up-prompt'
/** Button that opens BetPanel in a new modal */
export default function BetButton(props: {
@ -32,15 +33,17 @@ export default function BetButton(props: {
return (
<>
<Col className={clsx('items-center', className)}>
<Button
size={'lg'}
className={clsx('my-auto inline-flex min-w-[75px] ', btnClassName)}
onClick={() => {
!user ? firebaseLogin() : setOpen(true)
}}
>
{user ? 'Bet' : 'Sign up to Bet'}
</Button>
{user ? (
<Button
size="lg"
className={clsx('my-auto inline-flex min-w-[75px] ', btnClassName)}
onClick={() => setOpen(true)}
>
Bet
</Button>
) : (
<BetSignUpPrompt />
)}
{user && (
<div className={'mt-1 w-24 text-center text-sm text-gray-500'}>

View File

@ -12,7 +12,7 @@ import { Row } from './layout/row'
import { YesNoSelector } from './yes-no-selector'
import { useUnfilledBets } from 'web/hooks/use-bets'
import { useUser } from 'web/hooks/use-user'
import { SignUpPrompt } from './sign-up-prompt'
import { BetSignUpPrompt } from './sign-up-prompt'
import { getCpmmProbability } from 'common/calculate-cpmm'
import { Col } from './layout/col'
import { XIcon } from '@heroicons/react/solid'
@ -112,7 +112,7 @@ export function BetInline(props: {
: 'Submit'}
</Button>
)}
<SignUpPrompt size="xs" />
<BetSignUpPrompt size="xs" />
<button
onClick={() => {
setProbAfter(undefined)

View File

@ -31,7 +31,7 @@ import { calculateCpmmSale, getCpmmProbability } from 'common/calculate-cpmm'
import { getFormattedMappedValue } from 'common/pseudo-numeric'
import { SellRow } from './sell-row'
import { useSaveBinaryShares } from './use-save-binary-shares'
import { SignUpPrompt } from './sign-up-prompt'
import { BetSignUpPrompt } from './sign-up-prompt'
import { isIOS } from 'web/lib/util/device'
import { ProbabilityOrNumericInput } from './probability-input'
import { track } from 'web/lib/service/analytics'
@ -86,7 +86,7 @@ export function BetPanel(props: {
unfilledBets={unfilledBets}
/>
<SignUpPrompt />
<BetSignUpPrompt />
{!user && <PlayMoneyDisclaimer />}
</Col>
@ -146,7 +146,7 @@ export function SimpleBetPanel(props: {
onBuySuccess={onBetSuccess}
/>
<SignUpPrompt />
<BetSignUpPrompt />
{!user && <PlayMoneyDisclaimer />}
</Col>

View File

@ -2,7 +2,7 @@ import { User } from 'common/user'
import { Contract } from 'common/contract'
import { Challenge } from 'common/challenge'
import { useEffect, useState } from 'react'
import { SignUpPrompt } from 'web/components/sign-up-prompt'
import { BetSignUpPrompt } from 'web/components/sign-up-prompt'
import { acceptChallenge, APIError } from 'web/lib/firebase/api'
import { Modal } from 'web/components/layout/modal'
import { Col } from 'web/components/layout/col'
@ -27,7 +27,7 @@ export function AcceptChallengeButton(props: {
setErrorText('')
}, [open])
if (!user) return <SignUpPrompt label="Accept this bet" className="mt-4" />
if (!user) return <BetSignUpPrompt label="Accept this bet" className="mt-4" />
const iAcceptChallenge = () => {
setLoading(true)

View File

@ -537,7 +537,7 @@ export function CommentInputTextArea(props: {
className={'btn btn-outline btn-sm mt-2 normal-case'}
onClick={() => submitComment(presetId)}
>
Sign in to comment
Add my comment
</button>
)}
</Row>

View File

@ -34,7 +34,7 @@ import {
import { FeedBet } from 'web/components/feed/feed-bets'
import { CPMMBinaryContract, NumericContract } from 'common/contract'
import { FeedLiquidity } from './feed-liquidity'
import { SignUpPrompt } from '../sign-up-prompt'
import { BetSignUpPrompt } from '../sign-up-prompt'
import { User } from 'common/user'
import { PlayMoneyDisclaimer } from '../play-money-disclaimer'
import { contractMetrics } from 'common/contract-details'
@ -70,7 +70,7 @@ export function FeedItems(props: {
{!user ? (
<Col className="mt-4 max-w-sm items-center xl:hidden">
<SignUpPrompt />
<BetSignUpPrompt />
<PlayMoneyDisclaimer />
</Col>
) : (

View File

@ -18,7 +18,7 @@ import { BucketInput } from './bucket-input'
import { Col } from './layout/col'
import { Row } from './layout/row'
import { Spacer } from './layout/spacer'
import { SignUpPrompt } from './sign-up-prompt'
import { BetSignUpPrompt } from './sign-up-prompt'
import { track } from 'web/lib/service/analytics'
export function NumericBetPanel(props: {
@ -34,7 +34,7 @@ export function NumericBetPanel(props: {
<NumericBuyPanel contract={contract} user={user} />
<SignUpPrompt />
<BetSignUpPrompt />
</Col>
)
}

View File

@ -4,7 +4,7 @@ import { firebaseLogin } from 'web/lib/firebase/users'
import { withTracking } from 'web/lib/service/analytics'
import { Button, SizeType } from './button'
export function SignUpPrompt(props: {
export function BetSignUpPrompt(props: {
label?: string
className?: string
size?: SizeType
@ -19,7 +19,7 @@ export function SignUpPrompt(props: {
size={size}
color="gradient"
>
{label ?? 'Sign up to bet!'}
{label ?? 'Place my bet!'}
</Button>
) : null
}