Add link to all artist's albums from an album

This commit is contained in:
Deluan
2020-04-03 20:51:15 -04:00
parent 3b6d0b3d15
commit 096ed396c8
2 changed files with 21 additions and 1 deletions
+19
View File
@@ -0,0 +1,19 @@
import { Link } from 'react-admin'
import React from 'react'
export const ArtistLinkField = (props) => {
const filter = { artist_id: props.record.albumArtistId }
const url = `/album?filter=${JSON.stringify(
filter
)}&order=ASC&sort=maxYear&displayedFilters={"compilation":true}`
return (
<Link to={url} onClick={(e) => e.stopPropagation()}>
{props.record.albumArtist}
</Link>
)
}
ArtistLinkField.defaultProps = {
source: 'artistId',
addLabel: true
}