fix(post): deleted or removed posts appeared collapsed like replies

This commit is contained in:
Tom (plebeius.eth)
2024-09-21 12:50:24 +02:00
parent eb9c9c9547
commit d3af6c2a44
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -77,7 +77,7 @@ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }:
return (
<div className={styles.postInfo}>
{!isHidden && <EditMenu post={post} />}
<span className={(hidden || removed || deleted) && styles.postDesktopHidden}>
<span className={(hidden || removed || deleted) && parentCid && styles.postDesktopHidden}>
{title &&
(title.length <= 75 ? (
<span className={styles.subject}>{title} </span>
@@ -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) && <PostMedia post={post} />}
<PostInfo isHidden={hidden} openReplyModal={openReplyModal} post={post} postReplyCount={replyCount} roles={roles} />
{!isHidden && !content && <div className={styles.spacer} />}
{!isHidden && content && <PostMessage post={post} />}
{!(isHidden && parentCid) && <PostMessage post={post} />}
</div>
{!isHidden && !isDescription && !isRules && !isInPendingPostView && (replyCount > 5 || (pinned && repliesCount > 0)) && !isInPostPageView && (
<span className={styles.summary}>
+3 -3
View File
@@ -61,7 +61,7 @@ const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: P
<>
<div className={styles.postInfo}>
<PostMenuMobile post={post} />
<span className={(hidden || deleted || removed) && styles.postDesktopHidden}>
<span className={(hidden || deleted || removed) && parentCid && styles.postDesktopHidden}>
<span className={styles.nameBlock}>
<span className={`${styles.name} ${(isDescription || isRules || authorRole) && !(deleted || removed) && styles.capcodeMod}`}>
{removed ? (
@@ -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 =
<div className={styles.postContainer}>
<div className={styles.postOp} data-cid={cid} data-author-address={author?.shortAddress} data-post-cid={postCid}>
<PostInfoAndMedia openReplyModal={openReplyModal} post={post} postReplyCount={replyCount} roles={roles} />
{content && <PostMessageMobile post={post} />}
<PostMessageMobile post={post} />
</div>
{!isInPostView && !isInPendingPostView && showReplies && (
<div className={styles.postLink}>