Small FR comments tweaks
This commit is contained in:
parent
aba818a9de
commit
8f5e51a304
|
@ -3,8 +3,6 @@ import { Bet } from 'common/bet'
|
||||||
import { Comment } from 'common/comment'
|
import { Comment } from 'common/comment'
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import { Col } from 'web/components/layout/col'
|
import { Col } from 'web/components/layout/col'
|
||||||
import { Modal } from 'web/components/layout/modal'
|
|
||||||
import { AnswerBetPanel } from 'web/components/answers/answer-bet-panel'
|
|
||||||
import { Row } from 'web/components/layout/row'
|
import { Row } from 'web/components/layout/row'
|
||||||
import { Avatar } from 'web/components/avatar'
|
import { Avatar } from 'web/components/avatar'
|
||||||
import { UserLink } from 'web/components/user-page'
|
import { UserLink } from 'web/components/user-page'
|
||||||
|
@ -34,7 +32,6 @@ export function FeedAnswerCommentGroup(props: {
|
||||||
const { username, avatarUrl, name, text } = answer
|
const { username, avatarUrl, name, text } = answer
|
||||||
|
|
||||||
const [replyToUsername, setReplyToUsername] = useState('')
|
const [replyToUsername, setReplyToUsername] = useState('')
|
||||||
const [open, setOpen] = useState(false)
|
|
||||||
const [showReply, setShowReply] = useState(false)
|
const [showReply, setShowReply] = useState(false)
|
||||||
const [inputRef, setInputRef] = useState<HTMLTextAreaElement | null>(null)
|
const [inputRef, setInputRef] = useState<HTMLTextAreaElement | null>(null)
|
||||||
const [highlighted, setHighlighted] = useState(false)
|
const [highlighted, setHighlighted] = useState(false)
|
||||||
|
@ -104,26 +101,15 @@ export function FeedAnswerCommentGroup(props: {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Col className={'relative flex-1 gap-3'} key={answer.id + 'comment'}>
|
<Col className={'relative flex-1 gap-3'} key={answer.id + 'comment'}>
|
||||||
<Modal open={open} setOpen={setOpen}>
|
|
||||||
<AnswerBetPanel
|
|
||||||
answer={answer}
|
|
||||||
contract={contract}
|
|
||||||
closePanel={() => setOpen(false)}
|
|
||||||
className="sm:max-w-84 !rounded-md bg-white !px-8 !py-6"
|
|
||||||
isModal={true}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
|
|
||||||
<Row
|
<Row
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'mt-4 flex gap-3 space-x-3 transition-all duration-1000',
|
'flex gap-3 space-x-3 pt-4 transition-all duration-1000',
|
||||||
highlighted ? `-m-2 my-3 rounded bg-indigo-500/[0.2] p-2` : ''
|
highlighted ? `-m-2 my-3 rounded bg-indigo-500/[0.2] p-2` : ''
|
||||||
)}
|
)}
|
||||||
id={answerElementId}
|
id={answerElementId}
|
||||||
>
|
>
|
||||||
<div className="px-1">
|
<Avatar username={username} avatarUrl={avatarUrl} />
|
||||||
<Avatar username={username} avatarUrl={avatarUrl} />
|
|
||||||
</div>
|
|
||||||
<Col className="min-w-0 flex-1 lg:gap-1">
|
<Col className="min-w-0 flex-1 lg:gap-1">
|
||||||
<div className="text-sm text-gray-500">
|
<div className="text-sm text-gray-500">
|
||||||
<UserLink username={username} name={name} /> answered
|
<UserLink username={username} name={name} /> answered
|
||||||
|
@ -135,25 +121,21 @@ export function FeedAnswerCommentGroup(props: {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Col className="align-items justify-between gap-4 sm:flex-row">
|
<Col className="align-items justify-between gap-2 sm:flex-row">
|
||||||
<span className="whitespace-pre-line text-lg">
|
<span className="whitespace-pre-line text-lg">
|
||||||
<Linkify text={text} />
|
<Linkify text={text} />
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<Row className="items-center justify-center gap-4">
|
{isFreeResponseContractPage && (
|
||||||
{isFreeResponseContractPage && (
|
<div className={'sm:hidden'}>
|
||||||
<div className={'sm:hidden'}>
|
<button
|
||||||
<button
|
className={'text-xs font-bold text-gray-500 hover:underline'}
|
||||||
className={
|
onClick={() => scrollAndOpenReplyInput(undefined, answer)}
|
||||||
'text-xs font-bold text-gray-500 hover:underline'
|
>
|
||||||
}
|
Reply
|
||||||
onClick={() => scrollAndOpenReplyInput(undefined, answer)}
|
</button>
|
||||||
>
|
</div>
|
||||||
Reply
|
)}
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</Row>
|
|
||||||
</Col>
|
</Col>
|
||||||
{isFreeResponseContractPage && (
|
{isFreeResponseContractPage && (
|
||||||
<div className={'justify-initial hidden sm:block'}>
|
<div className={'justify-initial hidden sm:block'}>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user