Skip to content

Commit

Permalink
[QA-1277] Fix missing artist names on playlist tables (#8452)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjeffers committed May 13, 2024
1 parent 3a58a9e commit 8516ed3
Showing 1 changed file with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
CollectionsPageType,
CollectionPageTrackRecord
} from '@audius/common/store'
import { getDogEarType } from '@audius/common/utils'
import { getDogEarType, removeNullable } from '@audius/common/utils'

import { ClientOnly } from 'components/client-only/ClientOnly'
import {
Expand Down Expand Up @@ -272,30 +272,28 @@ const CollectionPage = ({
return isNftPlaylist ? CollectiblesPlaylistTable : TracksTable
}, [isNftPlaylist])

const tracksTableColumns = useMemo<
(TracksTableColumn | CollectiblesPlaylistTableColumn)[]
>(() => {
if (isNftPlaylist)
return ['playButton', 'collectibleName', 'chain', 'length', 'spacer']
// Hide play count if all tracks are premium
if (areAllTracksPremium)
return [
const tracksTableColumns = useMemo(() => {
let columns: (
| TracksTableColumn
| CollectiblesPlaylistTableColumn
| undefined
)[]

if (isNftPlaylist) {
columns = ['playButton', 'collectibleName', 'chain', 'length', 'spacer']
} else {
columns = [
'playButton',
'trackName',
isAlbum ? undefined : 'artistName',
isAlbum ? 'date' : 'addedDate',
'length',
areAllTracksPremium ? undefined : 'plays',
'reposts',
'overflowActions'
]
return [
'playButton',
'trackName',
isAlbum ? 'date' : 'addedDate',
'length',
'plays',
'reposts',
'overflowActions'
]
}
return columns.filter(removeNullable)
}, [areAllTracksPremium, isAlbum, isNftPlaylist])

const messages = getMessages(isAlbum ? 'album' : 'playlist')
Expand Down

0 comments on commit 8516ed3

Please sign in to comment.