From 2aa50b5f87fd669a303ad5df7015f49601febf69 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Fri, 30 Jun 2023 16:22:09 +0200 Subject: [PATCH 1/2] fix for new boards --- src/components/styled/views/Board.styled.jsx | 12 ++++++------ src/components/views/Board.jsx | 12 +++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/components/styled/views/Board.styled.jsx b/src/components/styled/views/Board.styled.jsx index 0779b1fc..f3ef6856 100644 --- a/src/components/styled/views/Board.styled.jsx +++ b/src/components/styled/views/Board.styled.jsx @@ -2153,7 +2153,7 @@ export const BoardForm = styled.div` } .op-container { - display: inline; + display: grid; } .op { @@ -2327,7 +2327,7 @@ export const BoardForm = styled.div` } .op-container { - display: inline; + display: grid; } .op { @@ -2500,7 +2500,7 @@ export const BoardForm = styled.div` } .op-container { - display: inline; + display: grid; } .op { @@ -2671,7 +2671,7 @@ export const BoardForm = styled.div` } .op-container { - display: inline; + display: grid; } .op { @@ -2839,7 +2839,7 @@ export const BoardForm = styled.div` } .op-container { - display: inline; + display: grid; } .op { @@ -3017,7 +3017,7 @@ export const BoardForm = styled.div` } .op-container { - display: inline; + display: grid; } .op { diff --git a/src/components/views/Board.jsx b/src/components/views/Board.jsx index 2153687b..28281f45 100755 --- a/src/components/views/Board.jsx +++ b/src/components/views/Board.jsx @@ -66,7 +66,7 @@ const Board = () => { selectedStyle, setSelectedThread, setSelectedText, - selectedTitle, setSelectedTitle, + setSelectedTitle, showPostForm, showPostFormLink, setTriggerInsertion, @@ -623,7 +623,7 @@ const Board = () => { return ( <> - {((selectedTitle ? selectedTitle : selectedAddress) + " - plebchan")} + {((subplebbit.title ? subplebbit.title : subplebbit.address) + " - plebchan")} { {subplebbit?.state === "failed" ? ( null ) : ( - feed.length > 0 ? ( + subplebbit?.state === "succeeded" ? ( <> {subplebbit.rules ? <> @@ -962,9 +962,7 @@ const Board = () => { {subplebbit.description ? <>
-
+

@@ -2549,7 +2547,7 @@ const Board = () => { }} endReached={tryLoadMore} useWindowScroll={true} - components={{ Footer: hasMore ? () => : null }} + components={{ Footer: hasMore && feed.length > 0 ? () => : null }} /> ) : () From 4d4110eef8cf78c8ddea01037ea996334f426fdc Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Sat, 1 Jul 2023 10:01:30 +0200 Subject: [PATCH 2/2] add plebtoken rules hardcode --- src/components/views/Board.jsx | 134 ++++++++++++++++++++++++++++++++- src/components/views/Rules.jsx | 49 +++++++++--- 2 files changed, 170 insertions(+), 13 deletions(-) diff --git a/src/components/views/Board.jsx b/src/components/views/Board.jsx index 28281f45..c645eaf4 100755 --- a/src/components/views/Board.jsx +++ b/src/components/views/Board.jsx @@ -73,6 +73,13 @@ const Board = () => { } = useGeneralStore(state => state); const { anonymousMode } = useAnonModeStore(); + + // temporary hardcode + const plebtokenRules = [ + "This community is strictly SFW. Any NSFW language or content will be removed.", + Only post about the plebbit token ($PLEB). For general cryptocurrency discussion, go to p/business-and-finance.eth., + "FUD is allowed unless blatantly meaningless and spammy." + ] const account = useAccount(); const navigate = useNavigate(); @@ -958,7 +965,132 @@ const Board = () => {
- : null} + : subplebbit.address === "plebtoken.eth" ? ( + <> +
+
+
+
+
+ + Rules +   + {setIsAdminListOpen(!isAdminListOpen)}} + >## Board Admins +   + {getDate(subplebbit.createdAt)} +   + Sticky +   + Closed +   + [ + Reply + ] + + { + threadMenuRefs.current["rules"] = el; + }} + className='post-menu-button' + rotated={openMenuCid === "rules"} + onClick={(event) => { + event.stopPropagation(); + const rect = threadMenuRefs.current["rules"].getBoundingClientRect(); + setMenuPosition({top: rect.top + window.scrollY, left: rect.left}); + setOpenMenuCid(prevCid => (prevCid === "rules" ? null : "rules")); + }} + > + ▶ + + {createPortal( + {postMenuCatalogRef.current = el}} + onClick={(event) => event.stopPropagation()} + style={{position: "absolute", + top: menuPosition.top + 7, + left: menuPosition.left}}> +
+
    +
  • handleOptionClick("rules")}>Hide thread
  • + {/* {isModerator ? ( + <> + change rules + + ) : null} */} +
+
+
, document.body + )} +
+
+
+ {plebtokenRules.map((rule, index) => ( + + {index + 1}. {rule} +
+
+ ))} +
+
+
+
+
+
+
+
+
+
+
+ + + {setIsAdminListOpen(!isAdminListOpen)}} + >## Board Admins +   + + Sticky +   + Closed + +
+ Rules +   +
+ {getDate(subplebbit.createdAt)} +   +
+
+
+ {plebtokenRules.map((rule, index) => ( + + {index + 1}. {rule} +
+
+ ))} +
+
+
+
+ View Thread +
+
+
+ + ) : null} {subplebbit.description ? <>
diff --git a/src/components/views/Rules.jsx b/src/components/views/Rules.jsx index c7f4a6f0..6405d94a 100644 --- a/src/components/views/Rules.jsx +++ b/src/components/views/Rules.jsx @@ -28,6 +28,13 @@ const Rules = () => { selectedThread, setSelectedThread, setSelectedTitle, } = useGeneralStore(state => state); + + // temporary hardcode + const plebtokenRules = [ + "This community is strictly SFW. Any NSFW language or content will be removed.", + Only post about the plebbit token ($PLEB). For general cryptocurrency discussion, go to p/business-and-finance.eth., + "FUD is allowed unless blatantly meaningless and spammy." + ] const navigate = useNavigate(); @@ -332,12 +339,21 @@ const Rules = () => {
- {subplebbit.rules?.map((rule, index) => ( - - {index + 1}. {rule} -
-
- ))} + {subplebbit.address === "plebtoken.eth" ? ( + plebtokenRules.map((rule, index) => ( + + {index + 1}. {rule} +
+
+ )) + ) : ( + subplebbit.rules?.map((rule, index) => ( + + {index + 1}. {rule} +
+
+ )) + )}
@@ -373,12 +389,21 @@ const Rules = () => {
- {subplebbit.rules?.map((rule, index) => ( - - {index + 1}. {rule} -
-
- ))} + {subplebbit.address === "plebtoken.eth" ? ( + plebtokenRules.map((rule, index) => ( + + {index + 1}. {rule} +
+
+ )) + ) : ( + subplebbit.rules?.map((rule, index) => ( + + {index + 1}. {rule} +
+
+ )) + )}