remove comment bet area
This commit is contained in:
parent
a3da8a7c3c
commit
3d3caa7a42
|
@ -14,9 +14,7 @@ import { OutcomeLabel } from 'web/components/outcome-label'
|
||||||
import { CopyLinkDateTimeComponent } from 'web/components/feed/copy-link-date-time'
|
import { CopyLinkDateTimeComponent } from 'web/components/feed/copy-link-date-time'
|
||||||
import { firebaseLogin } from 'web/lib/firebase/users'
|
import { firebaseLogin } from 'web/lib/firebase/users'
|
||||||
import { createCommentOnContract } from 'web/lib/firebase/comments'
|
import { createCommentOnContract } from 'web/lib/firebase/comments'
|
||||||
import { BetStatusText } from 'web/components/feed/feed-bets'
|
|
||||||
import { Col } from 'web/components/layout/col'
|
import { Col } from 'web/components/layout/col'
|
||||||
import { getProbability } from 'common/calculate'
|
|
||||||
import { track } from 'web/lib/service/analytics'
|
import { track } from 'web/lib/service/analytics'
|
||||||
import { Tipper } from '../tipper'
|
import { Tipper } from '../tipper'
|
||||||
import { CommentTipMap, CommentTips } from 'web/hooks/use-tip-txns'
|
import { CommentTipMap, CommentTips } from 'web/hooks/use-tip-txns'
|
||||||
|
@ -301,74 +299,14 @@ export function ContractCommentInput(props: {
|
||||||
const { id } = mostRecentCommentableBet || { id: undefined }
|
const { id } = mostRecentCommentableBet || { id: undefined }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Col>
|
<CommentInput
|
||||||
<CommentBetArea
|
replyToUser={props.replyToUser}
|
||||||
betsByCurrentUser={props.betsByCurrentUser}
|
parentAnswerOutcome={props.parentAnswerOutcome}
|
||||||
contract={props.contract}
|
parentCommentId={props.parentCommentId}
|
||||||
commentsByCurrentUser={props.commentsByCurrentUser}
|
onSubmitComment={onSubmitComment}
|
||||||
parentAnswerOutcome={props.parentAnswerOutcome}
|
className={props.className}
|
||||||
user={useUser()}
|
presetId={id}
|
||||||
className={props.className}
|
/>
|
||||||
mostRecentCommentableBet={mostRecentCommentableBet}
|
|
||||||
/>
|
|
||||||
<CommentInput
|
|
||||||
replyToUser={props.replyToUser}
|
|
||||||
parentAnswerOutcome={props.parentAnswerOutcome}
|
|
||||||
parentCommentId={props.parentCommentId}
|
|
||||||
onSubmitComment={onSubmitComment}
|
|
||||||
className={props.className}
|
|
||||||
presetId={id}
|
|
||||||
/>
|
|
||||||
</Col>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
function CommentBetArea(props: {
|
|
||||||
betsByCurrentUser: Bet[]
|
|
||||||
contract: Contract
|
|
||||||
commentsByCurrentUser: ContractComment[]
|
|
||||||
parentAnswerOutcome?: string
|
|
||||||
user?: User | null
|
|
||||||
className?: string
|
|
||||||
mostRecentCommentableBet?: Bet
|
|
||||||
}) {
|
|
||||||
const { betsByCurrentUser, contract, user, mostRecentCommentableBet } = props
|
|
||||||
|
|
||||||
const { userPosition, outcome } = getBettorsLargestPositionBeforeTime(
|
|
||||||
contract,
|
|
||||||
Date.now(),
|
|
||||||
betsByCurrentUser
|
|
||||||
)
|
|
||||||
|
|
||||||
const isNumeric = contract.outcomeType === 'NUMERIC'
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Row className={clsx(props.className, 'mb-2 gap-1 sm:gap-2')}>
|
|
||||||
<div className="mb-1 text-gray-500">
|
|
||||||
{mostRecentCommentableBet && (
|
|
||||||
<BetStatusText
|
|
||||||
contract={contract}
|
|
||||||
bet={mostRecentCommentableBet}
|
|
||||||
isSelf={true}
|
|
||||||
hideOutcome={isNumeric || contract.outcomeType === 'FREE_RESPONSE'}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{!mostRecentCommentableBet && user && userPosition > 0 && !isNumeric && (
|
|
||||||
<>
|
|
||||||
{"You're"}
|
|
||||||
<CommentStatus
|
|
||||||
outcome={outcome}
|
|
||||||
contract={contract}
|
|
||||||
prob={
|
|
||||||
contract.outcomeType === 'BINARY'
|
|
||||||
? getProbability(contract)
|
|
||||||
: undefined
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</Row>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user