linting
This commit is contained in:
parent
141856fd1f
commit
2b3378f5df
|
@ -2,7 +2,6 @@ import { sortBy, partition, sum } from 'lodash'
|
|||
import { useEffect, useState } from 'react'
|
||||
|
||||
import {
|
||||
Contract,
|
||||
FreeResponseContract,
|
||||
MultipleChoiceContract,
|
||||
} from 'common/contract'
|
||||
|
@ -29,11 +28,7 @@ import { useAdmin } from 'web/hooks/use-admin'
|
|||
import { needsAdminToResolve } from 'web/pages/[username]/[contractSlug]'
|
||||
import { CATEGORY_COLORS } from '../charts/contract/choice'
|
||||
import { useChartAnswers } from '../charts/contract/choice'
|
||||
import { ChatAlt2Icon, ChatAltIcon } from '@heroicons/react/solid'
|
||||
import { ChatIcon } from '@heroicons/react/outline'
|
||||
import { ReplyTo } from '../feed/feed-comments'
|
||||
import { InfoTooltip } from '../info-tooltip'
|
||||
import { Tooltip } from '../tooltip'
|
||||
|
||||
// TODO: get a color
|
||||
// export function useAnswerColor(answer: Answer, contract:Contract) {
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
import { PaperAirplaneIcon, XCircleIcon, XIcon } from '@heroicons/react/solid'
|
||||
import { scrollIntoView } from '@tiptap/core/dist/packages/core/src/commands'
|
||||
import { PaperAirplaneIcon, XCircleIcon } 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, useRef, useState } from 'react'
|
||||
import { useEvent } from 'web/hooks/use-event'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useUser } from 'web/hooks/use-user'
|
||||
import { MAX_COMMENT_LENGTH } from 'web/lib/firebase/comments'
|
||||
import Curve from 'web/public/custom-components/curve'
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { memo, useState } from 'react'
|
||||
import { getOutcomeProbability } from 'common/calculate'
|
||||
import { Pagination } from 'web/components/pagination'
|
||||
import { FeedBet } from '../feed/feed-bets'
|
||||
import { FeedLiquidity } from '../feed/feed-liquidity'
|
||||
|
@ -25,7 +24,6 @@ import {
|
|||
import { buildArray } from 'common/util/array'
|
||||
import { ContractComment } from 'common/comment'
|
||||
|
||||
import { Button } from 'web/components/button'
|
||||
import { MINUTE_MS } from 'common/util/time'
|
||||
import { useUser } from 'web/hooks/use-user'
|
||||
import { Tooltip } from 'web/components/tooltip'
|
||||
|
@ -37,15 +35,8 @@ import {
|
|||
} from 'web/hooks/use-persistent-state'
|
||||
import { safeLocalStorage } from 'web/lib/util/local'
|
||||
import TriangleDownFillIcon from 'web/lib/icons/triangle-down-fill-icon'
|
||||
import { connectStorageEmulator } from 'firebase/storage'
|
||||
import { Avatar } from '../avatar'
|
||||
import { UserLink } from '../user-link'
|
||||
import { CopyLinkDateTimeComponent } from '../feed/copy-link-date-time'
|
||||
import { Linkify } from '../linkify'
|
||||
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: {
|
||||
|
|
|
@ -20,13 +20,9 @@ import { Editor } from '@tiptap/react'
|
|||
import { UserLink } from 'web/components/user-link'
|
||||
import { CommentInput } from '../comment-input'
|
||||
import { AwardBountyButton } from 'web/components/award-bounty-button'
|
||||
import { ReplyIcon, XIcon } from '@heroicons/react/solid'
|
||||
import { ReplyIcon } from '@heroicons/react/solid'
|
||||
import { Button } from '../button'
|
||||
import { ReplyToggle } from '../comments/comments'
|
||||
import { CommentsAnswer } from './feed-answer-comment-group'
|
||||
import Curve from 'web/public/custom-components/curve'
|
||||
import { Answer } from 'common/answer'
|
||||
import { useEvent } from 'web/hooks/use-event'
|
||||
|
||||
export type ReplyTo = { id: string; username: string }
|
||||
|
||||
|
@ -60,7 +56,7 @@ export function FeedCommentThread(props: {
|
|||
/>
|
||||
</Col>
|
||||
{seeReplies &&
|
||||
threadComments.map((comment, commentIdx) => (
|
||||
threadComments.map((comment, _commentIdx) => (
|
||||
<FeedComment
|
||||
key={comment.id}
|
||||
contract={contract}
|
||||
|
@ -118,8 +114,6 @@ export function ParentFeedComment(props: {
|
|||
}
|
||||
}, [highlighted])
|
||||
|
||||
const [showActions, setShowActions] = useState(false)
|
||||
|
||||
return (
|
||||
<Row
|
||||
ref={commentRef}
|
||||
|
@ -367,42 +361,3 @@ export function FeedCommentHeader(props: {
|
|||
</Row>
|
||||
)
|
||||
}
|
||||
|
||||
export function AnswerCommentInput(props: {
|
||||
contract: Contract<AnyContractType>
|
||||
answerResponse: Answer
|
||||
onCancelAnswerResponse?: () => void
|
||||
}) {
|
||||
const { contract, answerResponse, onCancelAnswerResponse } = props
|
||||
const [replyTo, setReplyTo] = useState<ReplyTo | undefined>({
|
||||
id: answerResponse.id,
|
||||
username: answerResponse.username,
|
||||
})
|
||||
const onSubmitComment = useEvent(() => {
|
||||
setReplyTo(undefined)
|
||||
onCancelAnswerResponse
|
||||
})
|
||||
return (
|
||||
<>
|
||||
<Row className="gap-2">
|
||||
<CommentsAnswer answer={answerResponse} contract={contract} />
|
||||
</Row>
|
||||
<Row>
|
||||
<div className="ml-1">
|
||||
<Curve size={28} strokeWidth={1} color="#D8D8EB" />
|
||||
</div>
|
||||
<div className="w-full pt-1">
|
||||
<ContractCommentInput
|
||||
contract={contract}
|
||||
parentAnswerOutcome={answerResponse.number.toString()}
|
||||
replyTo={replyTo}
|
||||
onSubmitComment={onSubmitComment}
|
||||
/>
|
||||
</div>
|
||||
<button onClick={onCancelAnswerResponse}>
|
||||
<XIcon className="h-5 w-5" />
|
||||
</button>
|
||||
</Row>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import clsx from 'clsx'
|
||||
import { useRouter, NextRouter } from 'next/router'
|
||||
import { ReactNode, useEffect, useState } from 'react'
|
||||
import { ReactNode, useState } from 'react'
|
||||
import { track } from '@amplitude/analytics-browser'
|
||||
import { Col } from './col'
|
||||
import { Tooltip } from 'web/components/tooltip'
|
||||
|
|
Loading…
Reference in New Issue
Block a user