From 08e072b795a659431e9b000629246a50d6cc7871 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Sat, 17 Jun 2023 10:30:11 +0200 Subject: [PATCH] add rules and description mobile --- src/components/views/Board.jsx | 246 ++++++++++++++++++++++----------- 1 file changed, 169 insertions(+), 77 deletions(-) diff --git a/src/components/views/Board.jsx b/src/components/views/Board.jsx index c885691d..06549823 100755 --- a/src/components/views/Board.jsx +++ b/src/components/views/Board.jsx @@ -766,6 +766,7 @@ const Board = () => { feed.length > 0 ? ( <> {subplebbit.rules ? + <>
@@ -838,98 +839,189 @@ const Board = () => {
+
+
+
+
+
+ + + ## Board Admins +   + + Sticky +   + Closed + +
+ Rules +   +
+ {getDate(subplebbit.createdAt)} +   +
+
+
+ {subplebbit.rules.map((rule, index) => ( + + {index + 1}. {rule} +
+
+ ))} +
+
+
+
+ {}} className="button-mobile">View Thread +
+
+
+ : null} {subplebbit.description ? -
-
-
-
-
- {subplebbit.suggested?.avatarUrl ? ( -
-
- Link:  - { - subplebbit.suggested?.avatarUrl.length > 30 ? - subplebbit.suggested?.avatarUrl.slice(0, 30) + "..." : - subplebbit.suggested?.avatarUrl - } -  (image) + <> +
+
+
+
+
+ {subplebbit.suggested?.avatarUrl ? ( + + ) : null} + + Welcome to {subplebbit.title || subplebbit.address} +   + ## Board Admins +   + {getDate(subplebbit.createdAt)} +   + Sticky +   + Closed +   + [ + {}} style={{textDecoration: "none"}} className="reply-link">Reply + ] + + { + threadMenuRefs.current[subplebbit.pubsubTopic] = el; + }} + className='post-menu-button' + rotated={openMenuCid === subplebbit.pubsubTopic} + onClick={(event) => { + event.stopPropagation(); + const rect = threadMenuRefs.current[subplebbit.pubsubTopic].getBoundingClientRect(); + setMenuPosition({top: rect.top + window.scrollY, left: rect.left}); + setOpenMenuCid(prevCid => (prevCid === subplebbit.pubsubTopic ? null : subplebbit.pubsubTopic)); + }} + > + ▶ + + {createPortal( + {postMenuCatalogRef.current = el}} + onClick={(event) => event.stopPropagation()} + style={{position: "absolute", + top: menuPosition.top + 7, + left: menuPosition.left}}> +
+
    +
  • handleOptionClick(subplebbit.pubsubTopic)}>Hide thread
  • + {/* {isModerator ? ( + <> + change description + + ) : null} */} +
+
+
, document.body + )} +
+
+
+ {subplebbit.description} +
+
+
+
+
+
+
+ {subplebbit.rules ? +
: +
+ } +
+
+
+ + + ## Board Admins +   + + Sticky +   + Closed + +
+ Welcome to {subplebbit.title || subplebbit.address} +   +
+ {getDate(subplebbit.createdAt)} +   +
+ {subplebbit.suggested?.avatarUrl ? ( +
- - board avatar + board avatar +
image
- ) : null} - - Welcome to {subplebbit.title || subplebbit.address} -   - ## Board Admins -   - {getDate(subplebbit.createdAt)} -   - Sticky -   - Closed -   - [ - {}} style={{textDecoration: "none"}} className="reply-link">Reply - ] - - { - threadMenuRefs.current[subplebbit.pubsubTopic] = el; - }} - className='post-menu-button' - rotated={openMenuCid === subplebbit.pubsubTopic} - onClick={(event) => { - event.stopPropagation(); - const rect = threadMenuRefs.current[subplebbit.pubsubTopic].getBoundingClientRect(); - setMenuPosition({top: rect.top + window.scrollY, left: rect.left}); - setOpenMenuCid(prevCid => (prevCid === subplebbit.pubsubTopic ? null : subplebbit.pubsubTopic)); - }} - > - ▶ - - {createPortal( - {postMenuCatalogRef.current = el}} - onClick={(event) => event.stopPropagation()} - style={{position: "absolute", - top: menuPosition.top + 7, - left: menuPosition.left}}> -
-
    -
  • handleOptionClick(subplebbit.pubsubTopic)}>Hide thread
  • - {/* {isModerator ? ( - <> - change description - - ) : null} */} -
-
-
, document.body - )} -
-
+ ) : null} +
{subplebbit.description}
+
+ {}} className="button-mobile">View Thread +
-
+ : null} { })}
- {index === 0 ? ( + {index === 0 && (!subplebbit.rules && !subplebbit.description) ? (
) : (