diff --git a/src/components/VerifiedAuthor.jsx b/src/components/VerifiedAuthor.jsx new file mode 100644 index 00000000..5a832381 --- /dev/null +++ b/src/components/VerifiedAuthor.jsx @@ -0,0 +1,10 @@ +import {useComment, useAuthorAddress} from '@plebbit/plebbit-react-hooks'; + +function VerifiedAuthor({ commentCid, children }) { + const comment = useComment({commentCid}); + const {authorAddress, shortAuthorAddress} = useAuthorAddress({comment}); + + return children({ authorAddress, shortAuthorAddress }); +} + +export default VerifiedAuthor; \ No newline at end of file diff --git a/src/components/views/All.jsx b/src/components/views/All.jsx index a6b45e42..68e4e058 100755 --- a/src/components/views/All.jsx +++ b/src/components/views/All.jsx @@ -21,6 +21,7 @@ import Post from '../Post'; import PostLoader from '../PostLoader'; import PostOnHover from '../PostOnHover'; import StateLabel from '../StateLabel'; +import VerifiedAuthor from '../VerifiedAuthor'; import ReplyModal from '../modals/ReplyModal'; import SettingsModal from '../modals/SettingsModal'; import findShortParentCid from '../../utils/findShortParentCid'; @@ -771,9 +772,9 @@ const All = () => { (u/ handleAddressClick(thread.author.shortAddress)} + onClick={() => handleAddressClick({({ shortAuthorAddress }) => (shortAuthorAddress)})} > - {thread.author.shortAddress} + {{({ shortAuthorAddress }) => (shortAuthorAddress)}} )   {getDate(thread.timestamp)} @@ -848,8 +849,8 @@ const All = () => { >