From b53de2239c511317916a4726d37a938a975908b0 Mon Sep 17 00:00:00 2001 From: Sinclair Chen Date: Thu, 12 May 2022 17:16:07 -0400 Subject: [PATCH] Add bet buttons to embed - Make only title link to market - Prevent avatar / username from being clicked on --- web/components/contract/contract-details.tsx | 23 +++++++++-------- web/pages/embed/[username]/[contractSlug].tsx | 25 ++++++++++++------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/web/components/contract/contract-details.tsx b/web/components/contract/contract-details.tsx index 21849cc4..e7cd96a5 100644 --- a/web/components/contract/contract-details.tsx +++ b/web/components/contract/contract-details.tsx @@ -70,9 +70,9 @@ export function ContractDetails(props: { contract: Contract bets: Bet[] isCreator?: boolean - hideShareButtons?: boolean + disabled?: boolean }) { - const { contract, bets, isCreator, hideShareButtons } = props + const { contract, bets, isCreator, disabled } = props const { closeTime, creatorName, creatorUsername } = contract const { volumeLabel, createdDate, resolvedDate } = contractMetrics(contract) @@ -83,13 +83,18 @@ export function ContractDetails(props: { - + {disabled ? ( + creatorName + ) : ( + + )} {(!!closeTime || !!resolvedDate) && ( @@ -131,9 +136,7 @@ export function ContractDetails(props: {
{volumeLabel}
- {!hideShareButtons && ( - - )} + {!disabled && } ) diff --git a/web/pages/embed/[username]/[contractSlug].tsx b/web/pages/embed/[username]/[contractSlug].tsx index 7792a633..494570c1 100644 --- a/web/pages/embed/[username]/[contractSlug].tsx +++ b/web/pages/embed/[username]/[contractSlug].tsx @@ -1,7 +1,14 @@ import { Bet } from 'common/bet' -import { Contract, DPM, FreeResponse, FullContract } from 'common/contract' +import { + BinaryContract, + Contract, + DPM, + FreeResponse, + FullContract, +} from 'common/contract' import { DOMAIN } from 'common/envs/constants' import { AnswersGraph } from 'web/components/answers/answers-graph' +import BetRow from 'web/components/bet-row' import { BinaryResolutionOrChance, FreeResponseResolutionOrChance, @@ -92,13 +99,8 @@ function ContractEmbed(props: { contract: Contract; bets: Bet[] }) { return (
- -
- + {question}
@@ -108,10 +110,15 @@ function ContractEmbed(props: { contract: Contract; bets: Bet[] }) { contract={contract} bets={bets} isCreator={false} - hideShareButtons + disabled /> - {isBinary && } + {isBinary && ( + + + + + )} {outcomeType === 'FREE_RESPONSE' && resolution && (