- R:
0 / L:
0
-
-
+ handleMouseOnLeaveThread()}
style={{
- imageRendering: "pixelated",}} />
-
-
- {
- 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");
- handleShareClick(selectedAddress, "rules");
- }}>Share thread
- {/* {isModerator ? (
- <>
- change rules
- >
- ) : null} */}
-
+ visibility: isCalculationDone ? 'visible' : 'hidden',
+ left:
+ isCalculationDone && spaceOnRight > 250 ? textRect.right + 5 :
+ isCalculationDone && spaceOnRight < 250 ? textRect.left - popupRect.width - 5
+ : 'auto',
+ top: popupPosition.top + 5,
+ }}>
+
+ Rules
+ by
+
## Board Admins
+
+ {thread.timestamp ? getFormattedTime(thread.timestamp) : null}
+
- , document.body
- )}
-
-
{
- setIsHoveringForMenu('rules');
- if (!hoverTimeoutId) {
- const timeoutId = setTimeout(() => {
- setIsHoveringOnThread("rules");
- }, 250);
- setHoverTimeoutId(timeoutId);
- }
+ , document.body
+ )
+ : null }
+
{
+ threadRefs.current['rules'] = el;
}}
- onMouseLeave={() => setIsHoveringForMenu(false)}>
-
-
Rules
- {": " + subplebbit.rules?.map((rule, index) => `${index + 1}. ${rule}`).join(' ')}
+ onMouseLeave={()=>{handleMouseOnLeaveThread()}}>
+
{
+ setIsHoveringForMenu('rules');
+ handleMouseOnLeaveThread();
+ }}
+ onMouseLeave={() => setIsHoveringForMenu(false)}>
+
+ 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");
+ handleShareClick(selectedAddress, "rules");
+ }}>Share thread
+ {/* {isModerator ? (
+ <>
+ change rules
+ >
+ ) : null} */}
+
+
+ , document.body
+ )}
+
+
+
+
+ {
+ setIsHoveringOnThread('rules');
+ setIsHoveringForMenu('rules');
+ const rect = threadRefs.current['rules'].getBoundingClientRect();
+ setPopupPosition({top: rect.top + window.scrollY, left: rect.left});
+ }}
+ onMouseLeave={() => setIsHoveringForMenu(false)}>
+ Rules
+ {": " + subplebbit.rules?.map((rule, index) => `${index + 1}. ${rule}`).join(' ')}
+
+
+
+
+
+ >
)
} else if (post.type === 'description') {
return (
<>
+ {isHoveringOnThread === 'description' ?
+ createPortal(
+
+ handleMouseOnLeaveThread()}
+ style={{
+ visibility: isCalculationDone ? 'visible' : 'hidden',
+ left:
+ isCalculationDone && spaceOnRight > 250
+ ? subplebbit.suggestedAvatarUrl ? imageRect.right + 5 : textRect.right + 5 :
+ isCalculationDone && spaceOnRight < 250
+ ? subplebbit.suggestedAvatarUrl ? imageRect.left - popupRect.width - 5 : textRect.left - popupRect.width - 5
+ : 'auto',
+ top: popupPosition.top + 5,
+ }}>
+
+ Welcome to {subplebbit.title || subplebbit.address}
+ by
+ ## Board Admins
+
+ {thread.timestamp ? getFormattedTime(thread.timestamp) : null}
+
+
+ , document.body
+ )
+ : null }
{
+ threadRefs.current['description'] = el;
+ }}
onMouseLeave={()=>{handleMouseOnLeaveThread()}}>
- {isHoveringOnThread === 'description' ?
-
setIsHoveringOnThread("")}
- className={"thread_popup"}>
-
- Welcome to {subplebbit.title || subplebbit.address}
- by
- ## Board Admins
- {getFormattedTime(subplebbit.createdAt)}
-
: null }
{subplebbit.suggested?.avatarUrl ? (
![]()
{
+ setIsHoveringOnThread('description');
setIsHoveringForMenu('description');
- if (!hoverTimeoutId) {
- const timeoutId = setTimeout(() => {
- setIsHoveringOnThread("description");
- }, 250);
- setHoverTimeoutId(timeoutId);
- }
+ const rect = threadRefs.current['description'].getBoundingClientRect();
+ setPopupPosition({top: rect.top + window.scrollY, left: rect.left});
}}
onMouseLeave={() => setIsHoveringForMenu(false)}
src={subplebbit.suggested.avatarUrl} alt="board avatar" />
@@ -578,21 +617,23 @@ const CatalogPost = ({post}) => {
)}
setSelectedThread("description")} onMouseOver={() => {
- setIsHoveringForMenu('description');
- if (!hoverTimeoutId) {
- const timeoutId = setTimeout(() => {
- setIsHoveringOnThread("description");
- }, 250);
- setHoverTimeoutId(timeoutId);
- }
- }}
- onMouseLeave={() => setIsHoveringForMenu(false)}>
-
-
Welcome to {subplebbit.title || subplebbit.address}!
- {": " + subplebbit.description}
+ onClick={() => setSelectedThread("description")}>
+
+
+ {
+ setIsHoveringOnThread('description');
+ setIsHoveringForMenu('description');
+ const rect = threadRefs.current['description'].getBoundingClientRect();
+ setPopupPosition({top: rect.top + window.scrollY, left: rect.left});
+ }}
+ onMouseLeave={() => setIsHoveringForMenu(false)}>
+ Welcome to {subplebbit.title || subplebbit.address}!
+ {": " + subplebbit.description}
+
-
+
+
>
)