mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(post): deleted or removed posts appeared collapsed like replies
This commit is contained in:
@@ -77,7 +77,7 @@ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }:
|
|||||||
return (
|
return (
|
||||||
<div className={styles.postInfo}>
|
<div className={styles.postInfo}>
|
||||||
{!isHidden && <EditMenu post={post} />}
|
{!isHidden && <EditMenu post={post} />}
|
||||||
<span className={(hidden || removed || deleted) && styles.postDesktopHidden}>
|
<span className={(hidden || removed || deleted) && parentCid && styles.postDesktopHidden}>
|
||||||
{title &&
|
{title &&
|
||||||
(title.length <= 75 ? (
|
(title.length <= 75 ? (
|
||||||
<span className={styles.subject}>{title} </span>
|
<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 PostDesktop = ({ openReplyModal, post, roles, showAllReplies, showReplies = true }: PostProps) => {
|
||||||
const { t } = useTranslation();
|
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 { isDescription, isRules } = post || {}; // custom properties, not from api
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
@@ -450,7 +450,7 @@ const PostDesktop = ({ openReplyModal, post, roles, showAllReplies, showReplies
|
|||||||
{link && !isHidden && !(deleted || removed) && isValidURL(link) && <PostMedia post={post} />}
|
{link && !isHidden && !(deleted || removed) && isValidURL(link) && <PostMedia post={post} />}
|
||||||
<PostInfo isHidden={hidden} openReplyModal={openReplyModal} post={post} postReplyCount={replyCount} roles={roles} />
|
<PostInfo isHidden={hidden} openReplyModal={openReplyModal} post={post} postReplyCount={replyCount} roles={roles} />
|
||||||
{!isHidden && !content && <div className={styles.spacer} />}
|
{!isHidden && !content && <div className={styles.spacer} />}
|
||||||
{!isHidden && content && <PostMessage post={post} />}
|
{!(isHidden && parentCid) && <PostMessage post={post} />}
|
||||||
</div>
|
</div>
|
||||||
{!isHidden && !isDescription && !isRules && !isInPendingPostView && (replyCount > 5 || (pinned && repliesCount > 0)) && !isInPostPageView && (
|
{!isHidden && !isDescription && !isRules && !isInPendingPostView && (replyCount > 5 || (pinned && repliesCount > 0)) && !isInPostPageView && (
|
||||||
<span className={styles.summary}>
|
<span className={styles.summary}>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: P
|
|||||||
<>
|
<>
|
||||||
<div className={styles.postInfo}>
|
<div className={styles.postInfo}>
|
||||||
<PostMenuMobile post={post} />
|
<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.nameBlock}>
|
||||||
<span className={`${styles.name} ${(isDescription || isRules || authorRole) && !(deleted || removed) && styles.capcodeMod}`}>
|
<span className={`${styles.name} ${(isDescription || isRules || authorRole) && !(deleted || removed) && styles.capcodeMod}`}>
|
||||||
{removed ? (
|
{removed ? (
|
||||||
@@ -331,7 +331,7 @@ const Reply = ({ openReplyModal, postReplyCount, reply, roles }: PostProps) => {
|
|||||||
|
|
||||||
const PostMobile = ({ openReplyModal, post, roles, showAllReplies, showReplies = true }: PostProps) => {
|
const PostMobile = ({ openReplyModal, post, roles, showAllReplies, showReplies = true }: PostProps) => {
|
||||||
const { t } = useTranslation();
|
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 { isDescription, isRules } = post || {}; // custom properties, not from api
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
@@ -379,7 +379,7 @@ const PostMobile = ({ openReplyModal, post, roles, showAllReplies, showReplies =
|
|||||||
<div className={styles.postContainer}>
|
<div className={styles.postContainer}>
|
||||||
<div className={styles.postOp} data-cid={cid} data-author-address={author?.shortAddress} data-post-cid={postCid}>
|
<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} />
|
<PostInfoAndMedia openReplyModal={openReplyModal} post={post} postReplyCount={replyCount} roles={roles} />
|
||||||
{content && <PostMessageMobile post={post} />}
|
<PostMessageMobile post={post} />
|
||||||
</div>
|
</div>
|
||||||
{!isInPostView && !isInPendingPostView && showReplies && (
|
{!isInPostView && !isInPendingPostView && showReplies && (
|
||||||
<div className={styles.postLink}>
|
<div className={styles.postLink}>
|
||||||
|
|||||||
Reference in New Issue
Block a user