Skip to content

Commit

Permalink
Add text link for track tile genre and mood info (#8811)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Shanks authored Jun 13, 2024
1 parent 1169d86 commit edff98f
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions packages/web/src/components/track/GiantTrackTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import { Mood } from '@audius/sdk'
import cn from 'classnames'
import dayjs from 'dayjs'
import { useDispatch, shallowEqual, useSelector } from 'react-redux'
import { generatePath } from 'react-router-dom'

import { TextLink, UserLink } from 'components/link'
import Menu from 'components/menu/Menu'
Expand All @@ -58,6 +59,7 @@ import { ComponentPlacement } from 'components/types'
import { UserGeneratedText } from 'components/user-generated-text'
import { getFeatureEnabled } from 'services/remote-config/featureFlagHelpers'
import { moodMap } from 'utils/Moods'
import { SEARCH_PAGE } from 'utils/route'
import { trpc } from 'utils/trpcClientWeb'

import { AiTrackSection } from './AiTrackSection'
Expand Down Expand Up @@ -367,7 +369,16 @@ export const GiantTrackTile = ({
mood && (
<InfoLabel
labelName='mood'
labelValue={mood in moodMap ? moodMap[mood as Mood] : mood}
labelValue={
<TextLink
to={{
pathname: generatePath(SEARCH_PAGE, { category: 'tracks' }),
search: new URLSearchParams({ mood }).toString()
}}
>
{mood in moodMap ? moodMap[mood as Mood] : mood}
</TextLink>
}
/>
)
)
Expand All @@ -378,7 +389,19 @@ export const GiantTrackTile = ({

return (
shouldShow && (
<InfoLabel labelName='genre' labelValue={getCanonicalName(genre)} />
<InfoLabel
labelName='genre'
labelValue={
<TextLink
to={{
pathname: generatePath(SEARCH_PAGE, { category: 'tracks' }),
search: new URLSearchParams({ genre }).toString()
}}
>
{getCanonicalName(genre)}
</TextLink>
}
/>
)
)
}
Expand Down

0 comments on commit edff98f

Please sign in to comment.