Move mobile limit bets list into bet dialog.
This commit is contained in:
parent
5648595272
commit
c00681abd8
|
@ -120,9 +120,11 @@ export function SimpleBetPanel(props: {
|
|||
const { contract, className, selected, onBetSuccess } = props
|
||||
|
||||
const user = useUser()
|
||||
const unfilledBets = useUnfilledBets(contract.id) ?? []
|
||||
const [isLimitOrder, setIsLimitOrder] = useState(false)
|
||||
|
||||
const unfilledBets = useUnfilledBets(contract.id) ?? []
|
||||
const yourUnfilledBets = unfilledBets.filter((bet) => bet.userId === user?.id)
|
||||
|
||||
return (
|
||||
<Col className={className}>
|
||||
<Col className={clsx('rounded-b-md rounded-t-md bg-white px-8 py-6')}>
|
||||
|
@ -151,6 +153,14 @@ export function SimpleBetPanel(props: {
|
|||
|
||||
<SignUpPrompt />
|
||||
</Col>
|
||||
|
||||
{yourUnfilledBets.length > 0 && (
|
||||
<LimitBets
|
||||
className="mt-4"
|
||||
contract={contract}
|
||||
bets={yourUnfilledBets}
|
||||
/>
|
||||
)}
|
||||
</Col>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -38,14 +38,13 @@ import { FeedComment } from 'web/components/feed/feed-comments'
|
|||
import { FeedBet } from 'web/components/feed/feed-bets'
|
||||
import { useIsIframe } from 'web/hooks/use-is-iframe'
|
||||
import ContractEmbedPage from '../embed/[username]/[contractSlug]'
|
||||
import { useBets, useUnfilledBets } from 'web/hooks/use-bets'
|
||||
import { CPMMBinaryContract, PseudoNumericContract } from 'common/contract'
|
||||
import { useBets } from 'web/hooks/use-bets'
|
||||
import { CPMMBinaryContract } from 'common/contract'
|
||||
import { AlertBox } from 'web/components/alert-box'
|
||||
import { useTracking } from 'web/hooks/use-tracking'
|
||||
import { CommentTipMap, useTipTxns } from 'web/hooks/use-tip-txns'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useLiquidity } from 'web/hooks/use-liquidity'
|
||||
import { LimitBets } from 'web/components/limit-bets'
|
||||
|
||||
export const getStaticProps = fromPropz(getStaticPropz)
|
||||
export async function getStaticPropz(props: {
|
||||
|
@ -129,8 +128,6 @@ export function ContractPageContent(
|
|||
const tips = useTipTxns({ contractId: contract.id })
|
||||
|
||||
const user = useUser()
|
||||
const unfilledBets = useUnfilledBets(contract.id) ?? []
|
||||
const yourUnfilledBets = unfilledBets.filter((bet) => bet.userId === user?.id)
|
||||
|
||||
const { width, height } = useWindowSize()
|
||||
|
||||
|
@ -221,14 +218,6 @@ export function ContractPageContent(
|
|||
|
||||
<ContractOverview contract={contract} bets={bets} />
|
||||
|
||||
{yourUnfilledBets.length > 0 && (
|
||||
<LimitBets
|
||||
className="mb-4 xl:hidden"
|
||||
contract={contract as CPMMBinaryContract | PseudoNumericContract}
|
||||
bets={yourUnfilledBets}
|
||||
/>
|
||||
)}
|
||||
|
||||
{isNumeric && (
|
||||
<AlertBox
|
||||
title="Warning"
|
||||
|
|
Loading…
Reference in New Issue
Block a user