From 596c6fe33d8045aed40af22a9c68d1bc0f20e34e Mon Sep 17 00:00:00 2001 From: jahooma Date: Tue, 4 Jan 2022 16:09:03 -0600 Subject: [PATCH] Show tags in contract details. --- web/components/contract-card.tsx | 56 +++++++++++++++++++--------- web/components/contract-overview.tsx | 2 +- web/components/linkify.tsx | 9 +++-- web/components/tweet-button.tsx | 2 +- 4 files changed, 47 insertions(+), 22 deletions(-) diff --git a/web/components/contract-card.tsx b/web/components/contract-card.tsx index 8fc729f7..70e5df9f 100644 --- a/web/components/contract-card.tsx +++ b/web/components/contract-card.tsx @@ -6,10 +6,11 @@ import { UserLink } from './user-page' import { Linkify } from './linkify' import { Contract, compute, path } from '../lib/firebase/contracts' import { Col } from './layout/col' +import { parseTags } from '../lib/util/parse' export function ContractCard(props: { contract: Contract }) { const { contract } = props - const { resolution } = contract + const { question, resolution } = contract const { probPercent } = compute(contract) return ( @@ -19,9 +20,7 @@ export function ContractCard(props: { contract: Contract }) {
-

- -

+

{question}

`#${tag}`) + return ( - -
- -
-
-
- {resolvedDate ? `${createdDate} - ${resolvedDate}` : createdDate} -
-
-
{formatMoney(truePool)} pool
-
+ + +
+ +
+
+
+ {resolvedDate ? `${createdDate} - ${resolvedDate}` : createdDate} +
+
+
{formatMoney(truePool)} pool
+
+ + {inlineTags &&
} + + + {tags.map((tag) => ( +
+ +
+ ))} +
+ ) } diff --git a/web/components/contract-overview.tsx b/web/components/contract-overview.tsx index e36b3d79..b3703dd3 100644 --- a/web/components/contract-overview.tsx +++ b/web/components/contract-overview.tsx @@ -67,7 +67,7 @@ export const ContractOverview = (props: { large /> - + { @@ -20,7 +20,10 @@ export function Linkify(props: { text: string }) { return ( <> {whitespace} - + {symbol} {tag} diff --git a/web/components/tweet-button.tsx b/web/components/tweet-button.tsx index fb20fc53..b9db405e 100644 --- a/web/components/tweet-button.tsx +++ b/web/components/tweet-button.tsx @@ -4,7 +4,7 @@ export function TweetButton(props: { tweetText?: string }) { return (