From 0fdcde058d5ed8a5ec003e34529481315218064e Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Wed, 23 Feb 2022 14:52:14 -0800 Subject: [PATCH] Show a mini-feed under each FR answer --- web/components/answers/answer-item.tsx | 40 +++++++------- web/components/contract-feed.tsx | 73 +++++++++++++++++++------- 2 files changed, 74 insertions(+), 39 deletions(-) diff --git a/web/components/answers/answer-item.tsx b/web/components/answers/answer-item.tsx index 7952a347..a761c151 100644 --- a/web/components/answers/answer-item.tsx +++ b/web/components/answers/answer-item.tsx @@ -15,6 +15,7 @@ import { formatPercent } from '../../../common/util/format' import { getOutcomeProbability } from '../../../common/calculate' import { tradingAllowed } from '../../lib/firebase/contracts' import { AnswerBetPanel } from './answer-bet-panel' +import { ContractFeed } from '../contract-feed' export function AnswerItem(props: { answer: Answer @@ -50,11 +51,11 @@ export function AnswerItem(props: { return ( - + {text} - + {/* TODO: replace with ContractDetails */} + {name} - - • - - - - {createdDate} - - - • - #{number} + + {isBetting && ( + + )} {isBetting ? ( @@ -92,11 +94,11 @@ export function AnswerItem(props: { closePanel={() => setIsBetting(false)} /> ) : ( - + {!wasResolvedTo && (showChoice === 'checkbox' ? ( - + Choose this answer {showChoice === 'radio' && ( {tradingAllowed(contract) && ( { setIsBetting(true) }} diff --git a/web/components/contract-feed.tsx b/web/components/contract-feed.tsx index 61e96c7a..7ce2f3e4 100644 --- a/web/components/contract-feed.tsx +++ b/web/components/contract-feed.tsx @@ -46,7 +46,7 @@ import { useAdmin } from '../hooks/use-admin' function FeedComment(props: { activityItem: any moreHref: string - feedType: 'activity' | 'market' + feedType: FeedType }) { const { activityItem, moreHref, feedType } = props const { person, text, amount, outcome, createdTime } = activityItem @@ -65,7 +65,8 @@ function FeedComment(props: { username={person.username} name={person.name} />{' '} - {bought} {money} of {' '} + {bought} {money} +