mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
verify comment author addresses
This commit is contained in:
@@ -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;
|
||||
@@ -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/
|
||||
<span key={`pa-${index}`} className="poster-address address-desktop"
|
||||
id="reply-button" style={{cursor: "pointer"}}
|
||||
onClick={() => handleAddressClick(thread.author.shortAddress)}
|
||||
onClick={() => handleAddressClick(<VerifiedAuthor commentCid={thread.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>)}
|
||||
>
|
||||
{thread.author.shortAddress}
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>}
|
||||
</span>)
|
||||
|
||||
<span key={`dt-${index}`} className="date-time" data-utc="data">{getDate(thread.timestamp)}</span>
|
||||
@@ -848,8 +849,8 @@ const All = () => {
|
||||
>
|
||||
<ul className="post-menu-catalog">
|
||||
<li onClick={() => handleOptionClick(thread.cid)}>Hide thread</li>
|
||||
{thread.author.address === account?.author.address ||
|
||||
thread.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
<>
|
||||
<li onClick={() => {handleAuthorEditClick(thread); setSelectedAddress(thread.subplebbitAddress);}}>Edit post</li>
|
||||
<li onClick={() => {handleAuthorDeleteClick(thread); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
|
||||
@@ -857,8 +858,8 @@ const All = () => {
|
||||
) : null}
|
||||
{isModerator ? (
|
||||
<>
|
||||
{thread.author.address === account?.author.address ||
|
||||
thread.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
null
|
||||
) : (
|
||||
<li onClick={() => {
|
||||
@@ -1043,7 +1044,7 @@ const All = () => {
|
||||
|
||||
<span key={`pa-${index}`} className="poster-address address-desktop"
|
||||
id="reply-button" style={{cursor: "pointer"}}
|
||||
onClick={() => handleAddressClick(reply.author.shortAddress)}
|
||||
onClick={() => handleAddressClick(<VerifiedAuthor commentCid={reply.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>)}
|
||||
>
|
||||
(u/
|
||||
{reply.author?.shortAddress ?
|
||||
@@ -1138,8 +1139,8 @@ const All = () => {
|
||||
>
|
||||
<ul className="post-menu-catalog">
|
||||
<li onClick={() => handleOptionClick(reply.cid)}>Hide post</li>
|
||||
{reply.author.address === account?.author.address ||
|
||||
reply.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
<>
|
||||
<li onClick={() => {handleAuthorEditClick(reply); setSelectedAddress(thread.subplebbitAddress);}}>Edit post</li>
|
||||
<li onClick={() => {handleAuthorDeleteClick(reply); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
|
||||
@@ -1147,8 +1148,8 @@ const All = () => {
|
||||
) : null}
|
||||
{isModerator ? (
|
||||
<>
|
||||
{reply.author.address === account?.author.address ||
|
||||
reply.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
null
|
||||
) : (
|
||||
<li onClick={() => {
|
||||
@@ -1563,11 +1564,11 @@ const All = () => {
|
||||
|
||||
<span key={`mob-pa-${index}`} className="poster-address-mobile address-mobile"
|
||||
id="reply-button" style={{cursor: "pointer"}}
|
||||
onClick={() => handleAddressClick(thread.author.shortAddress)}
|
||||
onClick={() => handleAddressClick(<VerifiedAuthor commentCid={thread.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>)}
|
||||
>
|
||||
(u/
|
||||
<span key={`mob-ha-${index}`} className="highlight-address-mobile">
|
||||
{thread.author.shortAddress}
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>}
|
||||
</span>
|
||||
)
|
||||
</span>
|
||||
@@ -1803,7 +1804,7 @@ const All = () => {
|
||||
|
||||
<span key={`mob-pa-${index}`} className="poster-address-mobile address-mobile"
|
||||
id="reply-button" style={{cursor: "pointer"}}
|
||||
onClick={() => handleAddressClick(reply.author.shortAddress)}
|
||||
onClick={() => handleAddressClick(<VerifiedAuthor commentCid={reply.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>)}
|
||||
>
|
||||
(u/
|
||||
{reply.author?.shortAddress ?
|
||||
|
||||
@@ -13,6 +13,7 @@ import { TopBar, Footer, AuthorDeleteAlert } from '../styled/views/Thread.styled
|
||||
import CatalogLoader from '../CatalogLoader';
|
||||
import EditModal from '../modals/EditModal';
|
||||
import ImageBanner from '../ImageBanner';
|
||||
import VerifiedAuthor from '../VerifiedAuthor';
|
||||
import ModerationModal from '../modals/ModerationModal';
|
||||
import OfflineIndicator from '../OfflineIndicator';
|
||||
import SettingsModal from '../modals/SettingsModal';
|
||||
@@ -559,8 +560,8 @@ const AllCatalog = () => {
|
||||
>
|
||||
<ul className="post-menu-catalog">
|
||||
<li onClick={() => handleOptionClick(thread.cid)}>Hide thread</li>
|
||||
{thread.author.address === account?.author.address ||
|
||||
thread.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
<>
|
||||
<li onClick={() => handleAuthorEditClick(thread)}>Edit post</li>
|
||||
<li onClick={() => handleAuthorDeleteClick(thread)}>Delete post</li>
|
||||
@@ -568,8 +569,8 @@ const AllCatalog = () => {
|
||||
) : null}
|
||||
{isModerator ? (
|
||||
<>
|
||||
{thread.author.address === account?.author.address ||
|
||||
thread.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
null
|
||||
) : (
|
||||
<li onClick={() => {
|
||||
|
||||
@@ -22,6 +22,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';
|
||||
@@ -1417,9 +1418,9 @@ const Board = () => {
|
||||
(u/
|
||||
<span key={`pa-${index}`} className="poster-address address-desktop"
|
||||
id="reply-button" style={{cursor: "pointer"}}
|
||||
onClick={() => handleAddressClick(thread.author.shortAddress)}
|
||||
onClick={() => handleAddressClick(<VerifiedAuthor commentCid={thread.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>)}
|
||||
>
|
||||
{thread.author.shortAddress}
|
||||
<VerifiedAuthor commentCid={thread.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>
|
||||
</span>)
|
||||
|
||||
<span key={`dt-${index}`} className="date-time" data-utc="data">{getDate(thread.timestamp)}</span>
|
||||
@@ -1497,8 +1498,8 @@ const Board = () => {
|
||||
>
|
||||
<ul className="post-menu-catalog">
|
||||
<li onClick={() => handleOptionClick(thread.cid)}>Hide thread</li>
|
||||
{thread.author.address === account?.author.address ||
|
||||
thread.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
<>
|
||||
<li onClick={() => handleAuthorEditClick(thread)}>Edit post</li>
|
||||
<li onClick={() => handleAuthorDeleteClick(thread)}>Delete post</li>
|
||||
@@ -1506,8 +1507,8 @@ const Board = () => {
|
||||
) : null}
|
||||
{isModerator ? (
|
||||
<>
|
||||
{thread.author.address === account?.author.address ||
|
||||
thread.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
null
|
||||
) : (
|
||||
<li onClick={() => {
|
||||
@@ -1700,7 +1701,7 @@ const Board = () => {
|
||||
|
||||
<span key={`pa-${index}`} className="poster-address address-desktop"
|
||||
id="reply-button" style={{cursor: "pointer"}}
|
||||
onClick={() => handleAddressClick(reply.author.shortAddress)}
|
||||
onClick={() => handleAddressClick(<VerifiedAuthor commentCid={reply.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>)}
|
||||
>
|
||||
(u/
|
||||
{reply.author?.shortAddress ?
|
||||
@@ -1780,8 +1781,8 @@ const Board = () => {
|
||||
>
|
||||
<ul className="post-menu-catalog">
|
||||
<li onClick={() => handleOptionClick(reply.cid)}>Hide post</li>
|
||||
{reply.author.address === account?.author.address ||
|
||||
reply.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
<>
|
||||
<li onClick={() => handleAuthorEditClick(reply)}>Edit post</li>
|
||||
<li onClick={() => handleAuthorDeleteClick(reply)}>Delete post</li>
|
||||
@@ -1789,8 +1790,8 @@ const Board = () => {
|
||||
) : null}
|
||||
{isModerator ? (
|
||||
<>
|
||||
{reply.author.address === account?.author.address ||
|
||||
reply.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
null
|
||||
) : (
|
||||
<li onClick={() => {
|
||||
@@ -2203,11 +2204,11 @@ const Board = () => {
|
||||
|
||||
<span key={`mob-pa-${index}`} className="poster-address-mobile address-mobile"
|
||||
id="reply-button" style={{cursor: "pointer"}}
|
||||
onClick={() => handleAddressClick(thread.author.shortAddress)}
|
||||
onClick={() => handleAddressClick(<VerifiedAuthor commentCid={thread.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>)}
|
||||
>
|
||||
(u/
|
||||
<span key={`mob-ha-${index}`} className="highlight-address-mobile">
|
||||
{thread.author.shortAddress}
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>}
|
||||
</span>
|
||||
)
|
||||
</span>
|
||||
@@ -2442,7 +2443,7 @@ const Board = () => {
|
||||
|
||||
<span key={`mob-pa-${index}`} className="poster-address-mobile address-mobile"
|
||||
id="reply-button" style={{cursor: "pointer"}}
|
||||
onClick={() => handleAddressClick(reply.author.shortAddress)}
|
||||
onClick={() => handleAddressClick(<VerifiedAuthor commentCid={reply.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>)}
|
||||
>
|
||||
(u/
|
||||
{reply.author?.shortAddress ?
|
||||
|
||||
@@ -13,6 +13,7 @@ import { TopBar, Footer, AuthorDeleteAlert } from '../styled/views/Thread.styled
|
||||
import CatalogLoader from '../CatalogLoader';
|
||||
import EditModal from '../modals/EditModal';
|
||||
import ImageBanner from '../ImageBanner';
|
||||
import VerifiedAuthor from '../VerifiedAuthor';
|
||||
import ModerationModal from '../modals/ModerationModal';
|
||||
import OfflineIndicator from '../OfflineIndicator';
|
||||
import SettingsModal from '../modals/SettingsModal';
|
||||
@@ -1007,8 +1008,8 @@ const Catalog = () => {
|
||||
>
|
||||
<ul className="post-menu-catalog">
|
||||
<li onClick={() => handleOptionClick(thread.cid)}>Hide thread</li>
|
||||
{thread.author.address === account?.author.address ||
|
||||
thread.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
<>
|
||||
<li onClick={() => handleAuthorEditClick(thread)}>Edit post</li>
|
||||
<li onClick={() => handleAuthorDeleteClick(thread)}>Delete post</li>
|
||||
@@ -1016,8 +1017,8 @@ const Catalog = () => {
|
||||
) : null}
|
||||
{isModerator ? (
|
||||
<>
|
||||
{thread.author.address === account?.author.address ||
|
||||
thread.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
null
|
||||
) : (
|
||||
<li onClick={() => {
|
||||
|
||||
@@ -22,6 +22,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';
|
||||
@@ -782,9 +783,9 @@ const Subscriptions = () => {
|
||||
(u/
|
||||
<span key={`pa-${index}`} className="poster-address address-desktop"
|
||||
id="reply-button" style={{cursor: "pointer"}}
|
||||
onClick={() => handleAddressClick(thread.author.shortAddress)}
|
||||
onClick={() => handleAddressClick(<VerifiedAuthor commentCid={thread.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>)}
|
||||
>
|
||||
{thread.author.shortAddress}
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>}
|
||||
</span>)
|
||||
|
||||
<span key={`dt-${index}`} className="date-time" data-utc="data">{getDate(thread.timestamp)}</span>
|
||||
@@ -859,8 +860,8 @@ const Subscriptions = () => {
|
||||
>
|
||||
<ul className="post-menu-catalog">
|
||||
<li onClick={() => handleOptionClick(thread.cid)}>Hide thread</li>
|
||||
{thread.author.address === account?.author.address ||
|
||||
thread.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
<>
|
||||
<li onClick={() => {handleAuthorEditClick(thread); setSelectedAddress(thread.subplebbitAddress);}}>Edit post</li>
|
||||
<li onClick={() => {handleAuthorDeleteClick(thread); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
|
||||
@@ -868,8 +869,8 @@ const Subscriptions = () => {
|
||||
) : null}
|
||||
{isModerator ? (
|
||||
<>
|
||||
{thread.author.address === account?.author.address ||
|
||||
thread.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
null
|
||||
) : (
|
||||
<li onClick={() => {
|
||||
@@ -1054,7 +1055,7 @@ const Subscriptions = () => {
|
||||
|
||||
<span key={`pa-${index}`} className="poster-address address-desktop"
|
||||
id="reply-button" style={{cursor: "pointer"}}
|
||||
onClick={() => handleAddressClick(reply.author.shortAddress)}
|
||||
onClick={() => handleAddressClick(<VerifiedAuthor commentCid={reply.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>)}
|
||||
>
|
||||
(u/
|
||||
{reply.author?.shortAddress ?
|
||||
@@ -1149,8 +1150,8 @@ const Subscriptions = () => {
|
||||
>
|
||||
<ul className="post-menu-catalog">
|
||||
<li onClick={() => handleOptionClick(reply.cid)}>Hide post</li>
|
||||
{reply.author.address === account?.author.address ||
|
||||
reply.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
<>
|
||||
<li onClick={() => {handleAuthorEditClick(reply); setSelectedAddress(thread.subplebbitAddress);}}>Edit post</li>
|
||||
<li onClick={() => {handleAuthorDeleteClick(reply); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
|
||||
@@ -1158,8 +1159,8 @@ const Subscriptions = () => {
|
||||
) : null}
|
||||
{isModerator ? (
|
||||
<>
|
||||
{reply.author.address === account?.author.address ||
|
||||
reply.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
null
|
||||
) : (
|
||||
<li onClick={() => {
|
||||
@@ -1574,11 +1575,11 @@ const Subscriptions = () => {
|
||||
|
||||
<span key={`mob-pa-${index}`} className="poster-address-mobile address-mobile"
|
||||
id="reply-button" style={{cursor: "pointer"}}
|
||||
onClick={() => handleAddressClick(thread.author.shortAddress)}
|
||||
onClick={() => handleAddressClick(<VerifiedAuthor commentCid={thread.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>)}
|
||||
>
|
||||
(u/
|
||||
<span key={`mob-ha-${index}`} className="highlight-address-mobile">
|
||||
{thread.author.shortAddress}
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>}
|
||||
</span>
|
||||
)
|
||||
</span>
|
||||
@@ -1814,7 +1815,7 @@ const Subscriptions = () => {
|
||||
|
||||
<span key={`mob-pa-${index}`} className="poster-address-mobile address-mobile"
|
||||
id="reply-button" style={{cursor: "pointer"}}
|
||||
onClick={() => handleAddressClick(reply.author.shortAddress)}
|
||||
onClick={() => handleAddressClick(<VerifiedAuthor commentCid={reply.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>)}
|
||||
>
|
||||
(u/
|
||||
{reply.author?.shortAddress ?
|
||||
|
||||
@@ -14,6 +14,7 @@ import { TopBar, Footer, AuthorDeleteAlert } from '../styled/views/Thread.styled
|
||||
import CatalogLoader from '../CatalogLoader';
|
||||
import EditModal from '../modals/EditModal';
|
||||
import ImageBanner from '../ImageBanner';
|
||||
import VerifiedAuthor from '../VerifiedAuthor';
|
||||
import ModerationModal from '../modals/ModerationModal';
|
||||
import OfflineIndicator from '../OfflineIndicator';
|
||||
import SettingsModal from '../modals/SettingsModal';
|
||||
@@ -563,8 +564,8 @@ const SubscriptionsCatalog = () => {
|
||||
>
|
||||
<ul className="post-menu-catalog">
|
||||
<li onClick={() => handleOptionClick(thread.cid)}>Hide thread</li>
|
||||
{thread.author.address === account?.author.address ||
|
||||
thread.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
<>
|
||||
<li onClick={() => handleAuthorEditClick(thread)}>Edit post</li>
|
||||
<li onClick={() => handleAuthorDeleteClick(thread)}>Delete post</li>
|
||||
@@ -572,8 +573,8 @@ const SubscriptionsCatalog = () => {
|
||||
) : null}
|
||||
{isModerator ? (
|
||||
<>
|
||||
{thread.author.address === account?.author.address ||
|
||||
thread.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={thread.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
null
|
||||
) : (
|
||||
<li onClick={() => {
|
||||
|
||||
@@ -20,6 +20,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';
|
||||
@@ -952,10 +953,10 @@ const Thread = () => {
|
||||
|
||||
<span className="poster-address address-desktop"
|
||||
id="reply-button" style={{cursor: "pointer"}}
|
||||
onClick={() => handleAddressClick(comment?.author?.shortAddress)}>
|
||||
onClick={() => handleAddressClick(<VerifiedAuthor commentCid={comment.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>)}>
|
||||
(u/
|
||||
<span key={`pa-${comment.cid}`} className="poster-address">
|
||||
{comment?.author?.shortAddress}
|
||||
{<VerifiedAuthor commentCid={comment.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>}
|
||||
</span>)
|
||||
</span>
|
||||
|
||||
@@ -1023,8 +1024,8 @@ const Thread = () => {
|
||||
>
|
||||
<ul className="post-menu-catalog">
|
||||
<li onClick={() => handleOptionClick(comment.cid)}>Hide thread</li>
|
||||
{comment.author?.address === account?.author.address ||
|
||||
comment.author?.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={comment.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={comment.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
<>
|
||||
<li onClick={() => handleAuthorEditClick(comment)}>Edit post</li>
|
||||
<li onClick={() => handleAuthorDeleteClick(comment)}>Delete post</li>
|
||||
@@ -1032,8 +1033,8 @@ const Thread = () => {
|
||||
) : null}
|
||||
{isModerator ? (
|
||||
<>
|
||||
{comment.author?.address === account?.author.address ||
|
||||
comment.author?.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={comment.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={comment.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
null
|
||||
) : (
|
||||
<li onClick={() => {
|
||||
@@ -1271,8 +1272,8 @@ const Thread = () => {
|
||||
>
|
||||
<ul className="post-menu-catalog">
|
||||
<li onClick={() => handleOptionClick(reply.cid)}>Hide post</li>
|
||||
{reply.author.address === account?.author.address ||
|
||||
reply.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
<>
|
||||
<li onClick={() => handleAuthorEditClick(reply)}>Edit post</li>
|
||||
<li onClick={() => handleAuthorDeleteClick(reply)}>Delete post</li>
|
||||
@@ -1280,8 +1281,8 @@ const Thread = () => {
|
||||
) : null}
|
||||
{isModerator ? (
|
||||
<>
|
||||
{reply.author.address === account?.author.address ||
|
||||
reply.author.address === account?.signer.address ? (
|
||||
{<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.author.address ||
|
||||
<VerifiedAuthor commentCid={reply.cid}>{({ authorAddress }) => (authorAddress)}</VerifiedAuthor> === account?.signer.address ? (
|
||||
null
|
||||
) : (
|
||||
<li onClick={() => {
|
||||
@@ -1578,11 +1579,11 @@ const Thread = () => {
|
||||
|
||||
<span key={`mob-pa-${comment.cid}`} className="poster-address-mobile address-mobile"
|
||||
id="reply-button" style={{cursor: "pointer"}}
|
||||
onClick={() => handleAddressClick(comment?.author?.shortAddress)}
|
||||
onClick={() => handleAddressClick(<VerifiedAuthor commentCid={comment.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>)}
|
||||
>
|
||||
(u/
|
||||
<span key={`mob-ha-${comment.cid}`} className="highlight-address-mobile">
|
||||
{comment?.author?.shortAddress}
|
||||
{<VerifiedAuthor commentCid={comment.cid}>{({ shortAuthorAddress }) => (shortAuthorAddress)}</VerifiedAuthor>}
|
||||
</span>
|
||||
)
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user