From 7e297331442620e25ada10ac764302842cd71cc0 Mon Sep 17 00:00:00 2001 From: ingawei Date: Thu, 6 Oct 2022 17:37:41 -0700 Subject: [PATCH] incorporating answer replies into general comments section --- web/components/comments/comments.tsx | 8 +- web/components/contract/contract-tabs.tsx | 189 +++++++++++------- .../feed/feed-answer-comment-group.tsx | 33 ++- web/components/feed/feed-comments.tsx | 76 ++++--- 4 files changed, 195 insertions(+), 111 deletions(-) diff --git a/web/components/comments/comments.tsx b/web/components/comments/comments.tsx index 1d4beeea..934efe53 100644 --- a/web/components/comments/comments.tsx +++ b/web/components/comments/comments.tsx @@ -9,7 +9,13 @@ export function ReplyToggle(props: { }) { const { seeReplies, numComments, onClick } = props return ( - + */} + {/* */} + + setSeeReplies(!seeReplies)} + /> +
+
- setSeeReplies(!seeReplies)} - /> {seeReplies && ( diff --git a/web/components/feed/feed-comments.tsx b/web/components/feed/feed-comments.tsx index b672fbde..0fdea8ed 100644 --- a/web/components/feed/feed-comments.tsx +++ b/web/components/feed/feed-comments.tsx @@ -1,5 +1,5 @@ import { ContractComment } from 'common/comment' -import { Contract } from 'common/contract' +import { AnyContractType, Contract } from 'common/contract' import React, { useEffect, useRef, useState } from 'react' import { useUser } from 'web/hooks/use-user' import { formatMoney } from 'common/util/format' @@ -115,39 +115,57 @@ export function FeedComment(props: { - - - - {onReplyClick && ( - - )} - {tips && } - {(contract.openCommentBounties ?? 0) > 0 && ( - - )} - - + {/* TODO: bug where if this is iFrame, it does not scroll */} + + ) } +export function CommentActions(props: { + showActions: boolean + onReplyClick?: () => void + tips?: CommentTips | undefined + comment: ContractComment + contract: Contract +}) { + const { showActions, onReplyClick, tips, comment, contract } = props + return ( + + {onReplyClick && ( + + )} + {tips && } + {(contract.openCommentBounties ?? 0) > 0 && ( + + )} + + ) +} + function CommentStatus(props: { contract: Contract outcome: string