Skip to content

Commit afb5ac3

Browse files
committed
fix(user): better urls
1 parent 59aa23f commit afb5ac3

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

next.config.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,23 @@ module.exports = withBundleAnalyzer({
104104
},
105105
{
106106
source: '/:id/listeningClocks',
107-
destination: '/user/:id/listeningClocks',
107+
destination: '/user/:id/listening-clocks',
108+
},
109+
{
110+
source: '/:id/listening-clocks',
111+
destination: '/user/:id/listening-locks',
108112
},
109113
{
110114
source: '/:id/genres',
111115
destination: '/user/:id/genres',
112116
},
113117
{
114118
source: '/:id/recentStreams',
115-
destination: '/user/:id/recentStreams',
119+
destination: '/user/:id/recent-streams',
120+
},
121+
{
122+
source: '/:id/recent-streams',
123+
destination: '/user/:id/recent-streams',
116124
},
117125
];
118126
},

src/pages/user/[id]/[[...deeplink]].tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ function activeScrollIntoViewFromDeepLink(
6666
id !== 'tracks' &&
6767
id !== 'albums' &&
6868
id !== 'artists' &&
69-
id !== 'listeningClocks' &&
70-
id !== 'recentStreams'
69+
id !== 'listening-clocks' &&
70+
id !== 'recent-streams'
7171
)
7272
return null;
7373

@@ -286,8 +286,8 @@ const User: NextPage<Props> = ({
286286
albums: topAlbumsRef,
287287
artists: topArtistsRef,
288288
genres: topGenresRef,
289-
listeningClocks: listeningClocksRef,
290-
recentStreams: recentStreamsRef,
289+
'listening-clocks': listeningClocksRef,
290+
'recent-streams': recentStreamsRef,
291291
};
292292

293293
if (scrollIntoView) refs[scrollIntoView].current?.scrollIntoView();

src/utils/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ export type UserScrollIntoView =
88
| 'tracks'
99
| 'albums'
1010
| 'artists'
11-
| 'listeningClocks'
12-
| 'recentStreams';
11+
| 'listening-clocks'
12+
| 'recent-streams';

0 commit comments

Comments
 (0)