diff --git a/src/components/catalog-row/catalog-row.tsx b/src/components/catalog-row/catalog-row.tsx index 9c17fad3..9cd2aad9 100644 --- a/src/components/catalog-row/catalog-row.tsx +++ b/src/components/catalog-row/catalog-row.tsx @@ -15,7 +15,6 @@ import useHide from '../../hooks/use-hide'; import useWindowWidth from '../../hooks/use-window-width'; import PostMenuDesktop from '../post-desktop/post-menu-desktop'; import styles from './catalog-row.module.css'; -import Markdown from '../markdown'; import _ from 'lodash'; import { ContentPreview } from '../../views/home/popular-threads-box'; diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index 822c8b82..c02c91eb 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -46,7 +46,7 @@ const useShowOmittedReplies = create((set) => ({ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }: PostProps) => { const { t } = useTranslation(); - const { author, cid, deleted, locked, pinned, parentCid, postCid, removed, shortCid, state, subplebbitAddress, timestamp } = post || {}; + const { author, cid, deleted, locked, pinned, parentCid, postCid, reason, removed, shortCid, state, subplebbitAddress, timestamp } = post || {}; const title = post?.title?.trim(); const replies = useReplies(post); const { address, shortAddress } = author || {}; @@ -77,7 +77,7 @@ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }: return (
{!isHidden && } - + {title && (title.length <= 75 ? ( {title} @@ -290,7 +290,7 @@ const PostMessage = ({ post }: PostProps) => { return (
- {isReply && state !== 'failed' && isReplyingToReply && } + {isReply && state !== 'failed' && isReplyingToReply && !(deleted || removed) && } {removed ? ( reason ? ( <> @@ -381,7 +381,7 @@ const Reply = ({ openReplyModal, postReplyCount, reply, roles }: PostProps) => { post = editedComment; } - const { author, cid, deleted, link, postCid, removed, subplebbitAddress } = post || {}; + const { author, cid, deleted, link, postCid, reason, removed, subplebbitAddress } = post || {}; const isRouteLinkToReply = useLocation().pathname.startsWith(`/p/${subplebbitAddress}/c/${cid}`); const { hidden } = useHide({ cid }); @@ -391,7 +391,7 @@ const Reply = ({ openReplyModal, postReplyCount, reply, roles }: PostProps) => {
{link && !hidden && !(deleted || removed) && isValidURL(link) && } - {!(hidden || removed || deleted) && } + {!hidden && (!(removed || deleted) || ((removed || deleted) && reason)) && }
); @@ -399,7 +399,7 @@ const Reply = ({ openReplyModal, postReplyCount, reply, roles }: PostProps) => { const PostDesktop = ({ openReplyModal, post, roles, showAllReplies, showReplies = true }: PostProps) => { const { t } = useTranslation(); - const { author, cid, content, deleted, link, pinned, postCid, removed, state, subplebbitAddress } = post || {}; + const { author, cid, content, deleted, link, parentCid, pinned, postCid, removed, state, subplebbitAddress } = post || {}; const { isDescription, isRules } = post || {}; // custom properties, not from api const params = useParams(); const location = useLocation(); @@ -450,7 +450,7 @@ const PostDesktop = ({ openReplyModal, post, roles, showAllReplies, showReplies {link && !isHidden && !(deleted || removed) && isValidURL(link) && } {!isHidden && !content &&
} - {!isHidden && content && } + {!(isHidden && parentCid) && }
{!isHidden && !isDescription && !isRules && !isInPendingPostView && (replyCount > 5 || (pinned && repliesCount > 0)) && !isInPostPageView && ( diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx index 84915db8..da4d27c8 100644 --- a/src/components/post-mobile/post-mobile.tsx +++ b/src/components/post-mobile/post-mobile.tsx @@ -25,7 +25,7 @@ import _ from 'lodash'; const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: PostProps) => { const { t } = useTranslation(); - const { author, cid, deleted, link, locked, parentCid, pinned, postCid, removed, shortCid, state, subplebbitAddress, timestamp } = post || {}; + const { author, cid, deleted, link, locked, parentCid, pinned, postCid, reason, removed, shortCid, state, subplebbitAddress, timestamp } = post || {}; const title = post?.title?.trim(); const { isDescription, isRules } = post || {}; // custom properties, not from api const { address, shortAddress } = author || {}; @@ -61,7 +61,7 @@ const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: P <>
- + {removed ? ( @@ -307,7 +307,7 @@ const Reply = ({ openReplyModal, postReplyCount, reply, roles }: PostProps) => { if (editedComment) { post = editedComment; } - const { author, cid, deleted, postCid, removed, subplebbitAddress } = post || {}; + const { author, cid, deleted, postCid, reason, removed, subplebbitAddress } = post || {}; const isRouteLinkToReply = useLocation().pathname.startsWith(`/p/${subplebbitAddress}/c/${cid}`); const { hidden } = useHide({ cid }); @@ -321,7 +321,7 @@ const Reply = ({ openReplyModal, postReplyCount, reply, roles }: PostProps) => { data-post-cid={postCid} > - {!hidden && !deleted && !removed && } + {!hidden && (!(removed || deleted) || ((removed || deleted) && reason)) && }
@@ -331,7 +331,7 @@ const Reply = ({ openReplyModal, postReplyCount, reply, roles }: PostProps) => { const PostMobile = ({ openReplyModal, post, roles, showAllReplies, showReplies = true }: PostProps) => { const { t } = useTranslation(); - const { author, cid, content, pinned, postCid, replyCount, state, subplebbitAddress } = post || {}; + const { author, cid, pinned, postCid, replyCount, state, subplebbitAddress } = post || {}; const { isDescription, isRules } = post || {}; // custom properties, not from api const params = useParams(); const location = useLocation(); @@ -379,7 +379,7 @@ const PostMobile = ({ openReplyModal, post, roles, showAllReplies, showReplies =
- {content && } +
{!isInPostView && !isInPendingPostView && showReplies && (