@@ -16,6 +16,7 @@ import { Dispatch } from 'redux'
16
16
import { ReactComponent as IconKebabHorizontal } from 'assets/img/iconKebabHorizontal.svg'
17
17
import { ArtistPopover } from 'components/artist/ArtistPopover'
18
18
import DynamicImage from 'components/dynamic-image/DynamicImage'
19
+ import { CollectionMenuProps } from 'components/menu/CollectionMenu'
19
20
import Menu from 'components/menu/Menu'
20
21
import PerspectiveCard from 'components/perspective-card/PerspectiveCard'
21
22
import RepostFavoritesStats , {
@@ -31,7 +32,7 @@ import {
31
32
UserListEntityType
32
33
} from 'store/application/ui/userListModal/types'
33
34
import { AppState } from 'store/types'
34
- import { playlistPage , albumPage , profilePage } from 'utils/route'
35
+ import { collectionPage , profilePage } from 'utils/route'
35
36
import { withNullGuard } from 'utils/withNullGuard'
36
37
37
38
import styles from './CollectionArtCard.module.css'
@@ -84,25 +85,31 @@ const CollectionArtCard = g(
84
85
has_current_user_reposted,
85
86
has_current_user_saved,
86
87
repost_count,
87
- save_count
88
+ save_count,
89
+ permalink
88
90
} = collection
89
91
const { user_id, name, handle } = user
90
92
91
93
const [ isPerspectiveDisabled , setIsPerspectiveDisabled ] = useState ( false )
92
94
93
95
const goToCollection = useCallback ( ( ) => {
94
96
if ( isPerspectiveDisabled ) return
95
- const link = is_album
96
- ? albumPage ( handle , playlist_name , playlist_id )
97
- : playlistPage ( handle , playlist_name , playlist_id )
97
+ const link = collectionPage (
98
+ handle ,
99
+ playlist_name ,
100
+ playlist_id ,
101
+ permalink ,
102
+ is_album
103
+ )
98
104
goToRoute ( link )
99
105
} , [
100
106
is_album ,
101
107
handle ,
102
108
playlist_name ,
103
109
playlist_id ,
104
110
goToRoute ,
105
- isPerspectiveDisabled
111
+ isPerspectiveDisabled ,
112
+ permalink
106
113
] )
107
114
108
115
const goToProfile = useCallback ( ( ) => {
@@ -144,8 +151,9 @@ const CollectionArtCard = g(
144
151
isFavorited : has_current_user_saved ,
145
152
isReposted : has_current_user_reposted ,
146
153
metadata : collection ,
147
- name : playlist_name
148
- }
154
+ name : playlist_name ,
155
+ permalink : permalink || null
156
+ } as unknown as CollectionMenuProps
149
157
150
158
return (
151
159
< div className = { cn ( styles . card , className ) } >
0 commit comments