From 0c7fcd3f639b695b6fe9940552f3860d8201d529 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Tue, 20 Aug 2024 11:01:19 +0200 Subject: [PATCH] shorten CIDs on mobile --- src/components/post-desktop/post-desktop.tsx | 4 +--- src/components/post-mobile/post-mobile.tsx | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index f2430508..e6b2d26e 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -1,7 +1,7 @@ import { useEffect, useRef, useState } from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { Link, useLocation, useParams } from 'react-router-dom'; -import { Comment, useAccount, useAccountComments, useAuthorAvatar, useComment, useEditedComment } from '@plebbit/plebbit-react-hooks'; +import { Comment, useAccount, useAuthorAvatar, useComment, useEditedComment } from '@plebbit/plebbit-react-hooks'; import Plebbit from '@plebbit/plebbit-js/dist/browser/index.js'; import styles from '../../views/post/post.module.css'; import { getCommentMediaInfo, getDisplayMediaInfoType, getHasThumbnail } from '../../lib/utils/media-utils'; @@ -388,8 +388,6 @@ const PostDesktop = ({ openReplyModal, post, roles, showAllReplies, showReplies const visiblelinksCount = useCountLinksInReplies(post, 5); const totalLinksCount = useCountLinksInReplies(post); const replyCount = replies?.length; - const { accountComments } = useAccountComments(); - const isPostInAccountComments = accountComments?.find((comment) => comment.cid === cid); const repliesCount = pinned ? replyCount : replyCount - 5; const linksCount = pinned ? totalLinksCount : totalLinksCount - visiblelinksCount; diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx index f0cc443f..4700d5d8 100644 --- a/src/components/post-mobile/post-mobile.tsx +++ b/src/components/post-mobile/post-mobile.tsx @@ -137,7 +137,7 @@ const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: P c/ openReplyModal && openReplyModal(cid, postCid, subplebbitAddress)}> - {shortCid} + {shortCid.slice(0, -4)} ) : (