From ba2a66ba7005cd8229efea2450b734d74e8cccf2 Mon Sep 17 00:00:00 2001 From: plebbitor Date: Sat, 11 Mar 2023 12:32:42 +0100 Subject: [PATCH] revert Math.random() --- src/components/Board.jsx | 282 ++++++++++++++++++------------------- src/components/Catalog.jsx | 26 ++-- src/components/Thread.jsx | 166 +++++++++++----------- 3 files changed, 237 insertions(+), 237 deletions(-) diff --git a/src/components/Board.jsx b/src/components/Board.jsx index 3c6a5f56..89edc0f0 100644 --- a/src/components/Board.jsx +++ b/src/components/Board.jsx @@ -507,93 +507,93 @@ const Board = ({ setBodyStyle }) => { pageStart={0} loadMore={tryLoadMore} hasMore={hasMore} - loader={
Loading...
} + loader={
Loading...
} > {renderedFeed.map(thread => { const { replies: { pages: { topAll: { comments } } } } = thread; const { renderedComments, omittedCount } = renderComments(comments); return ( - -
-
-
-
-
-
-
+ +
+
+
+
+
+
+
File:  - filename.something (metadata) + filename.something (metadata)
- - filename.something + + filename.something
- + {thread.title ? ( thread.title.length > 75 ? - - - + + {thread.title.slice(0, 75) + " (...)"} - : + : {thread.title} ) : null}  {thread.author.displayName ? thread.author.displayName.length > 20 - ? - - + + {thread.author.displayName.slice(0, 20) + " (...)"} - : + : {thread.author.displayName} - : + : Anonymous}   (u/ {thread.author.address.length > 15 ? - - - + + {thread.author.address.slice(0, 15) + "..."} - : + : {thread.author.address} })   - {getDate(thread.timestamp)} + {getDate(thread.timestamp)}   - - c/ - {thread.cid.slice(0, 8)} + + c/ + {thread.cid.slice(0, 8)}   - + [ - handleClickThread(thread.cid)} className="reply-link" >Reply + handleClickThread(thread.cid)} className="reply-link" >Reply ] - ▶ - - + {omittedCount > 0 ? ( - - + + {omittedCount} post{omittedCount > 1 ? "s" : ""} omitted. Click  - handleClickThread(thread.cid)} className="ttl-link">here + handleClickThread(thread.cid)} className="ttl-link">here  to view. ) : null} {renderedComments.map(reply => { return ( -
-
{'>>'}
-
-
- +
+
{'>>'}
+
+
+ {reply.author.displayName ? reply.author.displayName.length > 12 - ? - - + + {reply.author.displayName.slice(0, 12) + " (...)"} - : + : {reply.author.displayName} - : + : Anonymous}   - + (u/ {reply.author.address.length > 12 ? - - - + + {reply.author.address.slice(0, 12) + "..."} - : + : {reply.author.address} } )   - {getDate(reply.timestamp)} + {getDate(reply.timestamp)}   - - c/ - {reply.cid.slice(0, 8)} + + c/ + {reply.cid.slice(0, 8)} - ▶ + )})}
-
-
-
-
-
- ... - +
+
+
+
+
+ ... + {thread.author.displayName ? thread.author.displayName.length > 15 - ? - - + + {thread.author.displayName.slice(0, 15) + " (...)"} - : + : {thread.author.displayName} - : + : Anonymous}   - + (u/ {thread.author.address.length > 15 ? - - - + + {thread.author.address.slice(0, 15) + "..."} - : + : {thread.author.address} } )  -
+
{thread.title ? ( thread.title.length > 30 ? - - - + + {thread.title.slice(0, 30) + " (...)"} - : + : {thread.title} ) : null} - + {getDate(thread.timestamp)}   - c/ - {thread.cid.slice(0, 8)} + c/ + {thread.cid.slice(0, 8)}
-
- - -
58 KB JPG
+
+ + +
58 KB JPG
{thread.content ? ( thread.content.length > 1500 ? - -
+ +
{thread.content.slice(0, 1500)} - (...) -

+ (...) +

Post too long.  - handleClickThread(thread.cid)} className="ttl-link">Click here + handleClickThread(thread.cid)} className="ttl-link">Click here  to view.
- :
+ :
{thread.content}
) : null}
-
- {thread.replyCount} Replies / ? Images - handleClickThread(thread.cid)} className="button-mobile" >View Thread +
+ {thread.replyCount} Replies / ? Images + handleClickThread(thread.cid)} className="button-mobile" >View Thread
{renderedComments.map(reply => { return ( -
-
-
- ... - +
+
+
+ ... + {reply.author.displayName ? reply.author.displayName.length > 12 - ? - - + + {reply.author.displayName.slice(0, 12) + " (...)"} - : + : {reply.author.displayName} - : + : Anonymous}   - + (u/ {reply.author.address.length > 10 ? - - - + + {reply.author.address.slice(0, 10) + "..."} - : + : {reply.author.address} } )  -
+
- + {getDate(reply.timestamp)}  - c/ - {reply.cid.slice(0, 8)} + c/ + {reply.cid.slice(0, 8)}
{reply.content ? ( reply.content.length > 1000 ? - -
- + +
+ {`c/${reply.parentCid.slice(0, 8)}`}{
} {reply.content.slice(0, 1000)} - (...) -

+ (...) +

Comment too long.  - handleClickThread(thread.cid)} className="ttl-link">Click here + handleClickThread(thread.cid)} className="ttl-link">Click here  to view.
- :
- handleQuoteClick(reply, event)}> + :
+ handleQuoteClick(reply, event)}> {`c/${reply.parentCid.slice(0, 8)}`}{
} {reply.content} diff --git a/src/components/Catalog.jsx b/src/components/Catalog.jsx index 9978f92a..31f5bfb3 100644 --- a/src/components/Catalog.jsx +++ b/src/components/Catalog.jsx @@ -340,9 +340,9 @@ const Catalog = ({ setBodyStyle }) => { <> {defaultSubplebbits.map(subplebbit => ( - + [ - handleClickTitle(subplebbit.title, subplebbit.address)} + handleClickTitle(subplebbit.title, subplebbit.address)} >{subplebbit.title} ]  @@ -362,7 +362,7 @@ const Catalog = ({ setBodyStyle }) => {   @@ -476,23 +476,23 @@ const Catalog = ({ setBodyStyle }) => { pageStart={0} loadMore={tryLoadMore} hasMore={hasMore} - loader={
Loading...
} + loader={
Loading...
} > {feed.map(thread => { return ( -
- handleClickThread(thread.cid)}> - +
+ handleClickThread(thread.cid)}> + -
- +
+
-
+
R: - {thread.replyCount} + {thread.replyCount}
-
- {thread.title ? `${thread.title}` : null} +
+ {thread.title ? `${thread.title}` : null} {thread.content ? `: ${thread.content}` : null}
diff --git a/src/components/Thread.jsx b/src/components/Thread.jsx index ae8b28e0..a30e1519 100644 --- a/src/components/Thread.jsx +++ b/src/components/Thread.jsx @@ -259,9 +259,9 @@ const Thread = ({ setBodyStyle }) => { <> {defaultSubplebbits.map(subplebbit => ( - + [ - handleClickTitle(subplebbit.title, subplebbit.address)} >{subplebbit.title} @@ -283,7 +283,7 @@ const Thread = ({ setBodyStyle }) => {   @@ -425,28 +425,28 @@ const Thread = ({ setBodyStyle }) => {
-
-
+
+
File:  - filename.something (metadata) + filename.something (metadata)
- - filename.something + + filename.something
{comment.title ? ( comment.title.length > 75 ? <> - - + {comment.title.slice(0, 75) + " (...)"} - : + : {comment.title} ) : null} @@ -454,17 +454,17 @@ const Thread = ({ setBodyStyle }) => { {comment.author.displayName ? comment.author.displayName.length > 20 ? <> - - + {comment.author.displayName.slice(0, 20) + " (...)"} - : + : {comment.author.displayName} - : + : Anonymous}     @@ -472,15 +472,15 @@ const Thread = ({ setBodyStyle }) => { (u/ {comment.author.address.length > 20 ? <> - - + {comment.author.address.slice(0, 20) + "..."} - : + : {comment.author.address} }) @@ -491,13 +491,13 @@ const Thread = ({ setBodyStyle }) => { c/ {comment.cid.slice(0, 8)} - ▶ +