From 39b55a231b3f3880c08bcbd181ece3dc4aab282a Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Fri, 8 Sep 2023 20:27:14 +0700 Subject: [PATCH] Remove link in comments stats if desktop --- src/components/chat/ChatFloatingModal.tsx | 3 +-- src/components/posts/PostStats.tsx | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/chat/ChatFloatingModal.tsx b/src/components/chat/ChatFloatingModal.tsx index f885c21e5..b0959c24b 100644 --- a/src/components/chat/ChatFloatingModal.tsx +++ b/src/components/chat/ChatFloatingModal.tsx @@ -17,7 +17,6 @@ export default function ChatFloatingModal() { const sendEvent = useSendEvent() const [isOpen, setIsOpen] = useChatOpenState() const entity = useAppSelector(state => state.chat.entity) - const totalMessageCount = useAppSelector(state => state.chat.totalMessageCount) const [unreadCount, setUnreadCount] = useState(0) @@ -82,7 +81,7 @@ export default function ChatFloatingModal() {
{!!unreadCount && {unreadCount}}
, diff --git a/src/components/posts/PostStats.tsx b/src/components/posts/PostStats.tsx index f455c3a95..07dd7a98d 100644 --- a/src/components/posts/PostStats.tsx +++ b/src/components/posts/PostStats.tsx @@ -4,6 +4,7 @@ import { useState } from 'react' import { useSetChatOpen } from 'src/rtk/app/hooks' import { useAppSelector } from 'src/rtk/app/store' import { idToBn, PostStruct } from 'src/types' +import { useResponsiveSize } from '../responsive' import { MutedSpan } from '../utils/MutedText' import { Pluralize } from '../utils/Plularize' import { ActiveVoters, PostVoters } from '../voting/ListVoters' @@ -15,6 +16,7 @@ type StatsProps = { export const StatsPanel = (props: StatsProps) => { const { post, goToCommentsId } = props + const { isLargeDesktop } = useResponsiveSize() const setChatOpen = useSetChatOpen() const [postVotersOpen, setPostVotersOpen] = useState(false) @@ -38,7 +40,7 @@ export const StatsPanel = (props: StatsProps) => { - {nonEmptyStr(goToCommentsId) ? ( + {!isLargeDesktop && nonEmptyStr(goToCommentsId) ? ( {comments}