Skip to content

Commit

Permalink
Remove link in comments stats if desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Sep 8, 2023
1 parent f0dcff8 commit 39b55a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/components/chat/ChatFloatingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -82,7 +81,7 @@ export default function ChatFloatingModal() {
<div className={styles.ChatFloatingWrapper}>
<Button className={styles.ChatFloatingButton} onClick={toggleChat}>
<img src='/images/grillchat.svg' alt='GrillChat' />
<span>Comments {totalMessageCount ? `(${totalMessageCount})` : ''}</span>
<span>Comments</span>
</Button>
{!!unreadCount && <span className={styles.ChatUnreadCount}>{unreadCount}</span>}
</div>,
Expand Down
4 changes: 3 additions & 1 deletion src/components/posts/PostStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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)
Expand All @@ -38,7 +40,7 @@ export const StatsPanel = (props: StatsProps) => {
</span>
</MutedSpan>
<MutedSpan>
{nonEmptyStr(goToCommentsId) ? (
{!isLargeDesktop && nonEmptyStr(goToCommentsId) ? (
<a className='DfMutedLink' onClick={toggleCommentsSection} href={'#' + goToCommentsId}>
{comments}
</a>
Expand Down

0 comments on commit 39b55a2

Please sign in to comment.