setIsHoveringOnThread('rules')}
onMouseLeave={() => setIsHoveringOnThread('')}>
R:
0 / L:
0
{
threadMenuRefs.current["rules"] = el;
postMenuRef.current = el;
}}
className='post-menu-button'
id='post-menu-button-catalog'
rotated={openMenuCid === "rules"}
onClick={(event) => {
event.stopPropagation();
const rect = threadMenuRefs.current["rules"].getBoundingClientRect();
setMenuPosition({top: rect.top + window.scrollY, left: rect.left});
setOpenMenuCid(prevCid => (prevCid === "rules" ? null : "rules"));
}}
>
▶
{createPortal(
{postMenuCatalogRef.current = el}}
onClick={(event) => event.stopPropagation()}
style={{position: "absolute",
top: menuPosition.top + 7,
left: menuPosition.left}}>
handleOptionClick("rules")}>Hide thread
{/* {isModerator ? (
<>
change rules
>
) : null} */}
, document.body
)}
Rules
{": " + subplebbit.rules.map((rule, index) => `${index + 1}. ${rule}`).join(' ')}
)
} else if (item?.type === 'description') {
return (
<>
setIsHoveringOnThread('description')}
onMouseLeave={() => setIsHoveringOnThread('')}>
{subplebbit.suggested?.avatarUrl ? (
) : null}
{subplebbit.suggested?.avatarUrl ? (
) : null}
R:
0 / L:
0
{subplebbit.suggested?.avatarUrl ? null : (
)}
{
threadMenuRefs.current["description"] = el;
postMenuRef.current = el;
}}
className='post-menu-button'
id='post-menu-button-catalog'
rotated={openMenuCid === "description"}
onClick={(event) => {
event.stopPropagation();
const rect = threadMenuRefs.current["description"].getBoundingClientRect();
setMenuPosition({top: rect.top + window.scrollY, left: rect.left});
setOpenMenuCid(prevCid => (prevCid === "description" ? null : "description"));
}}
>
▶
{createPortal(
{postMenuCatalogRef.current = el}}
onClick={(event) => event.stopPropagation()}
style={{position: "absolute",
top: menuPosition.top + 7,
left: menuPosition.left}}>
handleOptionClick("description")}>Hide thread
{/* {isModerator ? (
<>
change description
>
) : null} */}
{subplebbit.suggested?.avatarUrl ? (
{setIsImageSearchOpen(true)}}
onMouseLeave={() => {setIsImageSearchOpen(false)}}>
Image search »
handleOptionClick("description")}>
Google
handleOptionClick("description")}>
Yandex
handleOptionClick("description")}>
SauceNAO
) : null}
, document.body
)}
setSelectedThread("description")}>
Welcome to {subplebbit.title || subplebbit.address}
{": " + subplebbit.description}
>
)
} else {
return (
{setIsHoveringOnThread(thread.cid)}}
onMouseLeave={() => {setIsHoveringOnThread('')}}>
{commentMediaInfo?.url ? (
setSelectedThread(thread.cid)}>
{commentMediaInfo?.type === "webpage" ? (
thread.thumbnailUrl ? (
{
e.target.src = fallbackImgUrl
e.target.onerror = null;
}} />
) : null
) : null}
{commentMediaInfo?.type === "image" ? (
{
e.target.src = fallbackImgUrl
e.target.onerror = null;}} />
) : null}
{commentMediaInfo?.type === "video" ? (
e.target.src = fallbackImgUrl} />
) : null}
{commentMediaInfo?.type === "audio" ? (
e.target.src = fallbackImgUrl} />
) : null}
) : null}
{(commentMediaInfo && (
commentMediaInfo.type === 'image' ||
commentMediaInfo.type === 'video' ||
(commentMediaInfo.type === 'webpage' &&
commentMediaInfo.thumbnail))) ? (
{thread.pinned ? (
) : null}
{thread.locked ? (
) : null}
) : null}
R:
{thread.replyCount}
{linkCount > 0 ? (
<>
/
L:
{linkCount}
>
) : null}
{(commentMediaInfo && (
commentMediaInfo.type === 'image' ||
commentMediaInfo.type === 'video' ||
(commentMediaInfo.type === 'webpage' &&
commentMediaInfo.thumbnail))) ? null : (
{thread.pinned ? (
) : null}
{thread.locked ? (
) : null}
)}
{
threadMenuRefs.current[thread.cid] = el;
postMenuRef.current = el;
}}
className='post-menu-button'
id='post-menu-button-catalog'
rotated={openMenuCid === thread.cid}
onClick={(event) => {
event.stopPropagation();
const rect = threadMenuRefs.current[thread.cid].getBoundingClientRect();
setMenuPosition({top: rect.top + window.scrollY, left: rect.left});
setOpenMenuCid(prevCid => (prevCid === thread.cid ? null : thread.cid));
}}
>
▶
{createPortal(
{postMenuCatalogRef.current = el}}
onClick={(event) => event.stopPropagation()}
style={{position: "absolute",
top: menuPosition.top + 7,
left: menuPosition.left}}>
handleOptionClick(thread.cid)}>Hide thread
{({ authorAddress }) => (
<>
{authorAddress === account?.author.address ||
authorAddress === account?.signer.address ? (
<>
handleAuthorEditClick(thread)}>Edit post
handleAuthorDeleteClick(thread)}>Delete post
>
) : null}
{isModerator ? (
<>
{authorAddress === account?.author.address ||
authorAddress === account?.signer.address ? (
null
) : (
{
setModeratingCommentCid(thread.cid)
setIsModerationOpen(true);
handleOptionClick(thread.cid);
setDeletePost(true);
}}>
Delete post
)}
{
setModeratingCommentCid(thread.cid)
setIsModerationOpen(true);
handleOptionClick(thread.cid);
}}>
Mod tools
>
) : null}
>
)}
{(commentMediaInfo && (
commentMediaInfo.type === 'image' ||
(commentMediaInfo.type === 'webpage' &&
commentMediaInfo.thumbnail))) ? (
{setIsImageSearchOpen(true)}}
onMouseLeave={() => {setIsImageSearchOpen(false)}}>
Image search »
handleOptionClick(thread.cid)}>
Google
handleOptionClick(thread.cid)}>
Yandex
handleOptionClick(thread.cid)}>
SauceNAO
) : null
}
, document.body
)}
setSelectedThread(thread.cid)}>
{thread.title ? `${thread.title}` : null}
{thread.content ? `: ${thread.content}` : null}
)
}
}}
endReached={tryLoadMore}
useWindowScroll={true}
components={{List: GridContainer}}
/>
) : (