From e65e66519eaabe25fc51fe0d3883db8ea6ac6069 Mon Sep 17 00:00:00 2001 From: Dylan Audius Date: Tue, 26 May 2026 13:21:41 -0700 Subject: [PATCH] fix(web): route contest notification inbox rows to Contest page The 7 remix contest notification tiles dispatched `push(getEntityLink(entity))`, which sends the user to the Track page instead of the contest. Mirror the working pattern from RemixContestUpdateNotification and route to `contestPage(permalink)`. Co-Authored-By: Claude Opus 4.7 --- .../Notification/ArtistRemixContestEndedNotification.tsx | 5 ++--- .../ArtistRemixContestEndingSoonNotification.tsx | 4 ++-- .../ArtistRemixContestSubmissionsNotification.tsx | 4 ++-- .../Notification/FanRemixContestEndedNotification.tsx | 4 ++-- .../Notification/FanRemixContestEndingSoonNotification.tsx | 4 ++-- .../Notification/FanRemixContestStartedNotification.tsx | 4 ++-- .../FanRemixContestWinnersSelectedNotification.tsx | 4 ++-- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/packages/web/src/components/notification/Notification/ArtistRemixContestEndedNotification.tsx b/packages/web/src/components/notification/Notification/ArtistRemixContestEndedNotification.tsx index b73f634f13b..36fd3932f40 100644 --- a/packages/web/src/components/notification/Notification/ArtistRemixContestEndedNotification.tsx +++ b/packages/web/src/components/notification/Notification/ArtistRemixContestEndedNotification.tsx @@ -10,14 +10,13 @@ import { useDispatch } from 'react-redux' import { Link } from 'react-router' import { push } from 'utils/navigation' -import { pickWinnersPage } from 'utils/route' +import { contestPage, pickWinnersPage } from 'utils/route' import { NotificationBody } from './components/NotificationBody' import { NotificationFooter } from './components/NotificationFooter' import { NotificationHeader } from './components/NotificationHeader' import { NotificationTile } from './components/NotificationTile' import { NotificationTitle } from './components/NotificationTitle' -import { getEntityLink } from './utils' const messages = { title: 'Your Remix Contest Ended', @@ -48,7 +47,7 @@ export const ArtistRemixContestEndedNotification = ( const handleClick = useCallback(() => { if (entity) { - dispatch(push(getEntityLink(entity))) + dispatch(push(contestPage(entity.permalink))) } }, [entity, dispatch]) diff --git a/packages/web/src/components/notification/Notification/ArtistRemixContestEndingSoonNotification.tsx b/packages/web/src/components/notification/Notification/ArtistRemixContestEndingSoonNotification.tsx index 554e7a5ad88..fea7c7fba4a 100644 --- a/packages/web/src/components/notification/Notification/ArtistRemixContestEndingSoonNotification.tsx +++ b/packages/web/src/components/notification/Notification/ArtistRemixContestEndingSoonNotification.tsx @@ -10,13 +10,13 @@ import { useDispatch } from 'react-redux' import { TrackLink } from 'components/link' import { push } from 'utils/navigation' +import { contestPage } from 'utils/route' import { NotificationBody } from './components/NotificationBody' import { NotificationFooter } from './components/NotificationFooter' import { NotificationHeader } from './components/NotificationHeader' import { NotificationTile } from './components/NotificationTile' import { NotificationTitle } from './components/NotificationTitle' -import { getEntityLink } from './utils' const messages = { title: 'Remix Contest', @@ -40,7 +40,7 @@ export const ArtistRemixContestEndingSoonNotification = ( const handleClick = useCallback(() => { if (entity) { - dispatch(push(getEntityLink(entity))) + dispatch(push(contestPage(entity.permalink))) } }, [entity, dispatch]) diff --git a/packages/web/src/components/notification/Notification/ArtistRemixContestSubmissionsNotification.tsx b/packages/web/src/components/notification/Notification/ArtistRemixContestSubmissionsNotification.tsx index a0ebef285bf..e10d5da6732 100644 --- a/packages/web/src/components/notification/Notification/ArtistRemixContestSubmissionsNotification.tsx +++ b/packages/web/src/components/notification/Notification/ArtistRemixContestSubmissionsNotification.tsx @@ -10,13 +10,13 @@ import { useDispatch } from 'react-redux' import { TrackLink } from 'components/link' import { push } from 'utils/navigation' +import { contestPage } from 'utils/route' import { NotificationBody } from './components/NotificationBody' import { NotificationFooter } from './components/NotificationFooter' import { NotificationHeader } from './components/NotificationHeader' import { NotificationTile } from './components/NotificationTile' import { NotificationTitle } from './components/NotificationTitle' -import { getEntityLink } from './utils' const messages = { title: 'New Remix Submission!', @@ -42,7 +42,7 @@ export const ArtistRemixContestSubmissionsNotification = ({ const handleClick = useCallback(() => { if (entity) { - dispatch(push(getEntityLink(entity))) + dispatch(push(contestPage(entity.permalink))) } }, [entity, dispatch]) diff --git a/packages/web/src/components/notification/Notification/FanRemixContestEndedNotification.tsx b/packages/web/src/components/notification/Notification/FanRemixContestEndedNotification.tsx index 834b53f603a..f60368cc545 100644 --- a/packages/web/src/components/notification/Notification/FanRemixContestEndedNotification.tsx +++ b/packages/web/src/components/notification/Notification/FanRemixContestEndedNotification.tsx @@ -9,6 +9,7 @@ import { Flex, IconTrophy } from '@audius/harmony' import { useDispatch } from 'react-redux' import { push } from 'utils/navigation' +import { contestPage } from 'utils/route' import { NotificationBody } from './components/NotificationBody' import { NotificationFooter } from './components/NotificationFooter' @@ -17,7 +18,6 @@ import { NotificationTile } from './components/NotificationTile' import { NotificationTitle } from './components/NotificationTitle' import { TrackContent } from './components/TrackContent' import { UserNameLink } from './components/UserNameLink' -import { getEntityLink } from './utils' const messages = { title: 'Remix Contest', @@ -44,7 +44,7 @@ export const FanRemixContestEndedNotification = ( const handleClick = useCallback(() => { if (entity) { - dispatch(push(getEntityLink(entity))) + dispatch(push(contestPage(entity.permalink))) } }, [entity, dispatch]) diff --git a/packages/web/src/components/notification/Notification/FanRemixContestEndingSoonNotification.tsx b/packages/web/src/components/notification/Notification/FanRemixContestEndingSoonNotification.tsx index d6257557076..01d8b264b78 100644 --- a/packages/web/src/components/notification/Notification/FanRemixContestEndingSoonNotification.tsx +++ b/packages/web/src/components/notification/Notification/FanRemixContestEndingSoonNotification.tsx @@ -9,6 +9,7 @@ import { Flex, IconTrophy } from '@audius/harmony' import { useDispatch } from 'react-redux' import { push } from 'utils/navigation' +import { contestPage } from 'utils/route' import { NotificationBody } from './components/NotificationBody' import { NotificationFooter } from './components/NotificationFooter' @@ -17,7 +18,6 @@ import { NotificationTile } from './components/NotificationTile' import { NotificationTitle } from './components/NotificationTitle' import { TrackContent } from './components/TrackContent' import { UserNameLink } from './components/UserNameLink' -import { getEntityLink } from './utils' const messages = { title: 'Remix Contest', @@ -44,7 +44,7 @@ export const FanRemixContestEndingSoonNotification = ( const handleClick = useCallback(() => { if (entity) { - dispatch(push(getEntityLink(entity))) + dispatch(push(contestPage(entity.permalink))) } }, [entity, dispatch]) diff --git a/packages/web/src/components/notification/Notification/FanRemixContestStartedNotification.tsx b/packages/web/src/components/notification/Notification/FanRemixContestStartedNotification.tsx index 67556e6673f..ca3838c44ca 100644 --- a/packages/web/src/components/notification/Notification/FanRemixContestStartedNotification.tsx +++ b/packages/web/src/components/notification/Notification/FanRemixContestStartedNotification.tsx @@ -10,6 +10,7 @@ import { useDispatch } from 'react-redux' import { TrackLink } from 'components/link' import { push } from 'utils/navigation' +import { contestPage } from 'utils/route' import { NotificationBody } from './components/NotificationBody' import { NotificationFooter } from './components/NotificationFooter' @@ -18,7 +19,6 @@ import { NotificationTile } from './components/NotificationTile' import { NotificationTitle } from './components/NotificationTitle' import { TrackContent } from './components/TrackContent' import { UserNameLink } from './components/UserNameLink' -import { getEntityLink } from './utils' const messages = { title: 'New Remix Contest', @@ -46,7 +46,7 @@ export const FanRemixContestStartedNotification = ( const handleClick = useCallback(() => { if (entity) { - dispatch(push(getEntityLink(entity))) + dispatch(push(contestPage(entity.permalink))) } }, [entity, dispatch]) diff --git a/packages/web/src/components/notification/Notification/FanRemixContestWinnersSelectedNotification.tsx b/packages/web/src/components/notification/Notification/FanRemixContestWinnersSelectedNotification.tsx index 7f7ab1f5786..a16ee3e4421 100644 --- a/packages/web/src/components/notification/Notification/FanRemixContestWinnersSelectedNotification.tsx +++ b/packages/web/src/components/notification/Notification/FanRemixContestWinnersSelectedNotification.tsx @@ -9,6 +9,7 @@ import { Flex, IconTrophy } from '@audius/harmony' import { useDispatch } from 'react-redux' import { push } from 'utils/navigation' +import { contestPage } from 'utils/route' import { NotificationBody } from './components/NotificationBody' import { NotificationFooter } from './components/NotificationFooter' @@ -17,7 +18,6 @@ import { NotificationTile } from './components/NotificationTile' import { NotificationTitle } from './components/NotificationTitle' import { TrackContent } from './components/TrackContent' import { UserNameLink } from './components/UserNameLink' -import { getEntityLink } from './utils' const messages = { title: 'Remix Contest', @@ -43,7 +43,7 @@ export const FanRemixContestWinnersSelectedNotification = ( const handleClick = useCallback(() => { if (entity) { - dispatch(push(getEntityLink(entity))) + dispatch(push(contestPage(entity.permalink))) } }, [entity, dispatch])