BuyPanel doesn't need userBets
This commit is contained in:
parent
3d62567231
commit
4297bea6d7
|
@ -67,7 +67,7 @@ export function BetPanel(props: {
|
||||||
<div className="mb-6 text-2xl">Place your bet</div>
|
<div className="mb-6 text-2xl">Place your bet</div>
|
||||||
{/* <Title className={clsx('!mt-0 text-neutral')} text="Place a trade" /> */}
|
{/* <Title className={clsx('!mt-0 text-neutral')} text="Place a trade" /> */}
|
||||||
|
|
||||||
<BuyPanel contract={contract} user={user} userBets={userBets ?? []} />
|
<BuyPanel contract={contract} user={user} />
|
||||||
|
|
||||||
{user === null && (
|
{user === null && (
|
||||||
<button
|
<button
|
||||||
|
@ -178,7 +178,6 @@ export function BetPanelSwitcher(props: {
|
||||||
<BuyPanel
|
<BuyPanel
|
||||||
contract={contract}
|
contract={contract}
|
||||||
user={user}
|
user={user}
|
||||||
userBets={userBets ?? []}
|
|
||||||
selected={selected}
|
selected={selected}
|
||||||
onBuySuccess={onBetSuccess}
|
onBuySuccess={onBetSuccess}
|
||||||
/>
|
/>
|
||||||
|
@ -200,11 +199,10 @@ export function BetPanelSwitcher(props: {
|
||||||
function BuyPanel(props: {
|
function BuyPanel(props: {
|
||||||
contract: FullContract<DPM | CPMM, Binary>
|
contract: FullContract<DPM | CPMM, Binary>
|
||||||
user: User | null | undefined
|
user: User | null | undefined
|
||||||
userBets: Bet[]
|
|
||||||
selected?: 'YES' | 'NO'
|
selected?: 'YES' | 'NO'
|
||||||
onBuySuccess?: () => void
|
onBuySuccess?: () => void
|
||||||
}) {
|
}) {
|
||||||
const { contract, user, userBets, selected, onBuySuccess } = props
|
const { contract, user, selected, onBuySuccess } = props
|
||||||
|
|
||||||
const [betChoice, setBetChoice] = useState<'YES' | 'NO' | undefined>(selected)
|
const [betChoice, setBetChoice] = useState<'YES' | 'NO' | undefined>(selected)
|
||||||
const [betAmount, setBetAmount] = useState<number | undefined>(undefined)
|
const [betAmount, setBetAmount] = useState<number | undefined>(undefined)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user