diff --git a/src/components/post/post.tsx b/src/components/post/post.tsx index 4b3bad81..d43a696f 100644 --- a/src/components/post/post.tsx +++ b/src/components/post/post.tsx @@ -106,8 +106,11 @@ const PostDesktop = ({ post, showAllReplies }: { post: Comment; showAllReplies: const { t } = useTranslation(); const { author, cid, content, link, linkHeight, linkWidth, locked, pinned, postCid, replyCount, shortCid, subplebbitAddress, timestamp, title } = post || {}; const { displayName, shortAddress } = author || {}; + + const isInPostPage = isPostPageView(useLocation().pathname, useParams()); + const displayTitle = title && title.length > 75 ? title?.slice(0, 75) + '...' : 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); @@ -124,9 +127,11 @@ const PostDesktop = ({ post, showAllReplies }: { post: Comment; showAllReplies:
)} - {(replies.length > 5 || pinned) && ( + {(replies.length > 5 || pinned) && !isInPostPage && ( @@ -215,8 +220,9 @@ const PostDesktop = ({ post, showAllReplies }: { post: Comment; showAllReplies: Click here to view. )} - {!pinned && - replies?.slice(0, showAllReplies ? replies.length : 5).map((reply, index) => ( + {!(pinned && !isInPostPage) && + replies && + replies.slice(0, showAllReplies ? replies.length : 5).map((reply, index) => (- {content.length > 1000 && ( + {content.length > 1000 && !isInPostPage && (
Comment too long. Click here to view the full text. @@ -206,7 +211,7 @@ const PostDesktop = ({ post, showAllReplies }: { post: Comment; showAllReplies: )}
- {content.length > 1000 && ( + {content.length > 1000 && !isInPostPage && (
Comment too long. Click here to view the full text. diff --git a/src/views/post-page/post-page.tsx b/src/views/post-page/post-page.tsx index 56be8b03..d31cbddc 100644 --- a/src/views/post-page/post-page.tsx +++ b/src/views/post-page/post-page.tsx @@ -1,3 +1,4 @@ +import { useEffect } from 'react'; import { useComment } from '@plebbit/plebbit-react-hooks'; import { useParams } from 'react-router-dom'; import Post from '../../components/post/post'; @@ -9,6 +10,10 @@ const PostPage = () => { const post = useComment({ commentCid }); + useEffect(() => { + window.scrollTo(0, 0); + }, []); + return (