mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
Update post.tsx
This commit is contained in:
@@ -292,9 +292,11 @@ const PostMobile = ({ post, showAllReplies }: { post: Comment; showAllReplies: b
|
||||
const { t } = useTranslation();
|
||||
const { author, cid, content, link, linkHeight, linkWidth, pinned, replyCount, shortCid, subplebbitAddress, timestamp, title } = post || {};
|
||||
const { address, displayName, shortAddress } = author || {};
|
||||
|
||||
const linkCount = useCountLinksInReplies(post);
|
||||
const isInPostPage = isPostPageView(useLocation().pathname, useParams());
|
||||
const displayTitle = title && title.length > 30 ? title?.slice(0, 30) + '(...)' : title;
|
||||
const displayContent = content && content.length > 1000 ? content?.slice(0, 1000) : content;
|
||||
const displayContent = content && !isInPostPage && content.length > 1000 ? content?.slice(0, 1000) : content;
|
||||
|
||||
const commentMediaInfo = getCommentMediaInfoMemoized(post);
|
||||
const hasThumbnail = getHasThumbnail(commentMediaInfo, link);
|
||||
@@ -302,8 +304,6 @@ const PostMobile = ({ post, showAllReplies }: { post: Comment; showAllReplies: b
|
||||
|
||||
const replies = useReplies(post);
|
||||
|
||||
const isInPostPage = isPostPageView(useLocation().pathname, useParams());
|
||||
|
||||
return (
|
||||
<div className={styles.postMobile}>
|
||||
<div className={styles.hrWrapper}>
|
||||
@@ -366,8 +366,9 @@ const PostMobile = ({ post, showAllReplies }: { post: Comment; showAllReplies: b
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{!pinned &&
|
||||
replies?.slice(0, showAllReplies ? replies.length : 5).map((reply, index) => (
|
||||
{!(pinned && !isInPostPage) &&
|
||||
replies &&
|
||||
replies.slice(0, showAllReplies ? replies.length : 5).map((reply, index) => (
|
||||
<div key={reply.cid} className={styles.replyContainer}>
|
||||
<ReplyMobile index={index} reply={reply} />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user