Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QA-1277] Fix missing artist names on playlist tables #8452

Merged
merged 1 commit into from
May 13, 2024
Merged
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
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