no need for reply to be a component

This commit is contained in:
plebeius.eth
2024-05-16 18:43:59 +02:00
parent 39c26ed264
commit c786a54cd1
+8 -14
View File
@@ -276,26 +276,20 @@ const PostDesktop = ({ isInPostPage, isPendingPostPage, openReplyModal, post, ro
replies &&
(showAllReplies ? replies : replies.slice(-5)).map((reply, index) => (
<div key={index} className={styles.replyContainer}>
<ReplyDesktop index={index} reply={reply} roles={roles} openReplyModal={openReplyModal} />
<div className={styles.replyDesktop}>
<div className={styles.sideArrows}>{'>>'}</div>
<div className={styles.reply}>
<PostInfoDesktop isInPostPage={isInPostPage} isPendingPostPage={isPendingPostPage} openReplyModal={openReplyModal} post={reply} roles={roles} />
<PostMediaDesktop post={reply} />
<PostMessageDesktop isInPostPage={isInPostPage} post={reply} />
</div>
</div>
</div>
))}
</div>
);
};
const ReplyDesktop = ({ isInPostPage, isPendingPostPage, reply, roles, openReplyModal }: PostProps) => {
return (
<div className={styles.replyDesktop}>
<div className={styles.sideArrows}>{'>>'}</div>
<div className={styles.reply}>
<PostInfoDesktop isInPostPage={isInPostPage} isPendingPostPage={isPendingPostPage} openReplyModal={openReplyModal} post={reply} roles={roles} />
<PostMediaDesktop post={reply} />
<PostMessageDesktop isInPostPage={isInPostPage} post={reply} />
</div>
</div>
);
};
const PostMobile = ({ isInPostPage, isPendingPostPage, openReplyModal, post, roles, showAllReplies }: PostProps) => {
const { t } = useTranslation();
const { author, cid, content, link, linkHeight, linkWidth, locked, pinned, replyCount, shortCid, state, subplebbitAddress, timestamp, title } = post || {};