diff --git a/web/components/comment-input.tsx b/web/components/comment-input.tsx index 6304b58d..a7798c63 100644 --- a/web/components/comment-input.tsx +++ b/web/components/comment-input.tsx @@ -1,12 +1,18 @@ -import { PaperAirplaneIcon } from '@heroicons/react/solid' +import { PaperAirplaneIcon, XIcon } from '@heroicons/react/solid' import { Editor } from '@tiptap/react' import clsx from 'clsx' +import { Answer } from 'common/answer' +import { AnyContractType, Contract } from 'common/contract' import { User } from 'common/user' import { useEffect, useState } from 'react' +import { useEvent } from 'web/hooks/use-event' import { useUser } from 'web/hooks/use-user' import { MAX_COMMENT_LENGTH } from 'web/lib/firebase/comments' +import Curve from 'web/public/custom-components/curve' import { Avatar } from './avatar' import { TextEditor, useTextEditor } from './editor' +import { CommentsAnswer } from './feed/feed-answer-comment-group' +import { ContractCommentInput, ReplyTo } from './feed/feed-comments' import { Row } from './layout/row' import { LoadingIndicator } from './loading-indicator' @@ -151,3 +157,42 @@ export function CommentInputTextArea(props: { ) } + +export function AnswerCommentInput(props: { + contract: Contract + answerResponse: Answer + onCancelAnswerResponse?: () => void +}) { + const { contract, answerResponse, onCancelAnswerResponse } = props + // const [replyTo, setReplyTo] = useState({ + // id: answerResponse.id, + // username: answerResponse.username, + // }) + + return ( + <> + + + + +
+ +
+
+ +
+ +
+ + ) +} diff --git a/web/components/contract/contract-tabs.tsx b/web/components/contract/contract-tabs.tsx index 72e62d86..b30c36aa 100644 --- a/web/components/contract/contract-tabs.tsx +++ b/web/components/contract/contract-tabs.tsx @@ -4,12 +4,7 @@ import { Pagination } from 'web/components/pagination' import { FeedBet } from '../feed/feed-bets' import { FeedLiquidity } from '../feed/feed-liquidity' import { CommentsAnswer } from '../feed/feed-answer-comment-group' -import { - FeedCommentThread, - ContractCommentInput, - CommentActions, - AnswerCommentInput, -} from '../feed/feed-comments' +import { FeedCommentThread, ContractCommentInput } from '../feed/feed-comments' import { groupBy, sortBy, sum } from 'lodash' import { Bet } from 'common/bet' import { Contract } from 'common/contract' @@ -51,6 +46,7 @@ import { ArrowRightIcon, ReplyIcon, XIcon } from '@heroicons/react/solid' import Curve from 'web/public/custom-components/curve' import { Answer } from 'common/answer' import dayjs from 'dayjs' +import { AnswerCommentInput } from '../comment-input' export function ContractTabs(props: { contract: Contract @@ -111,6 +107,7 @@ const CommentsTabContent = memo(function CommentsTabContent(props: { onCancelAnswerResponse?: () => void }) { const { contract, answerResponse, onCancelAnswerResponse } = props + console.log(answerResponse) const tips = useTipTxns({ contractId: contract.id }) const comments = useComments(contract.id) ?? props.comments const [sort, setSort] = usePersistentState<'Newest' | 'Best'>('Newest', {