PlayMoneyDisclaimer; hide limit orders for signed out users; infobox styling

This commit is contained in:
mantikoros 2022-07-24 23:28:05 -07:00
parent e389f4cc3b
commit df91310d0f
2 changed files with 42 additions and 22 deletions

View File

@ -42,6 +42,7 @@ import { useUnfilledBets } from 'web/hooks/use-bets'
import { LimitBets } from './limit-bets' import { LimitBets } from './limit-bets'
import { PillButton } from './buttons/pill-button' import { PillButton } from './buttons/pill-button'
import { YesNoSelector } from './yes-no-selector' import { YesNoSelector } from './yes-no-selector'
import { InfoBox } from './info-box'
export function BetPanel(props: { export function BetPanel(props: {
contract: CPMMBinaryContract | PseudoNumericContract contract: CPMMBinaryContract | PseudoNumericContract
@ -72,6 +73,7 @@ export function BetPanel(props: {
<QuickOrLimitBet <QuickOrLimitBet
isLimitOrder={isLimitOrder} isLimitOrder={isLimitOrder}
setIsLimitOrder={setIsLimitOrder} setIsLimitOrder={setIsLimitOrder}
hideToggle={!user}
/> />
<BuyPanel <BuyPanel
hidden={isLimitOrder} hidden={isLimitOrder}
@ -85,7 +87,10 @@ export function BetPanel(props: {
user={user} user={user}
unfilledBets={unfilledBets} unfilledBets={unfilledBets}
/> />
<SignUpPrompt /> <SignUpPrompt />
{!user && <PlayMoneyDisclaimer />}
</Col> </Col>
{unfilledBets.length > 0 && ( {unfilledBets.length > 0 && (
<LimitBets className="mt-4" contract={contract} bets={unfilledBets} /> <LimitBets className="mt-4" contract={contract} bets={unfilledBets} />
@ -94,6 +99,14 @@ export function BetPanel(props: {
) )
} }
const PlayMoneyDisclaimer = () => (
<InfoBox
title="M$ are play-money"
className="mt-4 max-w-md"
text="Manifold Dollars are the play currency used by our platform to keep track of your bets. It's completely free for you and your friends to get started!"
/>
)
export function SimpleBetPanel(props: { export function SimpleBetPanel(props: {
contract: CPMMBinaryContract | PseudoNumericContract contract: CPMMBinaryContract | PseudoNumericContract
className?: string className?: string
@ -124,6 +137,7 @@ export function SimpleBetPanel(props: {
<QuickOrLimitBet <QuickOrLimitBet
isLimitOrder={isLimitOrder} isLimitOrder={isLimitOrder}
setIsLimitOrder={setIsLimitOrder} setIsLimitOrder={setIsLimitOrder}
hideToggle={!user}
/> />
<BuyPanel <BuyPanel
hidden={isLimitOrder} hidden={isLimitOrder}
@ -140,7 +154,10 @@ export function SimpleBetPanel(props: {
unfilledBets={unfilledBets} unfilledBets={unfilledBets}
onBuySuccess={onBetSuccess} onBuySuccess={onBetSuccess}
/> />
<SignUpPrompt /> <SignUpPrompt />
{!user && <PlayMoneyDisclaimer />}
</Col> </Col>
{unfilledBets.length > 0 && ( {unfilledBets.length > 0 && (
@ -688,12 +705,14 @@ function LimitOrderPanel(props: {
function QuickOrLimitBet(props: { function QuickOrLimitBet(props: {
isLimitOrder: boolean isLimitOrder: boolean
setIsLimitOrder: (isLimitOrder: boolean) => void setIsLimitOrder: (isLimitOrder: boolean) => void
hideToggle?: boolean
}) { }) {
const { isLimitOrder, setIsLimitOrder } = props const { isLimitOrder, setIsLimitOrder, hideToggle } = props
return ( return (
<Row className="align-center mb-4 justify-between"> <Row className="align-center mb-4 justify-between">
<div className="text-4xl">Bet</div> <div className="text-4xl">Bet</div>
{!hideToggle && (
<Row className="mt-1 items-center gap-2"> <Row className="mt-1 items-center gap-2">
<PillButton <PillButton
selected={!isLimitOrder} selected={!isLimitOrder}
@ -714,6 +733,7 @@ function QuickOrLimitBet(props: {
Limit Limit
</PillButton> </PillButton>
</Row> </Row>
)}
</Row> </Row>
) )
} }

View File

@ -20,7 +20,7 @@ export function InfoBox(props: {
</div> </div>
<div className="ml-3"> <div className="ml-3">
<h3 className="text-sm font-medium text-black">{title}</h3> <h3 className="text-sm font-medium text-black">{title}</h3>
<div className="mt-2 text-sm text-black"> <div className="mt-2 text-sm text-gray-600">
<Linkify text={text} /> <Linkify text={text} />
</div> </div>
</div> </div>