diff --git a/src/components/board-buttons/board-buttons.tsx b/src/components/board-buttons/board-buttons.tsx index 0c9add93..4068ac30 100644 --- a/src/components/board-buttons/board-buttons.tsx +++ b/src/components/board-buttons/board-buttons.tsx @@ -1,7 +1,6 @@ import { useTranslation } from 'react-i18next'; import { Link, useLocation, useNavigate, useParams } from 'react-router-dom'; import { useAccountComment, useSubscribe } from '@plebbit/plebbit-react-hooks'; -import useSubplebbitsStore from '@plebbit/plebbit-react-hooks/dist/stores/subplebbits'; import useSubplebbitsPagesStore from '@plebbit/plebbit-react-hooks/dist/stores/subplebbits-pages'; import { isAllView, isCatalogView, isModView, isPendingPostView, isPostPageView, isSubscriptionsView } from '../../lib/utils/view-utils'; import { useDefaultSubplebbits } from '../../hooks/use-default-subplebbits'; @@ -364,11 +363,8 @@ export const MobileBoardButtons = () => { const PostPageStats = () => { const { t } = useTranslation(); const params = useParams(); - const location = useLocation(); - const resolvedAddress = useResolvedSubplebbitAddress(); const comment = useSubplebbitsPagesStore((state) => state.comments[params?.commentCid as string]); - const subplebbit = useSubplebbitsStore((state) => state.subplebbits[resolvedAddress as string]); const { closed, pinned, replyCount } = comment || {}; const linkCount = useCountLinksInReplies(comment); diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index a59b8244..4efd8b55 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -2,7 +2,6 @@ import { useMemo, useState } from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { Link, useLocation, useParams } from 'react-router-dom'; import { Comment, useAuthorAvatar, useEditedComment } from '@plebbit/plebbit-react-hooks'; -import useSubplebbitsStore from '@plebbit/plebbit-react-hooks/dist/stores/subplebbits'; import Plebbit from '@plebbit/plebbit-js'; import styles from '../../views/post/post.module.css'; import { CommentMediaInfo, getDisplayMediaInfoType, getHasThumbnail, getMediaDimensions } from '../../lib/utils/media-utils'; @@ -70,7 +69,6 @@ const PostInfo = ({ post, postReplyCount = 0, roles, isHidden }: PostProps) => { const params = useParams(); const location = useLocation(); - const isInAllView = isAllView(location.pathname); const isInPostPageView = isPostPageView(location.pathname, params); const userID = address && Plebbit.getShortAddress(address); diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx index 47735340..231b0117 100644 --- a/src/components/post-mobile/post-mobile.tsx +++ b/src/components/post-mobile/post-mobile.tsx @@ -2,7 +2,6 @@ import { useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Link, useLocation, useParams } from 'react-router-dom'; import { Comment, useAuthorAvatar, useEditedComment } from '@plebbit/plebbit-react-hooks'; -import useSubplebbitsStore from '@plebbit/plebbit-react-hooks/dist/stores/subplebbits'; import Plebbit from '@plebbit/plebbit-js'; import styles from '../../views/post/post.module.css'; import { shouldShowSnow } from '../../lib/snow'; @@ -302,7 +301,6 @@ const PostMobile = ({ post, roles, showAllReplies, showReplies = true }: PostPro const { author, cid, pinned, postCid, replyCount, state, subplebbitAddress } = post || {}; const params = useParams(); const location = useLocation(); - const isInAllView = isAllView(location.pathname); const isInPendingPostView = isPendingPostView(location.pathname, params); const isInPostView = isPostPageView(location.pathname, params); const defaultSubplebbits = useDefaultSubplebbits(); diff --git a/src/components/subplebbit-stats/subplebbit-stats.tsx b/src/components/subplebbit-stats/subplebbit-stats.tsx index 94c9d132..641e8046 100644 --- a/src/components/subplebbit-stats/subplebbit-stats.tsx +++ b/src/components/subplebbit-stats/subplebbit-stats.tsx @@ -1,4 +1,4 @@ -import { useLocation, useParams } from 'react-router-dom'; +import { useParams } from 'react-router-dom'; import { Trans, useTranslation } from 'react-i18next'; import { useAccountComment, useSubplebbitStats } from '@plebbit/plebbit-react-hooks'; import useSubplebbitsStore from '@plebbit/plebbit-react-hooks/dist/stores/subplebbits'; @@ -22,8 +22,6 @@ const SubplebbitStats = () => { const { hiddenStats, toggleVisibility } = useSubplebbitStatsVisibilityStore(); const isHidden = hiddenStats[address]; - const location = useLocation(); - const comment = useSubplebbitsPagesStore((state) => state.comments[params?.commentCid as string]); const { deleted, locked, removed } = comment || {}; const hideStats = deleted || locked || removed; diff --git a/src/views/board/board.tsx b/src/views/board/board.tsx index 5020f77c..dc8a689b 100644 --- a/src/views/board/board.tsx +++ b/src/views/board/board.tsx @@ -143,7 +143,7 @@ const Board = ({ feedCacheKey, viewType, boardIdentifier: boardIdentifierProp, t }, [filteredComments, reset]); const subplebbit = useSubplebbit({ subplebbitAddress }); - const { createdAt, description, error, rules, shortAddress, state, suggested } = subplebbit || {}; + const { error, shortAddress, state } = subplebbit || {}; const title = isInAllView ? t('all') : isInSubscriptionsView ? t('subscriptions') : isInModView ? t('mod') : subplebbit?.title; const { blocked, unblock } = useBlock({ address: subplebbitAddress }); diff --git a/src/views/post/post.tsx b/src/views/post/post.tsx index 4850641e..fbeae30f 100644 --- a/src/views/post/post.tsx +++ b/src/views/post/post.tsx @@ -58,7 +58,7 @@ const PostPage = () => { const comment = useComment({ commentCid }); const subplebbit = useSubplebbit({ subplebbitAddress }); - const { createdAt, description, rules, shortAddress, suggested, title } = subplebbit || {}; + const { shortAddress, title } = subplebbit || {}; // if the comment is a reply, return the post comment instead, then the reply will be highlighted in the thread const postComment = useComment({ commentCid: comment?.postCid });