@@ -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');
});