fixed highlight bug in Thread.jsx

This commit is contained in:
plebbitor
2023-04-18 11:24:47 +02:00
parent f1a2d543ee
commit 05763d7ede
3 changed files with 734 additions and 735 deletions
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -692,7 +692,7 @@ const Board = () => {
</span>)
: null}
</span>
<span key={`mob-dt-${thread.cid}`} className="date-time-mobile">
<span key={`mob-dt-${thread.cid}`} className="date-time-mobile post-number">
{getDate(thread.timestamp)}
&nbsp;
<Link to="" key={`mob-no-${thread.cid}`} onClick={() => {}} title="Link to this post">c/</Link>
@@ -798,7 +798,7 @@ const Board = () => {
</span>
<br key={`mob-br-${reply.cid}`} />
</span>
<span key={`mob-dt-${reply.cid}`} className="date-time-mobile">
<span key={`mob-dt-${reply.cid}`} className="date-time-mobile post-number">
{getDate(reply.timestamp)}&nbsp;
<Link to="" key={`mob-pl1-${reply.cid}`} onClick={() => {}} title="Link to this post">c/</Link>
<button id="reply-button" style={{ all: 'unset', cursor: 'pointer' }} key={`mob-pl2-${reply.cid}`} onClick={() => {
@@ -843,7 +843,7 @@ const Board = () => {
reply.content.length > 500 ?
<Fragment key={`fragment15-${reply.cid}`}>
<blockquote key={`mob-pm-${reply.cid}`} className="post-message">
<Link to="" key={`mob-r-pm-${reply.cid}`} className="quotelink" onClick={() => {}}>
<Link to="" key={`mob-r-pm-${reply.cid}`} className="quotelink" onClick={(event) => handleQuoteClick(reply, shortParentCid, event)}>
{`c/${shortParentCid}`}{shortParentCid === thread.shortCid ? " (OP)" : null}
</Link>
<Post content={reply.content.slice(0, 500)} key={`post-mobile-${reply.cid}`} handlequoteclick={handleQuoteClick} comment={reply} />
@@ -855,7 +855,7 @@ const Board = () => {
</blockquote>
</Fragment>
: <blockquote key={`mob-pm-${reply.cid}`} className="post-message">
<Link to="" key={`mob-r-pm-${reply.cid}`} className="quotelink" onClick={() => {}}>
<Link to="" key={`mob-r-pm-${reply.cid}`} className="quotelink" onClick={(event) => handleQuoteClick(reply, shortParentCid, event)}>
{`c/${shortParentCid}`}{shortParentCid === thread.shortCid ? " (OP)" : null}
</Link>
<Post content={reply.content} key={`post-mobile-${reply.cid}`} handlequoteclick={handleQuoteClick} comment={reply} />
@@ -868,7 +868,7 @@ const Board = () => {
.map((reply) => (
<div key={`div-back${reply.cid}`} style={{display: 'inline-block'}}>
<Link key={`ql-${reply.cid}`}
to={() => {}} className="quote-link"
to={(event) => handleQuoteClick(reply, reply.shortCid, event)} className="quote-link"
onClick={(event) => handleQuoteClick(reply, event)}>
c/{reply.shortCid}</Link>
&nbsp;
+2 -2
View File
@@ -512,7 +512,7 @@ const Thread = () => {
const fallbackImgUrl = "/assets/filedeleted-res.gif";
const shortParentCid = findShortParentCid(reply.parentCid, comment);
return (
<div key={`pc-${reply.cid}-${Math.random()}`} className="reply-container">
<div key={`pc-${reply.cid}`} className="reply-container">
<div key={`sa-${reply.cid}`} className="side-arrows">{'>>'}</div>
<div key={`pr-${reply.cid}`} className="post-reply">
<div key={`pi-${reply.cid}`} className="post-info">
@@ -723,7 +723,7 @@ const Thread = () => {
renderedComments.map((reply) => {
const shortParentCid = findShortParentCid(reply.parentCid, comment);
return (
<div key={`mob-rc-${reply.cid}-${Math.random()}`} className="reply-container">
<div key={`mob-rc-${reply.cid}`} className="reply-container">
<div key={`mob-pr-${reply.cid}`} className="post-reply">
<div key={`mob-pi-${reply.cid}`} className="post-info-mobile">
<button className="post-menu-button-mobile" title="Post menu" style={{ all: 'unset', cursor: 'pointer' }}>...</button>