diff --git a/src/components/views/Board.jsx b/src/components/views/Board.jsx index f10093d3..aeb8aed4 100644 --- a/src/components/views/Board.jsx +++ b/src/components/views/Board.jsx @@ -457,8 +457,8 @@ const Board = () => {   {getDate(thread.timestamp)}   - - {}} title="Link to this post">c/ + + {}} key={`pl1-${thread.cid}`} onClick={() => {}} title="Link to this post">c/ @@ -770,7 +770,7 @@ const Board = () => { const shortParentCid = findShortParentCid(reply.parentCid, selectedFeed); return (
-
+
@@ -798,9 +798,9 @@ const Board = () => {
- + {getDate(reply.timestamp)}  - {}} title="Link to this post">c/ + {}} key={`mob-pl1-${reply.cid}`} onClick={() => {}} title="Link to this post">c/ @@ -843,10 +843,10 @@ const Board = () => { reply.content.length > 500 ?
- handleQuoteClick(reply, shortParentCid, thread.shortCid, event)}> + {}} key={`mob-r-pm-${reply.cid}`} className="quotelink" onClick={(event) => handleQuoteClick(reply, shortParentCid, thread.shortCid, event)}> {`c/${shortParentCid}`}{shortParentCid === thread.shortCid ? " (OP)" : null} - + (...)

Comment too long.  @@ -855,10 +855,10 @@ const Board = () => {
:
- handleQuoteClick(reply, shortParentCid, thread.shortCid, event)}> + {}} key={`mob-r-pm-${reply.cid}`} className="quotelink" onClick={(event) => handleQuoteClick(reply, shortParentCid, thread.shortCid, event)}> {`c/${shortParentCid}`}{shortParentCid === thread.shortCid ? " (OP)" : null} - +
) : null} {reply.replyCount > 0 ? ( @@ -867,9 +867,8 @@ const Board = () => { .sort((a, b) => a.timestamp - b.timestamp) .map((reply) => (
- handleQuoteClick(reply, reply.shortCid, event)} className="quote-link" - onClick={(event) => handleQuoteClick(reply, event)}> + {}} + onClick={(event) => handleQuoteClick(reply, reply.shortCid, event)} className="quote-link"> c/{reply.shortCid}  
diff --git a/src/components/views/Thread.jsx b/src/components/views/Thread.jsx index 87613092..b78751d1 100644 --- a/src/components/views/Thread.jsx +++ b/src/components/views/Thread.jsx @@ -477,8 +477,8 @@ const Thread = () => {   {getDate(comment?.timestamp)}   - - {}} title="Link to this post">c/ + + {}} onClick={() => {}} title="Link to this post">c/ @@ -500,7 +500,7 @@ const Thread = () => {
- +
@@ -514,7 +514,7 @@ const Thread = () => { return (
{'>>'}
-
+
  @@ -543,8 +543,8 @@ const Thread = () => {   {getDate(reply?.timestamp)}   - - {}} title="Link to this post">c/ + + {}} key={`pl1-${reply.cid}`} onClick={() => {}} title="Link to this post">c/
@@ -675,13 +675,13 @@ const Thread = () => { {comment.title} ) : null} - + {getDate(comment?.timestamp)}   - {}} title="Reply to this post">{comment.shortCid} + {}} key={`mob-no2-${comment.cid}`} onClick={() => {}} title="Reply to this post">{comment.shortCid}
{commentMediaInfo?.url ? ( @@ -718,7 +718,7 @@ const Thread = () => {
{comment.content ? ( <> - + ) : null}
@@ -730,7 +730,7 @@ const Thread = () => { const shortParentCid = findShortParentCid(reply.parentCid, comment); return (
-
+
@@ -758,9 +758,9 @@ const Thread = () => {
- + {getDate(reply?.timestamp)}  - {}} title="Link to this post">c/ + {}} key={`mob-pl1-${reply.cid}`} onClick={() => {}} title="Link to this post">c/ @@ -771,7 +771,7 @@ const Thread = () => { onClick={(event) => handleQuoteClick(reply, shortParentCid, comment.shortCid, event)}> {`c/${shortParentCid}`}{shortParentCid === comment.shortCid ? " (OP)" : null} - + {reply.replyCount > 0 ? (
@@ -781,7 +781,7 @@ const Thread = () => {
{}} className="quote-link" - onClick={(event) => handleQuoteClick(reply, shortParentCid, comment.shortCid, event)}> + onClick={(event) => handleQuoteClick(reply, reply.shortCid, event)}> c/{reply.shortCid}  
@@ -816,7 +816,7 @@ const Thread = () => { [ - {}} onMouseOver={(event) => event.target.style.cursor='pointer'}>Post a Reply + {}} onClick={() => {}} onMouseOver={(event) => event.target.style.cursor='pointer'}>Post a Reply ] {comment.replyCount > 0 ? ( diff --git a/src/utils/handleQuoteClick.js b/src/utils/handleQuoteClick.js index e8faf40e..c450a7c3 100644 --- a/src/utils/handleQuoteClick.js +++ b/src/utils/handleQuoteClick.js @@ -1,5 +1,6 @@ function handleQuoteClick(reply, parentCid, threadCid) { const cid = parentCid ? parentCid : reply.shortCid; + const isMobile = window.innerWidth <= 480; if (threadCid && cid === threadCid) { const highlightedElements = document.querySelectorAll('.highlighted'); @@ -7,19 +8,22 @@ function handleQuoteClick(reply, parentCid, threadCid) { highlightedElements.forEach(el => { el.classList.remove('highlighted'); }); - + return; } - const targetElement = [...document.querySelectorAll('.post-reply')] + const targetElementSelector = isMobile ? '.post-reply-mobile' : '.post-reply-desktop'; + const postNumberSelector = isMobile ? '.post-number-mobile' : '.post-number-desktop'; + + const targetElement = [...document.querySelectorAll(targetElementSelector)] .find(el => { - const postNumberElement = el.querySelector('.post-number'); + const postNumberElement = el.querySelector(postNumberSelector); return postNumberElement && postNumberElement.innerHTML.includes(cid); }); if (targetElement) { const highlightedElements = document.querySelectorAll('.highlighted'); - + highlightedElements.forEach(el => { el.classList.remove('highlighted'); });