diff --git a/web/components/contract/contract-tabs.tsx b/web/components/contract/contract-tabs.tsx
index 955f0e10..536f00e5 100644
--- a/web/components/contract/contract-tabs.tsx
+++ b/web/components/contract/contract-tabs.tsx
@@ -149,81 +149,77 @@ const CommentsTabContent = memo(function CommentsTabContent(props: {
)
- if (contract.outcomeType === 'FREE_RESPONSE') {
- const sortedAnswers = sortBy(
- contract.answers,
- (a) => -getOutcomeProbability(contract, a.id)
- )
- const commentsByOutcome = groupBy(
- sortedComments,
- (c) => c.answerOutcome ?? c.betOutcome ?? '_'
- )
- const generalTopLevelComments = topLevelComments.filter(
- (c) => c.answerOutcome === undefined && c.betId === undefined
- )
+ // if (contract.outcomeType === 'FREE_RESPONSE') {
+ // const sortedAnswers = sortBy(
+ // contract.answers,
+ // (a) => -getOutcomeProbability(contract, a.id)
+ // )
+ // const commentsByOutcome = groupBy(
+ // sortedComments,
+ // (c) => c.answerOutcome ?? c.betOutcome ?? '_'
+ // )
+ // const generalTopLevelComments = topLevelComments.filter(
+ // (c) => c.answerOutcome === undefined && c.betId === undefined
+ // )
- return (
- <>
-
-
- {sortedAnswers.map((answer) => {
- const answerComments =
- commentsByOutcome[answer.number.toString()] ?? []
- if (answerComments.length > 0) {
- return (
-
- {/* */}
-
-
- )
- } else {
- return <>>
- }
- })}
- {sortRow}
-
- {generalTopLevelComments.map((comment) => (
-
- ))}
-
- >
- )
- } else {
- return (
- <>
- {sortRow}
-
- {topLevelComments.map((parent) => (
- c.createdTime
- )}
- tips={tips}
- />
- ))}
- >
- )
- }
+ // return (
+ // <>
+ //
+ //
+ // {sortedAnswers.map((answer) => {
+ // const answerComments =
+ // commentsByOutcome[answer.number.toString()] ?? []
+ // if (answerComments.length > 0) {
+ // return (
+ //
+ //
+ //
+ // )
+ // } else {
+ // return <>>
+ // }
+ // })}
+ //
+ // {sortRow}
+ // {generalTopLevelComments.map((comment) => (
+ //
+ // ))}
+ //
+ // >
+ // )
+ // } else {
+ return (
+ <>
+ {sortRow}
+
+ {topLevelComments.map((parent) => (
+ c.createdTime
+ )}
+ tips={tips}
+ />
+ ))}
+ >
+ )
+ // }
})
const BetsTabContent = memo(function BetsTabContent(props: {
diff --git a/web/components/contract/tip-button.tsx b/web/components/contract/tip-button.tsx
index 0315c676..344e4e20 100644
--- a/web/components/contract/tip-button.tsx
+++ b/web/components/contract/tip-button.tsx
@@ -37,7 +37,7 @@ export function TipButton(props: {
0 ? 'mr-2' : '',
userTipped ? 'fill-green-700 text-green-700' : ''
)}
diff --git a/web/components/feed/feed-answer-comment-group.tsx b/web/components/feed/feed-answer-comment-group.tsx
index 877f2f40..55b4ac06 100644
--- a/web/components/feed/feed-answer-comment-group.tsx
+++ b/web/components/feed/feed-answer-comment-group.tsx
@@ -51,15 +51,7 @@ export function FeedAnswerCommentGroup(props: {
ref={answerRef}
id={answerElementId}
>
-
-
- {seeReplies && (
-
- )}
-
+
answered
@@ -93,7 +85,7 @@ export function FeedAnswerCommentGroup(props: {
{seeReplies && (
-
+
{answerComments.map((comment) => (
-
{[parentComment].concat(threadComments).map((comment, commentIdx) => (
void
}) {
const { contract, comment, tips, indent, onReplyClick } = props
- const {
- text,
- content,
- userUsername,
- userName,
- userAvatarUrl,
- commenterPositionProb,
- commenterPositionShares,
- commenterPositionOutcome,
- createdTime,
- bountiesAwarded,
- } = comment
- const betOutcome = comment.betOutcome
- let bought: string | undefined
- let money: string | undefined
- if (comment.betAmount != null) {
- bought = comment.betAmount >= 0 ? 'bought' : 'sold'
- money = formatMoney(Math.abs(comment.betAmount))
- }
- const totalAwarded = bountiesAwarded ?? 0
+ const { text, content, userUsername, userAvatarUrl } = comment
const router = useRouter()
const highlighted = router.asPath.endsWith(`#${comment.id}`)
@@ -107,88 +86,64 @@ export function FeedComment(props: {
}
}, [highlighted])
+ const [showActions, setShowActions] = useState(false)
+
return (
)
}
@@ -246,3 +201,74 @@ export function ContractCommentInput(props: {
/>
)
}
+
+export function FeedCommentHeader(props: {
+ comment: ContractComment
+ contract: Contract
+}) {
+ const { comment, contract } = props
+ const {
+ userUsername,
+ userName,
+ commenterPositionProb,
+ commenterPositionShares,
+ commenterPositionOutcome,
+ createdTime,
+ bountiesAwarded,
+ } = comment
+ const betOutcome = comment.betOutcome
+ let bought: string | undefined
+ let money: string | undefined
+ if (comment.betAmount != null) {
+ bought = comment.betAmount >= 0 ? 'bought' : 'sold'
+ money = formatMoney(Math.abs(comment.betAmount))
+ }
+ const totalAwarded = bountiesAwarded ?? 0
+ return (
+
+
+ {' '}
+
+ {comment.betId == null &&
+ commenterPositionProb != null &&
+ commenterPositionOutcome != null &&
+ commenterPositionShares != null &&
+ commenterPositionShares > 0 &&
+ contract.outcomeType !== 'NUMERIC' && (
+ <>
+ {'is '}
+
+ >
+ )}
+ {bought} {money}
+ {contract.outcomeType !== 'FREE_RESPONSE' && betOutcome && (
+ <>
+ {' '}
+ of{' '}
+
+ >
+ )}
+
+
+ {totalAwarded > 0 && (
+
+ +{formatMoney(totalAwarded)}
+
+ )}
+
+
+ )
+}