From 359bfbf614ea3dd92fd9d2114aea7e6fbc785f3e Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Sat, 5 Feb 2022 22:19:10 -0800 Subject: [PATCH] Show your own avatar for your feed trades --- web/components/contract-feed.tsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/web/components/contract-feed.tsx b/web/components/contract-feed.tsx index 32db9013..f902ea4e 100644 --- a/web/components/contract-feed.tsx +++ b/web/components/contract-feed.tsx @@ -95,9 +95,9 @@ function FeedBet(props: { activityItem: any }) { const { activityItem } = props const { id, contractId, amount, outcome, createdTime } = activityItem const user = useUser() - const isCreator = user?.id == activityItem.userId + const isSelf = user?.id == activityItem.userId // The creator can comment if the bet was posted in the last hour - const canComment = isCreator && Date.now() - createdTime < 60 * 60 * 1000 + const canComment = isSelf && Date.now() - createdTime < 60 * 60 * 1000 const [comment, setComment] = useState('') async function submitComment() { @@ -111,15 +111,19 @@ function FeedBet(props: { activityItem: any }) { return ( <>
-
-
-
+ )}
- {isCreator ? 'You' : 'A trader'} {bought} {money} of{' '} + {isSelf ? 'You' : 'A trader'} {bought} {money} of{' '} {canComment && ( // Allow user to comment in an textarea if they are the creator