diff --git a/web/components/bet-panel.tsx b/web/components/bet-panel.tsx index 17e41dff..4fa4774a 100644 --- a/web/components/bet-panel.tsx +++ b/web/components/bet-panel.tsx @@ -16,7 +16,6 @@ import { formatWithCommas, } from 'common/util/format' import { getBinaryCpmmBetInfo } from 'common/new-bet' -import { Title } from './title' import { User } from 'web/lib/firebase/users' import { Bet, LimitBet } from 'common/bet' import { APIError, placeBet } from 'web/lib/firebase/api' diff --git a/web/components/bets-list.tsx b/web/components/bets-list.tsx index ffa536ca..2a7da76e 100644 --- a/web/components/bets-list.tsx +++ b/web/components/bets-list.tsx @@ -48,7 +48,7 @@ import { Pagination } from './pagination' import { LimitBets } from './limit-bets' type BetSort = 'newest' | 'profit' | 'closeTime' | 'value' -type BetFilter = 'open' | 'sold' | 'closed' | 'resolved' | 'all' +type BetFilter = 'open' | 'limit_bet' | 'sold' | 'closed' | 'resolved' | 'all' const CONTRACTS_PER_PAGE = 20 @@ -110,6 +110,7 @@ export function BetsList(props: { open: (c) => !(FILTERS.closed(c) || FILTERS.resolved(c)), all: () => true, sold: () => true, + limit_bet: (c) => FILTERS.open(c), } const SORTS: Record number> = { profit: (c) => contractsMetrics[c.id].profit, @@ -130,6 +131,8 @@ export function BetsList(props: { const { hasShares } = contractsMetrics[c.id] if (filter === 'sold') return !hasShares + if (filter === 'limit_bet') + return (contractBets[c.id] ?? []).some((b) => b.limitProb !== undefined) return hasShares }) const displayedContracts = filteredContracts.slice(start, end) @@ -185,6 +188,7 @@ export function BetsList(props: { onChange={(e) => setFilter(e.target.value as BetFilter)} > +