From 89e19adb5c4d3717fe4a785047aca2f790be4643 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Thu, 4 Jul 2024 14:15:39 +0200 Subject: [PATCH] fix(post): remove "user was banned for this post" because it's only visible to mods at the moment --- src/components/post-desktop/post-desktop.tsx | 10 ++++++---- src/components/post-mobile/post-mobile.tsx | 8 +++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index 7103673c..56071367 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -217,8 +217,9 @@ const PostMedia = ({ post }: PostProps) => { }; const PostMessage = ({ post }: PostProps) => { - const { cid, content, commentAuthor, deleted, edit, original, parentCid, postCid, reason, removed, spoiler, state, subplebbitAddress } = post || {}; - const banned = !!commentAuthor?.banExpiresAt; + const { cid, content, deleted, edit, original, parentCid, postCid, reason, removed, spoiler, state, subplebbitAddress } = post || {}; + // TODO: commentAuthor is not available outside of editedComment, update when available + // const banned = !!post?.commentAuthor?.banExpiresAt; const { t } = useTranslation(); const params = useParams(); const location = useLocation(); @@ -275,7 +276,8 @@ const PostMessage = ({ post }: PostProps) => { )} )} - {banned && ( + {/* TODO: commentAuthor is not available outside of editedComment, update when available */} + {/* {banned && (

@@ -288,7 +290,7 @@ const PostMessage = ({ post }: PostProps) => { })}${reason ? `. ${_.capitalize(t('reason'))}: "${reason}"` : ''}`} />
- )} + )} */} {!isReply && content.length > 1000 && !isInPostView && (
diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx index cb0e227d..c7618ac9 100644 --- a/src/components/post-mobile/post-mobile.tsx +++ b/src/components/post-mobile/post-mobile.tsx @@ -153,7 +153,8 @@ const ReplyBacklinks = ({ post }: PostProps) => { const PostMessageMobile = ({ post }: PostProps) => { const { t } = useTranslation(); const { cid, commentAuthor, content, deleted, edit, original, parentCid, postCid, reason, removed, spoiler, state, subplebbitAddress } = post || {}; - const banned = !!commentAuthor?.banExpiresAt; + // TODO: commentAuthor is not available outside of editedComment, update when available + // const banned = !!post?.commentAuthor?.banExpiresAt; const [showOriginal, setShowOriginal] = useState(false); const params = useParams(); @@ -211,7 +212,8 @@ const PostMessageMobile = ({ post }: PostProps) => { )} )} - {banned && ( + {/* TODO: commentAuthor is not available outside of editedComment, update when available */} + {/* {banned && (

@@ -224,7 +226,7 @@ const PostMessageMobile = ({ post }: PostProps) => { })}${reason ? `. ${_.capitalize(t('reason'))}: "${reason}"` : ''}`} />
- )} + )} */} {!isReply && content.length > 1000 && !isInPostView && (