add PostOnHover to OP links

This commit is contained in:
plebeius.eth
2023-06-11 12:17:22 +02:00
parent 9659fb4480
commit b03a542cec
3 changed files with 78 additions and 98 deletions
+8 -4
View File
@@ -78,12 +78,8 @@ const PostOnHover = ({ cid, feed }) => {
 
<span className="post-number post-number-desktop">
<span >c/</span>
{reply.shortCid ? (
<Link to={() => {}} id="reply-button"
title="Reply to this post">{reply.shortCid}</Link>
) : (
<span key="pending" style={{color: 'red', fontWeight: '700'}}>Pending</span>
)}
</span>&nbsp;
<div id="backlink-id" className="backlink">
{reply.replies?.pages?.topAll.comments
@@ -155,9 +151,11 @@ const PostOnHover = ({ cid, feed }) => {
reply.content?.length > 500 ?
<Fragment >
<blockquote comment={reply} className="post-message">
{shortParentCid ? (
<Link to={() => {}} className="quotelink">
{`c/${shortParentCid}`}{shortParentCid === thread.shortCid ? " (OP)" : null}
</Link>
) : null}
<Post content={reply.content?.slice(0, 500)} />
<span className="ttl"> (...)
<br /> <EditLabel
@@ -167,9 +165,11 @@ const PostOnHover = ({ cid, feed }) => {
</blockquote>
</Fragment>
: <blockquote className="post-message">
{shortParentCid ? (
<Link to={() => {}} className="quotelink">
{`c/${shortParentCid}`}{shortParentCid === thread.shortCid ? " (OP)" : null}
</Link>
) : null}
<Post content={reply.content} comment={reply} />
<EditLabel
commentCid={reply.cid}
@@ -277,9 +277,11 @@ const PostOnHover = ({ cid, feed }) => {
reply.content?.length > 500 ?
<Fragment>
<blockquote className="post-message">
{shortParentCid ? (
<Link to={() => {}} className="quotelink">
{`c/${shortParentCid}`}{shortParentCid === thread.shortCid ? " (OP)" : null}
</Link>
) : null}
<Post content={reply.content?.slice(0, 500)} comment={reply} />
<span className="ttl"> (...)
<br />
@@ -291,9 +293,11 @@ const PostOnHover = ({ cid, feed }) => {
</blockquote>
</Fragment>
: <blockquote className="post-message">
{shortParentCid ? (
<Link to={() => {}} className="quotelink" >
{`c/${shortParentCid}`}{shortParentCid === thread.shortCid ? " (OP)" : null}
</Link>
) : null}
<Post content={reply.content} comment={reply} />
<EditLabel
commentCid={reply.cid}
-16
View File
@@ -1339,9 +1339,6 @@ const Board = () => {
onMouseOver={(event) => {
event.stopPropagation();
handleQuoteHover(reply, shortParentCid, () => {
if (shortParentCid === thread.shortCid) {
return;
} else {
setOutOfViewCid(reply.parentCid);
const rect = quoteRefs.current[shortParentCid].getBoundingClientRect();
const distanceToRight = window.innerWidth - rect.right;
@@ -1360,7 +1357,6 @@ const Board = () => {
maxWidth: window.innerWidth - rect.left - rect.width + 5
});
}
}
});
}}
onMouseLeave={() => {
@@ -1393,9 +1389,6 @@ const Board = () => {
onMouseOver={(event) => {
event.stopPropagation();
handleQuoteHover(reply, shortParentCid, () => {
if (shortParentCid === thread.shortCid) {
return;
} else {
setOutOfViewCid(reply.parentCid);
const rect = quoteRefs.current[shortParentCid].getBoundingClientRect();
const distanceToRight = window.innerWidth - rect.right;
@@ -1414,7 +1407,6 @@ const Board = () => {
maxWidth: window.innerWidth - rect.left - rect.width + 5
});
}
}
});
}}
onMouseLeave={() => {
@@ -1725,9 +1717,6 @@ const Board = () => {
onMouseOver={(event) => {
event.stopPropagation();
handleQuoteHover(reply, shortParentCid, () => {
if (shortParentCid === thread.shortCid) {
return;
} else {
setOutOfViewCid(reply.parentCid);
const rect = quoteRefsMobile.current[shortParentCid].getBoundingClientRect();
const distanceToRight = window.innerWidth - rect.right;
@@ -1746,7 +1735,6 @@ const Board = () => {
maxWidth: window.innerWidth - rect.left - rect.width + 5
});
}
}
});
}}
onMouseLeave={() => {
@@ -1779,9 +1767,6 @@ const Board = () => {
onMouseOver={(event) => {
event.stopPropagation();
handleQuoteHover(reply, shortParentCid, () => {
if (shortParentCid === thread.shortCid) {
return;
} else {
setOutOfViewCid(reply.parentCid);
const rect = quoteRefsMobile.current[shortParentCid].getBoundingClientRect();
const distanceToRight = window.innerWidth - rect.right;
@@ -1800,7 +1785,6 @@ const Board = () => {
maxWidth: window.innerWidth - rect.left - rect.width + 5
});
}
}
});
}}
onMouseLeave={() => {
-8
View File
@@ -1252,9 +1252,6 @@ const Thread = () => {
onMouseOver={(event) => {
event.stopPropagation();
handleQuoteHover(reply, shortParentCid, () => {
if (shortParentCid === comment.shortCid) {
return;
} else {
setOutOfViewCid(reply.parentCid);
const rect = quoteRefs.current[shortParentCid].getBoundingClientRect();
const distanceToRight = window.innerWidth - rect.right;
@@ -1272,7 +1269,6 @@ const Thread = () => {
maxWidth: window.innerWidth - rect.left - rect.width + 5
});
}
}
});
}}
onMouseLeave={() => {
@@ -1528,9 +1524,6 @@ const Thread = () => {
onMouseOver={(event) => {
event.stopPropagation();
handleQuoteHover(reply, shortParentCid, () => {
if (shortParentCid === comment.shortCid) {
return;
} else {
setOutOfViewCid(reply.parentCid);
const rect = quoteRefsMobile.current[shortParentCid].getBoundingClientRect();
const distanceToRight = window.innerWidth - rect.right;
@@ -1549,7 +1542,6 @@ const Thread = () => {
maxWidth: window.innerWidth - rect.left - rect.width + 5
});
}
}
});
}}
onMouseLeave={() => {