diff --git a/src/components/views/Thread.jsx b/src/components/views/Thread.jsx index 0880ff0c..fb204a83 100644 --- a/src/components/views/Thread.jsx +++ b/src/components/views/Thread.jsx @@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef } from 'react'; import { Helmet } from 'react-helmet-async'; import { Link, useNavigate, useParams } from 'react-router-dom'; import { Tooltip } from 'react-tooltip'; -import { useComment, usePublishComment } from '@plebbit/plebbit-react-hooks'; +import { useAccount, useComment, usePublishComment } from '@plebbit/plebbit-react-hooks'; import { debounce } from 'lodash'; import useGeneralStore from '../../hooks/stores/useGeneralStore'; import { Container, NavBar, Header, Break, PostForm, PostFormTable, BoardForm } from '../styled/Board.styled'; @@ -53,6 +53,7 @@ const Thread = () => { const navigate = useNavigate(); const [prevScrollPos, setPrevScrollPos] = useState(0); const [visible, setVisible] = useState(true); + const account = useAccount(); const comment = useComment({commentCid: selectedThread}); const { subplebbitAddress, threadCid } = useParams(); const handleClickForm = useClickForm(); @@ -553,9 +554,22 @@ const Thread = () => { onClick={() => handleAddressClick(reply.author?.shortAddress)} > (u/ - - {reply.author?.shortAddress ?? reply.author.address} - ) + {reply.author?.shortAddress ? + ( + + {reply.author?.shortAddress} + + ) : ( + + {account.author.address.slice(0, 10) + "(...)"} + + ) + } + )   @@ -563,11 +577,13 @@ const Thread = () => {   {}} key={`pl1-${index}`} onClick={() => {}} title="Link to this post">c/ - + {reply.shortCid ? ( + + ) : ( + Pending + )}   {comment.replyCount === undefined ? : null} - {comment.replyCount > 0 && - renderedComments.map((reply, index) => { + {renderedComments.map((reply, index) => { const shortParentCid = findShortParentCid(reply.parentCid, comment); return (
@@ -772,9 +787,21 @@ const Thread = () => { onClick={() => handleAddressClick(reply.author?.shortAddress)} > (u/ - - {reply.author?.shortAddress} - + {reply.author?.shortAddress ? + ( + + {reply.author?.shortAddress} + + ) : ( + + {account.author.address.slice(0, 6) + "(...)"} + + ) + } )
@@ -782,9 +809,13 @@ const Thread = () => { {getDate(reply?.timestamp)}  {}} key={`mob-pl1-${index}`} onClick={() => {}} title="Link to this post">c/ - + {reply.shortCid ? ( + + ) : ( + Pending + )}