mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
switched to shortCid
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
"@babel/core": "^7.21.3",
|
"@babel/core": "^7.21.3",
|
||||||
"@babel/plugin-syntax-flow": "^7.18.6",
|
"@babel/plugin-syntax-flow": "^7.18.6",
|
||||||
"@babel/plugin-transform-react-jsx": "^7.21.0",
|
"@babel/plugin-transform-react-jsx": "^7.21.0",
|
||||||
"@plebbit/plebbit-react-hooks": "https://github.com/plebbit/plebbit-react-hooks.git#e47cb245b8af0ae0fdf1ad3170d5097918d1349e",
|
"@plebbit/plebbit-react-hooks": "https://github.com/plebbit/plebbit-react-hooks.git#b42bcb6a4f74ab23bbb8dfa49e43e9cccef3ece6",
|
||||||
"@testing-library/dom": "^9.0.1",
|
"@testing-library/dom": "^9.0.1",
|
||||||
"@testing-library/jest-dom": "^5.14.1",
|
"@testing-library/jest-dom": "^5.14.1",
|
||||||
"@testing-library/react": "^14.0.0",
|
"@testing-library/react": "^14.0.0",
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ const Board = () => {
|
|||||||
// scroll to post when quote is clicked
|
// scroll to post when quote is clicked
|
||||||
function handleQuoteClick(reply, event) {
|
function handleQuoteClick(reply, event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const cid = reply.cid.slice(0, 8);
|
const cid = reply.shortCid;
|
||||||
const targetElement = [...document.querySelectorAll('.post-reply')]
|
const targetElement = [...document.querySelectorAll('.post-reply')]
|
||||||
.find(el => el.innerHTML.includes(cid));
|
.find(el => el.innerHTML.includes(cid));
|
||||||
if (targetElement) {
|
if (targetElement) {
|
||||||
@@ -467,7 +467,7 @@ const Board = () => {
|
|||||||
|
|
||||||
<span key={`pn-${thread.cid}`} className="post-number">
|
<span key={`pn-${thread.cid}`} className="post-number">
|
||||||
<Link to="" key={`pl1-${thread.cid}`} onClick={handleVoidClick} title="Link to this post">c/</Link>
|
<Link to="" key={`pl1-${thread.cid}`} onClick={handleVoidClick} title="Link to this post">c/</Link>
|
||||||
<button id="reply-button" style={{ all: 'unset', cursor: 'pointer' }} key={`pl2-${thread.cid}`} onClick={handleReplyOpen} title="Reply to this post">{thread.cid.slice(0, 8)}</button>
|
<button id="reply-button" style={{ all: 'unset', cursor: 'pointer' }} key={`pl2-${thread.cid}`} onClick={handleReplyOpen} title="Reply to this post">{thread.shortCid}</button>
|
||||||
|
|
||||||
<span key={`rl1-${thread.cid}`}>
|
<span key={`rl1-${thread.cid}`}>
|
||||||
[
|
[
|
||||||
@@ -484,7 +484,7 @@ const Board = () => {
|
|||||||
<Link key={`ql-${reply.cid}`}
|
<Link key={`ql-${reply.cid}`}
|
||||||
to={handleVoidClick} className="quote-link"
|
to={handleVoidClick} className="quote-link"
|
||||||
onClick={(event) => handleQuoteClick(reply, event)}>
|
onClick={(event) => handleQuoteClick(reply, event)}>
|
||||||
c/{reply.cid.slice(0, 8)}</Link>
|
c/{reply.shortCid}</Link>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
@@ -557,7 +557,7 @@ const Board = () => {
|
|||||||
|
|
||||||
<span key={`pn-${reply.cid}`} className="post-number">
|
<span key={`pn-${reply.cid}`} className="post-number">
|
||||||
<Link to="" key={`pl1-${reply.cid}`} onClick={handleVoidClick} title="Link to this post">c/</Link>
|
<Link to="" key={`pl1-${reply.cid}`} onClick={handleVoidClick} title="Link to this post">c/</Link>
|
||||||
<button id="reply-button" style={{ all: 'unset', cursor: 'pointer' }} key={`pl2-${reply.cid}`} onClick={handleReplyOpen} title="Reply to this post">{reply.cid.slice(0, 8)}</button>
|
<button id="reply-button" style={{ all: 'unset', cursor: 'pointer' }} key={`pl2-${reply.cid}`} onClick={handleReplyOpen} title="Reply to this post">{reply.shortCid}</button>
|
||||||
</span>
|
</span>
|
||||||
<button key={`pmb-${reply.cid}`} className="post-menu-button" onClick={handleVoidClick} title="Post menu" style={{ all: 'unset', cursor: 'pointer' }} data-cmd="post-menu">▶</button>
|
<button key={`pmb-${reply.cid}`} className="post-menu-button" onClick={handleVoidClick} title="Post menu" style={{ all: 'unset', cursor: 'pointer' }} data-cmd="post-menu">▶</button>
|
||||||
<div id="backlink-id" className="backlink">
|
<div id="backlink-id" className="backlink">
|
||||||
@@ -568,7 +568,7 @@ const Board = () => {
|
|||||||
<Link to={handleVoidClick} key={`ql-${reply.cid}`}
|
<Link to={handleVoidClick} key={`ql-${reply.cid}`}
|
||||||
className="quote-link"
|
className="quote-link"
|
||||||
onClick={(event) => handleQuoteClick(reply, event)}>
|
onClick={(event) => handleQuoteClick(reply, event)}>
|
||||||
c/{reply.cid.slice(0, 8)}</Link>
|
c/{reply.shortCid}</Link>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
@@ -697,7 +697,7 @@ const Board = () => {
|
|||||||
{getDate(thread.timestamp)}
|
{getDate(thread.timestamp)}
|
||||||
|
|
||||||
<Link to="" key={`mob-no-${thread.cid}`} onClick={handleVoidClick} title="Link to this post">c/</Link>
|
<Link to="" key={`mob-no-${thread.cid}`} onClick={handleVoidClick} title="Link to this post">c/</Link>
|
||||||
<button id="reply-button" style={{ all: 'unset', cursor: 'pointer' }} key={`mob-no2-${thread.cid}`} onClick={handleReplyOpen} title="Reply to this post">{thread.cid.slice(0, 8)}</button>
|
<button id="reply-button" style={{ all: 'unset', cursor: 'pointer' }} key={`mob-no2-${thread.cid}`} onClick={handleReplyOpen} title="Reply to this post">{thread.shortCid}</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{thread.link ? (
|
{thread.link ? (
|
||||||
@@ -791,7 +791,7 @@ const Board = () => {
|
|||||||
<span key={`mob-dt-${reply.cid}`} className="date-time-mobile">
|
<span key={`mob-dt-${reply.cid}`} className="date-time-mobile">
|
||||||
{getDate(reply.timestamp)}
|
{getDate(reply.timestamp)}
|
||||||
<Link to="" key={`mob-pl1-${reply.cid}`} onClick={handleVoidClick} title="Link to this post">c/</Link>
|
<Link to="" key={`mob-pl1-${reply.cid}`} onClick={handleVoidClick} title="Link to this post">c/</Link>
|
||||||
<button id="reply-button" style={{ all: 'unset', cursor: 'pointer' }} key={`mob-pl2-${reply.cid}`} onClick={handleReplyOpen} title="Reply to this post">{reply.cid.slice(0, 8)}</button>
|
<button id="reply-button" style={{ all: 'unset', cursor: 'pointer' }} key={`mob-pl2-${reply.cid}`} onClick={handleReplyOpen} title="Reply to this post">{reply.shortCid}</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{reply.link ? (
|
{reply.link ? (
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ const Thread = () => {
|
|||||||
// scroll to post when quote is clicked
|
// scroll to post when quote is clicked
|
||||||
function handleQuoteClick(reply, event) {
|
function handleQuoteClick(reply, event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const cid = reply.cid.slice(0, 8);
|
const cid = reply.shortCid;
|
||||||
const targetElement = [...document.querySelectorAll('.post-reply')]
|
const targetElement = [...document.querySelectorAll('.post-reply')]
|
||||||
.find(el => el.innerHTML.includes(cid));
|
.find(el => el.innerHTML.includes(cid));
|
||||||
if (targetElement) {
|
if (targetElement) {
|
||||||
@@ -477,7 +477,7 @@ const Thread = () => {
|
|||||||
|
|
||||||
<span className="post-number">
|
<span className="post-number">
|
||||||
<Link to="" onClick={handleVoidClick} title="Link to this post">c/</Link>
|
<Link to="" onClick={handleVoidClick} title="Link to this post">c/</Link>
|
||||||
<button id="reply-button" style={{ all: 'unset', cursor: 'pointer' }} onClick={handleReplyOpen} title="Reply to this post">{comment.cid?.slice(0, 8)}</button>
|
<button id="reply-button" style={{ all: 'unset', cursor: 'pointer' }} onClick={handleReplyOpen} title="Reply to this post">{comment.shortCid}</button>
|
||||||
</span>
|
</span>
|
||||||
<button key={`pmb-${comment.cid}`} className="post-menu-button" onClick={handleVoidClick} title="Post menu" style={{ all: 'unset', cursor: 'pointer' }}>▶</button>
|
<button key={`pmb-${comment.cid}`} className="post-menu-button" onClick={handleVoidClick} title="Post menu" style={{ all: 'unset', cursor: 'pointer' }}>▶</button>
|
||||||
<div id="backlink-id" className="backlink">
|
<div id="backlink-id" className="backlink">
|
||||||
@@ -488,7 +488,7 @@ const Thread = () => {
|
|||||||
<Link to={handleVoidClick} key={`ql-${reply.cid}`}
|
<Link to={handleVoidClick} key={`ql-${reply.cid}`}
|
||||||
className="quote-link"
|
className="quote-link"
|
||||||
onClick={(event) => handleQuoteClick(reply, event)}>
|
onClick={(event) => handleQuoteClick(reply, event)}>
|
||||||
c/{reply.cid.slice(0, 8)}</Link>
|
c/{reply.shortCid}</Link>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
@@ -542,7 +542,7 @@ const Thread = () => {
|
|||||||
|
|
||||||
<span key={`pn-${reply.cid}`} className="post-number">
|
<span key={`pn-${reply.cid}`} className="post-number">
|
||||||
<Link to="" key={`pl1-${reply.cid}`} onClick={handleVoidClick} title="Link to this post">c/</Link>
|
<Link to="" key={`pl1-${reply.cid}`} onClick={handleVoidClick} title="Link to this post">c/</Link>
|
||||||
<button id="reply-button" style={{ all: 'unset', cursor: 'pointer' }} key={`pl2-${reply.cid}`} onClick={handleReplyOpen} title="Reply to this post">{reply.cid.slice(0, 8)}</button>
|
<button id="reply-button" style={{ all: 'unset', cursor: 'pointer' }} key={`pl2-${reply.cid}`} onClick={handleReplyOpen} title="Reply to this post">{reply.shortCid}</button>
|
||||||
</span>
|
</span>
|
||||||
<button key={`pmb-${reply.cid}`} className="post-menu-button" onClick={handleVoidClick} title="Post menu" style={{ all: 'unset', cursor: 'pointer' }}>▶</button>
|
<button key={`pmb-${reply.cid}`} className="post-menu-button" onClick={handleVoidClick} title="Post menu" style={{ all: 'unset', cursor: 'pointer' }}>▶</button>
|
||||||
<div id="backlink-id" className="backlink">
|
<div id="backlink-id" className="backlink">
|
||||||
@@ -553,7 +553,7 @@ const Thread = () => {
|
|||||||
<Link to={handleVoidClick} key={`ql-${reply.cid}`}
|
<Link to={handleVoidClick} key={`ql-${reply.cid}`}
|
||||||
className="quote-link"
|
className="quote-link"
|
||||||
onClick={(event) => handleQuoteClick(reply, event)}>
|
onClick={(event) => handleQuoteClick(reply, event)}>
|
||||||
c/{reply.cid.slice(0, 8)}</Link>
|
c/{reply.shortCid}</Link>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
@@ -747,7 +747,7 @@ const Thread = () => {
|
|||||||
<span key={`mob-dt-${reply.cid}`} className="date-time-mobile">
|
<span key={`mob-dt-${reply.cid}`} className="date-time-mobile">
|
||||||
{getDate(reply?.timestamp)}
|
{getDate(reply?.timestamp)}
|
||||||
<Link to="" key={`mob-pl1-${reply.cid}`} onClick={handleVoidClick} title="Link to this post">c/</Link>
|
<Link to="" key={`mob-pl1-${reply.cid}`} onClick={handleVoidClick} title="Link to this post">c/</Link>
|
||||||
<button id="reply-button" style={{ all: 'unset', cursor: 'pointer' }} key={`mob-pl2-${reply.cid}`} onClick={handleReplyOpen} title="Reply to this post">{reply.cid.slice(0, 8)}</button>
|
<button id="reply-button" style={{ all: 'unset', cursor: 'pointer' }} key={`mob-pl2-${reply.cid}`} onClick={handleReplyOpen} title="Reply to this post">{reply.shortCid}</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<blockquote key={`mob-pm-${reply.cid}`} className="post-message-mobile">
|
<blockquote key={`mob-pm-${reply.cid}`} className="post-message-mobile">
|
||||||
|
|||||||
@@ -2468,6 +2468,21 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
debug "4.3.3"
|
debug "4.3.3"
|
||||||
|
|
||||||
|
"@plebbit/plebbit-react-hooks@https://github.com/plebbit/plebbit-react-hooks.git#b42bcb6a4f74ab23bbb8dfa49e43e9cccef3ece6":
|
||||||
|
version "0.0.1"
|
||||||
|
resolved "https://github.com/plebbit/plebbit-react-hooks.git#b42bcb6a4f74ab23bbb8dfa49e43e9cccef3ece6"
|
||||||
|
dependencies:
|
||||||
|
"@plebbit/plebbit-js" "https://github.com/plebbit/plebbit-js.git#7e6f4d7d90f628e474e02c51a89e2723fb71a73d"
|
||||||
|
"@plebbit/plebbit-logger" "https://github.com/plebbit/plebbit-logger.git"
|
||||||
|
assert "2.0.0"
|
||||||
|
ethers "5.6.9"
|
||||||
|
localforage "1.10.0"
|
||||||
|
lodash.isequal "4.5.0"
|
||||||
|
memoizee "0.4.15"
|
||||||
|
quick-lru "5.1.1"
|
||||||
|
uuid "8.3.2"
|
||||||
|
zustand "4.0.0"
|
||||||
|
|
||||||
"@plebbit/plebbit-react-hooks@https://github.com/plebbit/plebbit-react-hooks.git#e47cb245b8af0ae0fdf1ad3170d5097918d1349e":
|
"@plebbit/plebbit-react-hooks@https://github.com/plebbit/plebbit-react-hooks.git#e47cb245b8af0ae0fdf1ad3170d5097918d1349e":
|
||||||
version "0.0.1"
|
version "0.0.1"
|
||||||
resolved "https://github.com/plebbit/plebbit-react-hooks.git#e47cb245b8af0ae0fdf1ad3170d5097918d1349e"
|
resolved "https://github.com/plebbit/plebbit-react-hooks.git#e47cb245b8af0ae0fdf1ad3170d5097918d1349e"
|
||||||
|
|||||||
Reference in New Issue
Block a user