diff --git a/web/components/comments-list.tsx b/web/components/comments-list.tsx index ab9ed523..f8e1d7e1 100644 --- a/web/components/comments-list.tsx +++ b/web/components/comments-list.tsx @@ -17,58 +17,55 @@ export function UserCommentsList(props: { contractsById: { [id: string]: Contract } }) { const { comments, contractsById } = props - const commentsByContract = groupBy(comments, 'contractId') - const contractCommentPairs = Object.entries(commentsByContract) - .map( - ([contractId, comments]) => [contractsById[contractId], comments] as const - ) - .filter(([contract]) => contract) + // we don't show comments in groups here atm, just comments on contracts + const contractComments = comments.filter((c) => c.contractId) + const commentsByContract = groupBy(contractComments, 'contractId') return ( - {contractCommentPairs.map(([contract, comments]) => ( -
-
- + {Object.entries(commentsByContract).map(([contractId, comments]) => { + const contract = contractsById[contractId] + return ( +
+ {contract.question} + {comments.map((comment) => ( + + ))}
- {comments.map((comment) => ( -
-
- -
-
- ))} -
- ))} + ) + })} ) } -function ProfileComment(props: { comment: Comment }) { - const { comment } = props +function ProfileComment(props: { comment: Comment; className?: string }) { + const { comment, className } = props const { text, userUsername, userName, userAvatarUrl, createdTime } = comment // TODO: find and attach relevant bets by comment betId at some point return ( -
- - -
-
-

- {' '} - -

-
- -
-
-
+ + +
+

+ {' '} + +

+ +
+
) }