"Sign up to bet" => "Place my bet"; "Sign in to comment" => "Add my comment"; rename button to BetSignUpPrompt
This commit is contained in:
parent
9c15d5b96c
commit
926929880a
|
@ -24,7 +24,7 @@ import {
|
||||||
} from 'common/calculate-dpm'
|
} from 'common/calculate-dpm'
|
||||||
import { Bet } from 'common/bet'
|
import { Bet } from 'common/bet'
|
||||||
import { track } from 'web/lib/service/analytics'
|
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 { isIOS } from 'web/lib/util/device'
|
||||||
import { AlertBox } from '../alert-box'
|
import { AlertBox } from '../alert-box'
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ export function AnswerBetPanel(props: {
|
||||||
{isSubmitting ? 'Submitting...' : 'Submit trade'}
|
{isSubmitting ? 'Submitting...' : 'Submit trade'}
|
||||||
</button>
|
</button>
|
||||||
) : (
|
) : (
|
||||||
<SignUpPrompt />
|
<BetSignUpPrompt />
|
||||||
)}
|
)}
|
||||||
</Col>
|
</Col>
|
||||||
)
|
)
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { useSaveBinaryShares } from './use-save-binary-shares'
|
||||||
import { Col } from './layout/col'
|
import { Col } from './layout/col'
|
||||||
import { Button } from 'web/components/button'
|
import { Button } from 'web/components/button'
|
||||||
import { firebaseLogin } from 'web/lib/firebase/users'
|
import { firebaseLogin } from 'web/lib/firebase/users'
|
||||||
|
import { BetSignUpPrompt } from './sign-up-prompt'
|
||||||
|
|
||||||
/** Button that opens BetPanel in a new modal */
|
/** Button that opens BetPanel in a new modal */
|
||||||
export default function BetButton(props: {
|
export default function BetButton(props: {
|
||||||
|
@ -32,15 +33,17 @@ export default function BetButton(props: {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Col className={clsx('items-center', className)}>
|
<Col className={clsx('items-center', className)}>
|
||||||
<Button
|
{user ? (
|
||||||
size={'lg'}
|
<Button
|
||||||
className={clsx('my-auto inline-flex min-w-[75px] ', btnClassName)}
|
size="lg"
|
||||||
onClick={() => {
|
className={clsx('my-auto inline-flex min-w-[75px] ', btnClassName)}
|
||||||
!user ? firebaseLogin() : setOpen(true)
|
onClick={() => setOpen(true)}
|
||||||
}}
|
>
|
||||||
>
|
Bet
|
||||||
{user ? 'Bet' : 'Sign up to Bet'}
|
</Button>
|
||||||
</Button>
|
) : (
|
||||||
|
<BetSignUpPrompt />
|
||||||
|
)}
|
||||||
|
|
||||||
{user && (
|
{user && (
|
||||||
<div className={'mt-1 w-24 text-center text-sm text-gray-500'}>
|
<div className={'mt-1 w-24 text-center text-sm text-gray-500'}>
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { Row } from './layout/row'
|
||||||
import { YesNoSelector } from './yes-no-selector'
|
import { YesNoSelector } from './yes-no-selector'
|
||||||
import { useUnfilledBets } from 'web/hooks/use-bets'
|
import { useUnfilledBets } from 'web/hooks/use-bets'
|
||||||
import { useUser } from 'web/hooks/use-user'
|
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 { getCpmmProbability } from 'common/calculate-cpmm'
|
||||||
import { Col } from './layout/col'
|
import { Col } from './layout/col'
|
||||||
import { XIcon } from '@heroicons/react/solid'
|
import { XIcon } from '@heroicons/react/solid'
|
||||||
|
@ -112,7 +112,7 @@ export function BetInline(props: {
|
||||||
: 'Submit'}
|
: 'Submit'}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
<SignUpPrompt size="xs" />
|
<BetSignUpPrompt size="xs" />
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setProbAfter(undefined)
|
setProbAfter(undefined)
|
||||||
|
|
|
@ -31,7 +31,7 @@ import { calculateCpmmSale, getCpmmProbability } from 'common/calculate-cpmm'
|
||||||
import { getFormattedMappedValue } from 'common/pseudo-numeric'
|
import { getFormattedMappedValue } from 'common/pseudo-numeric'
|
||||||
import { SellRow } from './sell-row'
|
import { SellRow } from './sell-row'
|
||||||
import { useSaveBinaryShares } from './use-save-binary-shares'
|
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 { isIOS } from 'web/lib/util/device'
|
||||||
import { ProbabilityOrNumericInput } from './probability-input'
|
import { ProbabilityOrNumericInput } from './probability-input'
|
||||||
import { track } from 'web/lib/service/analytics'
|
import { track } from 'web/lib/service/analytics'
|
||||||
|
@ -86,7 +86,7 @@ export function BetPanel(props: {
|
||||||
unfilledBets={unfilledBets}
|
unfilledBets={unfilledBets}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SignUpPrompt />
|
<BetSignUpPrompt />
|
||||||
|
|
||||||
{!user && <PlayMoneyDisclaimer />}
|
{!user && <PlayMoneyDisclaimer />}
|
||||||
</Col>
|
</Col>
|
||||||
|
@ -146,7 +146,7 @@ export function SimpleBetPanel(props: {
|
||||||
onBuySuccess={onBetSuccess}
|
onBuySuccess={onBetSuccess}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SignUpPrompt />
|
<BetSignUpPrompt />
|
||||||
|
|
||||||
{!user && <PlayMoneyDisclaimer />}
|
{!user && <PlayMoneyDisclaimer />}
|
||||||
</Col>
|
</Col>
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { User } from 'common/user'
|
||||||
import { Contract } from 'common/contract'
|
import { Contract } from 'common/contract'
|
||||||
import { Challenge } from 'common/challenge'
|
import { Challenge } from 'common/challenge'
|
||||||
import { useEffect, useState } from 'react'
|
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 { acceptChallenge, APIError } from 'web/lib/firebase/api'
|
||||||
import { Modal } from 'web/components/layout/modal'
|
import { Modal } from 'web/components/layout/modal'
|
||||||
import { Col } from 'web/components/layout/col'
|
import { Col } from 'web/components/layout/col'
|
||||||
|
@ -27,7 +27,7 @@ export function AcceptChallengeButton(props: {
|
||||||
setErrorText('')
|
setErrorText('')
|
||||||
}, [open])
|
}, [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 = () => {
|
const iAcceptChallenge = () => {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
|
|
|
@ -537,7 +537,7 @@ export function CommentInputTextArea(props: {
|
||||||
className={'btn btn-outline btn-sm mt-2 normal-case'}
|
className={'btn btn-outline btn-sm mt-2 normal-case'}
|
||||||
onClick={() => submitComment(presetId)}
|
onClick={() => submitComment(presetId)}
|
||||||
>
|
>
|
||||||
Sign in to comment
|
Add my comment
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
@ -34,7 +34,7 @@ import {
|
||||||
import { FeedBet } from 'web/components/feed/feed-bets'
|
import { FeedBet } from 'web/components/feed/feed-bets'
|
||||||
import { CPMMBinaryContract, NumericContract } from 'common/contract'
|
import { CPMMBinaryContract, NumericContract } from 'common/contract'
|
||||||
import { FeedLiquidity } from './feed-liquidity'
|
import { FeedLiquidity } from './feed-liquidity'
|
||||||
import { SignUpPrompt } from '../sign-up-prompt'
|
import { BetSignUpPrompt } from '../sign-up-prompt'
|
||||||
import { User } from 'common/user'
|
import { User } from 'common/user'
|
||||||
import { PlayMoneyDisclaimer } from '../play-money-disclaimer'
|
import { PlayMoneyDisclaimer } from '../play-money-disclaimer'
|
||||||
import { contractMetrics } from 'common/contract-details'
|
import { contractMetrics } from 'common/contract-details'
|
||||||
|
@ -70,7 +70,7 @@ export function FeedItems(props: {
|
||||||
|
|
||||||
{!user ? (
|
{!user ? (
|
||||||
<Col className="mt-4 max-w-sm items-center xl:hidden">
|
<Col className="mt-4 max-w-sm items-center xl:hidden">
|
||||||
<SignUpPrompt />
|
<BetSignUpPrompt />
|
||||||
<PlayMoneyDisclaimer />
|
<PlayMoneyDisclaimer />
|
||||||
</Col>
|
</Col>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
@ -18,7 +18,7 @@ import { BucketInput } from './bucket-input'
|
||||||
import { Col } from './layout/col'
|
import { Col } from './layout/col'
|
||||||
import { Row } from './layout/row'
|
import { Row } from './layout/row'
|
||||||
import { Spacer } from './layout/spacer'
|
import { Spacer } from './layout/spacer'
|
||||||
import { SignUpPrompt } from './sign-up-prompt'
|
import { BetSignUpPrompt } from './sign-up-prompt'
|
||||||
import { track } from 'web/lib/service/analytics'
|
import { track } from 'web/lib/service/analytics'
|
||||||
|
|
||||||
export function NumericBetPanel(props: {
|
export function NumericBetPanel(props: {
|
||||||
|
@ -34,7 +34,7 @@ export function NumericBetPanel(props: {
|
||||||
|
|
||||||
<NumericBuyPanel contract={contract} user={user} />
|
<NumericBuyPanel contract={contract} user={user} />
|
||||||
|
|
||||||
<SignUpPrompt />
|
<BetSignUpPrompt />
|
||||||
</Col>
|
</Col>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { firebaseLogin } from 'web/lib/firebase/users'
|
||||||
import { withTracking } from 'web/lib/service/analytics'
|
import { withTracking } from 'web/lib/service/analytics'
|
||||||
import { Button, SizeType } from './button'
|
import { Button, SizeType } from './button'
|
||||||
|
|
||||||
export function SignUpPrompt(props: {
|
export function BetSignUpPrompt(props: {
|
||||||
label?: string
|
label?: string
|
||||||
className?: string
|
className?: string
|
||||||
size?: SizeType
|
size?: SizeType
|
||||||
|
@ -19,7 +19,7 @@ export function SignUpPrompt(props: {
|
||||||
size={size}
|
size={size}
|
||||||
color="gradient"
|
color="gradient"
|
||||||
>
|
>
|
||||||
{label ?? 'Sign up to bet!'}
|
{label ?? 'Place my bet!'}
|
||||||
</Button>
|
</Button>
|
||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user