diff --git a/src/components/PostOnHover.jsx b/src/components/PostOnHover.jsx index fb3ee59a..4bb35302 100644 --- a/src/components/PostOnHover.jsx +++ b/src/components/PostOnHover.jsx @@ -78,12 +78,8 @@ const PostOnHover = ({ cid, feed }) => { c/ - {reply.shortCid ? ( {}} id="reply-button" title="Reply to this post">{reply.shortCid} - ) : ( - Pending - )}
- {}} className="quotelink"> - {`c/${shortParentCid}`}{shortParentCid === thread.shortCid ? " (OP)" : null} - + {shortParentCid ? ( + {}} className="quotelink"> + {`c/${shortParentCid}`}{shortParentCid === thread.shortCid ? " (OP)" : null} + + ) : null}(...)
{
- {}} className="quotelink"> - {`c/${shortParentCid}`}{shortParentCid === thread.shortCid ? " (OP)" : null} - + {shortParentCid ? ( + {}} className="quotelink"> + {`c/${shortParentCid}`}{shortParentCid === thread.shortCid ? " (OP)" : null} + + ) : null}{ reply.content?.length > 500 ? : + {shortParentCid ? ( {}} className="quotelink"> {`c/${shortParentCid}`}{shortParentCid === thread.shortCid ? " (OP)" : null} + ) : null}(...)
@@ -291,9 +293,11 @@ const PostOnHover = ({ cid, feed }) => {+ {shortParentCid ? ( {}} className="quotelink" > {`c/${shortParentCid}`}{shortParentCid === thread.shortCid ? " (OP)" : null} + ) : null}{ 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,8 +1357,7 @@ const Board = () => { maxWidth: window.innerWidth - rect.left - rect.width + 5 }); } - } - }); + }); }} onMouseLeave={() => { removeHighlight(); @@ -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,27 +1717,23 @@ 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; - - if (distanceToRight < 200) { - setOutOfViewPosition({ - top: rect.top + window.scrollY - rect.height / 2, - right: window.innerWidth - rect.left - 10, - maxWidth: rect.left - 5 - }); + setOutOfViewCid(reply.parentCid); + const rect = quoteRefsMobile.current[shortParentCid].getBoundingClientRect(); + const distanceToRight = window.innerWidth - rect.right; + + if (distanceToRight < 200) { + setOutOfViewPosition({ + top: rect.top + window.scrollY - rect.height / 2, + right: window.innerWidth - rect.left - 10, + maxWidth: rect.left - 5 + }); - } else { - setOutOfViewPosition({ - top: rect.top + window.scrollY - rect.height / 2, - left: rect.left + rect.width + 5, - maxWidth: window.innerWidth - rect.left - rect.width + 5 - }); - } + } else { + setOutOfViewPosition({ + top: rect.top + window.scrollY - rect.height / 2, + left: rect.left + rect.width + 5, + maxWidth: window.innerWidth - rect.left - rect.width + 5 + }); } }); }} @@ -1779,27 +1767,23 @@ 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; - - if (distanceToRight < 200) { - setOutOfViewPosition({ - top: rect.top + window.scrollY - rect.height / 2, - right: window.innerWidth - rect.left - 10, - maxWidth: rect.left - 5 - }); + setOutOfViewCid(reply.parentCid); + const rect = quoteRefsMobile.current[shortParentCid].getBoundingClientRect(); + const distanceToRight = window.innerWidth - rect.right; + + if (distanceToRight < 200) { + setOutOfViewPosition({ + top: rect.top + window.scrollY - rect.height / 2, + right: window.innerWidth - rect.left - 10, + maxWidth: rect.left - 5 + }); - } else { - setOutOfViewPosition({ - top: rect.top + window.scrollY - rect.height / 2, - left: rect.left + rect.width + 5, - maxWidth: window.innerWidth - rect.left - rect.width + 5 - }); - } + } else { + setOutOfViewPosition({ + top: rect.top + window.scrollY - rect.height / 2, + left: rect.left + rect.width + 5, + maxWidth: window.innerWidth - rect.left - rect.width + 5 + }); } }); }} diff --git a/src/components/views/Thread.jsx b/src/components/views/Thread.jsx index de8af6d3..44672b98 100755 --- a/src/components/views/Thread.jsx +++ b/src/components/views/Thread.jsx @@ -1252,26 +1252,22 @@ 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; - if (distanceToRight < 200) { - setOutOfViewPosition({ - top: rect.top + window.scrollY - rect.height / 2, - right: window.innerWidth - rect.left - 10, - maxWidth: rect.left - 5 - }); + setOutOfViewCid(reply.parentCid); + const rect = quoteRefs.current[shortParentCid].getBoundingClientRect(); + const distanceToRight = window.innerWidth - rect.right; + if (distanceToRight < 200) { + setOutOfViewPosition({ + top: rect.top + window.scrollY - rect.height / 2, + right: window.innerWidth - rect.left - 10, + maxWidth: rect.left - 5 + }); - } else { - setOutOfViewPosition({ - top: rect.top + window.scrollY - rect.height / 2, - left: rect.left + rect.width + 5, - maxWidth: window.innerWidth - rect.left - rect.width + 5 - }); - } + } else { + setOutOfViewPosition({ + top: rect.top + window.scrollY - rect.height / 2, + left: rect.left + rect.width + 5, + maxWidth: window.innerWidth - rect.left - rect.width + 5 + }); } }); }} @@ -1528,27 +1524,23 @@ 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; - - if (distanceToRight < 200) { - setOutOfViewPosition({ - top: rect.top + window.scrollY - rect.height / 2, - right: window.innerWidth - rect.left - 10, - maxWidth: rect.left - 5 - }); + setOutOfViewCid(reply.parentCid); + const rect = quoteRefsMobile.current[shortParentCid].getBoundingClientRect(); + const distanceToRight = window.innerWidth - rect.right; + + if (distanceToRight < 200) { + setOutOfViewPosition({ + top: rect.top + window.scrollY - rect.height / 2, + right: window.innerWidth - rect.left - 10, + maxWidth: rect.left - 5 + }); - } else { - setOutOfViewPosition({ - top: rect.top + window.scrollY - rect.height / 2, - left: rect.left + rect.width + 5, - maxWidth: window.innerWidth - rect.left - rect.width + 5 - }); - } + } else { + setOutOfViewPosition({ + top: rect.top + window.scrollY - rect.height / 2, + left: rect.left + rect.width + 5, + maxWidth: window.innerWidth - rect.left - rect.width + 5 + }); } }); }}