Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/common/src/messages/comments.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,6 +30,7 @@ export const commentsMessages = {
'You haven’t muted any users. Once you do, they will appear here.',
seeMore: 'See More',
seeLess: 'See Less',
newComments: 'New Comments!',

// Overflow Menu Actions
menuActions: {
Expand Down
22 changes: 17 additions & 5 deletions packages/mobile/src/components/comments/CommentDrawerHeader.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,8 @@ import {
IconButton,
IconCloseAlt,
IconKebabHorizontal,
IconRefresh,
PlainButton,
Text
} from '@audius/harmony-native'
import { useToast } from 'app/hooks/useToast'
Expand All@@ -32,7 +34,7 @@ export const CommentDrawerHeader = (props: CommentDrawerHeaderProps) => {
const { bottomSheetModalRef, minimal = false } = props
const { toast } = useToast()

const { commentCount, currentUserId, artistId, entityId } =
const { commentCount, currentUserId, artistId, entityId, reset } =
useCurrentCommentSection()
const isOwner = currentUserId === artistId
const isMuted = useGetTrackCommentNotificationSetting(entityId)
Expand DownExpand Up@@ -67,10 +69,20 @@ export const CommentDrawerHeader = (props: CommentDrawerHeaderProps) => {
justifyContent='space-between'
alignItems='center'
>
<Text variant='body' size={minimal ? 'l' : 'm'}>
{messages.title}
<Text color='subdued'>&nbsp;({commentCount})</Text>
</Text>
<Flex direction='row' gap='m' alignItems='center'>
<Text variant='body' size={minimal ? 'l' : 'm'}>
{messages.title}
<Text color='subdued'>&nbsp;({commentCount})</Text>
</Text>

<PlainButton
iconLeft={IconRefresh}
variant='subdued'
onPress={() => reset(true)}
>
{messages.newComments}
</PlainButton>
</Flex>
<IconButton
icon={isOwner ? IconKebabHorizontal : IconCloseAlt}
onPress={
Expand Down
21 changes: 17 additions & 4 deletions packages/web/src/components/comments/CommentHeader.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,8 @@ import {
Flex,
IconButton,
IconKebabHorizontal,
IconRefresh,
PlainButton,
PopupMenu,
PopupMenuItem,
Text
Expand All@@ -25,7 +27,8 @@ type CommentHeaderProps = {
export const CommentHeader = (props: CommentHeaderProps) => {
const { isLoading } = props
const { toast } = useContext(ToastContext)
const { isEntityOwner, commentCount, entityId } = useCurrentCommentSection()
const { isEntityOwner, commentCount, entityId, reset } =
useCurrentCommentSection()
const isMuted = useGetTrackCommentNotificationSetting(entityId)
const [updateTrackCommentNotificationSetting] =
useUpdateTrackCommentNotificationSetting(entityId)
Expand All@@ -51,9 +54,19 @@ export const CommentHeader = (props: CommentHeaderProps) => {

return (
<Flex justifyContent='space-between' w='100%'>
<Text variant='title' size='l'>
Comments ({!isLoading ? commentCount : '...'})
</Text>
<Flex alignItems='center' gap='s'>
<Text variant='title' size='l'>
Comments ({!isLoading ? commentCount : '...'})
</Text>

<PlainButton
iconLeft={IconRefresh}
variant='subdued'
onClick={() => reset(true)}
>
{messages.newComments}
</PlainButton>
</Flex>
{isEntityOwner && !isLoading ? (
<PopupMenu
items={popupMenuItems}
Expand Down
17 changes: 1 addition & 16 deletions packages/web/src/components/comments/CommentSectionDesktop.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,14 +3,7 @@ import { useEffect, useState } from 'react'
import { useCurrentCommentSection } from '@audius/common/context'
import { useFeatureFlag } from '@audius/common/hooks'
import { FeatureFlags } from '@audius/common/services'
import {
Button,
Divider,
Flex,
LoadingSpinner,
Paper,
Skeleton
} from '@audius/harmony'
import { Divider, Flex, LoadingSpinner, Paper, Skeleton } from '@audius/harmony'
import InfiniteScroll from 'react-infinite-scroller'
import { useSearchParams } from 'react-router-dom-v5-compat'

Expand DownExpand Up@@ -70,7 +63,6 @@ export const CommentSectionDesktop = (props: CommentSectionDesktopProps) => {
commentIds,
commentSectionLoading,
isLoadingMorePages,
reset,
hasMorePages,
loadMorePages
} = useCurrentCommentSection()
Expand DownExpand Up@@ -117,13 +109,6 @@ export const CommentSectionDesktop = (props: CommentSectionDesktopProps) => {
ref={commentSectionRef}
>
<CommentHeader />
<Button
onClick={() => {
reset(true)
}}
>
Refresh{' '}
</Button>
<Paper w='100%' direction='column'>
{commentPostAllowed ? (
<>
Expand Down