4
4
useCallback ,
5
5
useEffect ,
6
6
MouseEvent ,
7
- useRef ,
8
- MouseEventHandler
7
+ useRef
9
8
} from 'react'
10
9
11
10
import {
@@ -25,14 +24,14 @@ import {
25
24
Genre
26
25
} from '@audius/common'
27
26
import cn from 'classnames'
28
- import { push as pushRoute } from 'connected-react-router'
29
27
import { connect , useDispatch } from 'react-redux'
30
28
import { Dispatch } from 'redux'
31
29
32
30
import { ReactComponent as IconKebabHorizontal } from 'assets/img/iconKebabHorizontal.svg'
33
31
import { useModalState } from 'common/hooks/useModalState'
34
32
import { ArtistPopover } from 'components/artist/ArtistPopover'
35
33
import { Draggable } from 'components/dragndrop'
34
+ import { Link } from 'components/link'
36
35
import Menu from 'components/menu/Menu'
37
36
import { OwnProps as TrackMenuProps } from 'components/menu/TrackMenu'
38
37
import { TrackArtwork } from 'components/track/Artwork'
@@ -94,7 +93,6 @@ const ConnectedTrackTile = ({
94
93
user,
95
94
ordered,
96
95
showArtistPick,
97
- goToRoute,
98
96
togglePlay,
99
97
isBuffering,
100
98
isPlaying,
@@ -241,44 +239,19 @@ const ConnectedTrackTile = ({
241
239
)
242
240
}
243
241
244
- const onClickArtistName : MouseEventHandler = useCallback (
245
- ( e ) => {
246
- e . preventDefault ( )
247
- e . stopPropagation ( )
248
- if ( goToRoute ) goToRoute ( profilePage ( handle ) )
249
- } ,
250
- [ handle , goToRoute ]
251
- )
252
-
253
- const onClickTitle : MouseEventHandler = useCallback (
254
- ( e ) => {
255
- e . preventDefault ( )
256
- e . stopPropagation ( )
257
- if ( goToRoute ) goToRoute ( permalink )
258
- } ,
259
- [ goToRoute , permalink ]
260
- )
261
-
262
242
const renderUserName = ( ) => {
263
243
return (
264
- < div className = { styles . userName } >
265
- < ArtistPopover handle = { handle } >
266
- < a
267
- className = { cn ( styles . name , {
268
- [ styles . artistNameLink ] : onClickArtistName
269
- } ) }
270
- onClick = { onClickArtistName }
271
- href = { profilePage ( handle ) }
272
- >
273
- { name }
274
- </ a >
275
- </ ArtistPopover >
276
- < UserBadges
277
- userId = { user ?. user_id ?? 0 }
278
- badgeSize = { 14 }
279
- className = { styles . badgeWrapper }
280
- />
281
- </ div >
244
+ < ArtistPopover handle = { handle } >
245
+ < Link to = { profilePage ( handle ) } className = { styles . name } >
246
+ { name }
247
+
248
+ < UserBadges
249
+ userId = { user ?. user_id ?? 0 }
250
+ badgeSize = { 14 }
251
+ className = { styles . badgeWrapper }
252
+ />
253
+ </ Link >
254
+ </ ArtistPopover >
282
255
)
283
256
}
284
257
@@ -405,7 +378,6 @@ const ConnectedTrackTile = ({
405
378
[ styles . loading ] : loading ,
406
379
[ styles . active ] : isActive
407
380
} ) }
408
- onClickTitle = { onClickTitle }
409
381
onClickRepost = { onClickRepost }
410
382
onClickFavorite = { onClickFavorite }
411
383
onClickShare = { onClickShare }
@@ -449,7 +421,6 @@ function mapStateToProps(state: AppState, ownProps: OwnProps) {
449
421
450
422
function mapDispatchToProps ( dispatch : Dispatch ) {
451
423
return {
452
- goToRoute : ( route : string ) => dispatch ( pushRoute ( route ) ) ,
453
424
shareTrack : ( trackId : ID ) =>
454
425
dispatch (
455
426
requestOpenShareModal ( {
0 commit comments