placeholder when there aren't comments

This commit is contained in:
keyan 2023-05-10 19:41:17 -05:00
parent df1f1a483a
commit 5bb6b5f2e7
2 changed files with 3 additions and 2 deletions

@ -140,7 +140,7 @@ function TopLevelItem ({ item, noReply, ...props }) {
</div> </div>
{!noReply && {!noReply &&
<> <>
<Reply item={item} replyOpen /> <Reply item={item} replyOpen placeholder={item.ncomments ? undefined : 'start the conversation ...'} />
{!item.position && !item.isJob && !item.parentId && !item.bounty > 0 && <Related title={item.title} itemId={item.id} />} {!item.position && !item.isJob && !item.parentId && !item.bounty > 0 && <Related title={item.title} itemId={item.id} />}
{item.bounty > 0 && <PastBounties item={item} />} {item.bounty > 0 && <PastBounties item={item} />}
</>} </>}

@ -18,7 +18,7 @@ export function ReplyOnAnotherPage ({ parentId }) {
) )
} }
export default function Reply ({ item, onSuccess, replyOpen, children }) { export default function Reply ({ item, onSuccess, replyOpen, children, placeholder }) {
const [reply, setReply] = useState(replyOpen) const [reply, setReply] = useState(replyOpen)
const me = useMe() const me = useMe()
const parentId = item.id const parentId = item.id
@ -116,6 +116,7 @@ export default function Reply ({ item, onSuccess, replyOpen, children }) {
minRows={6} minRows={6}
autoFocus={!replyOpen} autoFocus={!replyOpen}
required required
placeholder={placeholder}
hint={me?.freeComments && me?.sats < 1 ? <span className='text-success'>{me.freeComments} free comments left</span> : null} hint={me?.freeComments && me?.sats < 1 ? <span className='text-success'>{me.freeComments} free comments left</span> : null}
innerRef={replyInput} innerRef={replyInput}
/> />