embeds: don't show bet button after resolution

This commit is contained in:
mantikoros 2022-07-13 17:22:22 -05:00
parent 7a49549389
commit e1b6619e9c

View File

@ -22,6 +22,7 @@ import { fromPropz, usePropz } from 'web/hooks/use-propz'
import { useWindowSize } from 'web/hooks/use-window-size' import { useWindowSize } from 'web/hooks/use-window-size'
import { listAllBets } from 'web/lib/firebase/bets' import { listAllBets } from 'web/lib/firebase/bets'
import { contractPath, getContractFromSlug } from 'web/lib/firebase/contracts' import { contractPath, getContractFromSlug } from 'web/lib/firebase/contracts'
import { tradingAllowed } from 'web/lib/firebase/contracts'
import Custom404 from '../../404' import Custom404 from '../../404'
export const getStaticProps = fromPropz(getStaticPropz) export const getStaticProps = fromPropz(getStaticPropz)
@ -112,17 +113,21 @@ function ContractEmbed(props: { contract: Contract; bets: Bet[] }) {
{isBinary && ( {isBinary && (
<Row className="items-center gap-4"> <Row className="items-center gap-4">
<BetRow {tradingAllowed(contract) && (
contract={contract as CPMMBinaryContract} <BetRow
betPanelClassName="scale-75" contract={contract as CPMMBinaryContract}
/> betPanelClassName="scale-75"
/>
)}
<BinaryResolutionOrChance contract={contract} /> <BinaryResolutionOrChance contract={contract} />
</Row> </Row>
)} )}
{isPseudoNumeric && ( {isPseudoNumeric && (
<Row className="items-center gap-4"> <Row className="items-center gap-4">
<BetRow contract={contract} betPanelClassName="scale-75" /> {tradingAllowed(contract) && (
<BetRow contract={contract} betPanelClassName="scale-75" />
)}
<PseudoNumericResolutionOrExpectation contract={contract} /> <PseudoNumericResolutionOrExpectation contract={contract} />
</Row> </Row>
)} )}