Add link to artist's albums on the album cover

This commit is contained in:
Deluan
2020-04-25 09:47:56 -04:00
parent 177ace1cee
commit 56ea380bb3
+7 -5
View File
@@ -3,11 +3,11 @@ import { GridList, GridListTile, GridListTileBar } from '@material-ui/core'
import { makeStyles } from '@material-ui/core/styles' import { makeStyles } from '@material-ui/core/styles'
import withWidth from '@material-ui/core/withWidth' import withWidth from '@material-ui/core/withWidth'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import { linkToRecord } from 'ra-core' import { linkToRecord, Loading } from 'react-admin'
import { Loading } from 'react-admin'
import subsonic from '../subsonic' import subsonic from '../subsonic'
import { ArtistLinkField } from './ArtistLinkField'
const useStyles = makeStyles((theme) => ({ const useStyles = makeStyles({
root: { root: {
margin: '20px', margin: '20px',
}, },
@@ -32,7 +32,7 @@ const useStyles = makeStyles((theme) => ({
textAlign: 'center', textAlign: 'center',
fontSize: '1em', fontSize: '1em',
}, },
})) })
const getColsForWidth = (width) => { const getColsForWidth = (width) => {
if (width === 'xs') return 2 if (width === 'xs') return 2
@@ -69,7 +69,9 @@ const LoadedAlbumGrid = ({ ids, data, basePath, width }) => {
title={data[id].name} title={data[id].name}
subtitle={ subtitle={
<div className={classes.albumArtistName}> <div className={classes.albumArtistName}>
{data[id].albumArtist} <ArtistLinkField record={data[id]}>
{data[id].albumArtist}
</ArtistLinkField>
</div> </div>
} }
/> />