From cc15eb2044d0b47018739c6463b52862762cb64d Mon Sep 17 00:00:00 2001 From: James Grugett Date: Sun, 20 Mar 2022 18:12:33 -0500 Subject: [PATCH] Make embedded market link a clickable link --- web/components/site-link.tsx | 2 +- web/pages/embed/[username]/[contractSlug].tsx | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/web/components/site-link.tsx b/web/components/site-link.tsx index c59e106a..8b19d93b 100644 --- a/web/components/site-link.tsx +++ b/web/components/site-link.tsx @@ -3,7 +3,7 @@ import Link from 'next/link' export const SiteLink = (props: { href: string - children: any + children?: any className?: string }) => { const { href, children, className } = props diff --git a/web/pages/embed/[username]/[contractSlug].tsx b/web/pages/embed/[username]/[contractSlug].tsx index 72ceea93..9a346ef8 100644 --- a/web/pages/embed/[username]/[contractSlug].tsx +++ b/web/pages/embed/[username]/[contractSlug].tsx @@ -5,6 +5,7 @@ import { FreeResponse, FullContract, } from '../../../../common/contract' +import { DOMAIN } from '../../../../common/envs/constants' import { AnswersGraph } from '../../../components/answers/answers-graph' import { ResolutionOrChance, @@ -15,10 +16,14 @@ import { Col } from '../../../components/layout/col' import { Row } from '../../../components/layout/row' import { Spacer } from '../../../components/layout/spacer' import { Linkify } from '../../../components/linkify' +import { SiteLink } from '../../../components/site-link' import { useContractWithPreload } from '../../../hooks/use-contract' import { fromPropz, usePropz } from '../../../hooks/use-propz' import { listAllBets } from '../../../lib/firebase/bets' -import { getContractFromSlug } from '../../../lib/firebase/contracts' +import { + contractPath, + getContractFromSlug, +} from '../../../lib/firebase/contracts' import Custom404 from '../../404' export const getStaticProps = fromPropz(getStaticPropz) @@ -78,8 +83,15 @@ function ContractEmbed(props: { contract: Contract; bets: Bet[] }) { const isBinary = outcomeType === 'BINARY' + const href = `https://${DOMAIN}${contractPath(contract)}` + return ( - + + +