From 404f3a6b0cb806d474277f453022b6ab337c4377 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Thu, 10 Mar 2022 00:12:00 -0600 Subject: [PATCH] FR: Show answer in feed for single bets. Show your bets on contract page feed --- web/components/contract-feed.tsx | 110 ++++++++++++++++++------------- 1 file changed, 66 insertions(+), 44 deletions(-) diff --git a/web/components/contract-feed.tsx b/web/components/contract-feed.tsx index 39a48cd0..6a507be4 100644 --- a/web/components/contract-feed.tsx +++ b/web/components/contract-feed.tsx @@ -42,6 +42,7 @@ import BetRow from './bet-row' import { parseTags } from '../../common/util/parse' import { Avatar } from './avatar' import { useAdmin } from '../hooks/use-admin' +import { Answer } from '../../common/answer' function FeedComment(props: { activityItem: any @@ -110,6 +111,12 @@ function FeedBet(props: { activityItem: any; feedType: FeedType }) { const bought = amount >= 0 ? 'bought' : 'sold' const money = formatMoney(Math.abs(amount)) + const answer = + feedType !== 'multi' && + (contract.answers?.find((answer: Answer) => answer?.id === outcome) as + | Answer + | undefined) + return ( <>
@@ -125,39 +132,42 @@ function FeedBet(props: { activityItem: any; feedType: FeedType }) {
)} -
-
- - {isSelf ? 'You' : isCreator ? contract.creatorName : 'A trader'} - {' '} - {bought} {money} - - - {canComment && ( - // Allow user to comment in an textarea if they are the creator -
-