mirror of
https://github.com/navidrome/navidrome.git
synced 2025-05-15 17:46:40 +03:00
Fix artist link contrast in light theme
This commit is contained in:
parent
87cc397bc3
commit
79454d7a92
@ -7,7 +7,7 @@ import { linkToRecord, Loading } from 'react-admin'
|
|||||||
import subsonic from '../subsonic'
|
import subsonic from '../subsonic'
|
||||||
import { ArtistLinkField } from './ArtistLinkField'
|
import { ArtistLinkField } from './ArtistLinkField'
|
||||||
|
|
||||||
const useStyles = makeStyles({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
margin: '20px',
|
margin: '20px',
|
||||||
},
|
},
|
||||||
@ -23,7 +23,7 @@ const useStyles = makeStyles({
|
|||||||
tileBar: {
|
tileBar: {
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
background:
|
background:
|
||||||
'linear-gradient(to top, rgba(0,0,0,0.8) 0%,rgba(0,0,0,0.4) 70%,rgba(0,0,0,0) 100%)',
|
'linear-gradient(to top, rgba(0,0,0,1) 0%,rgba(0,0,0,0.4) 70%,rgba(0,0,0,0) 100%)',
|
||||||
},
|
},
|
||||||
albumArtistName: {
|
albumArtistName: {
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
@ -32,7 +32,10 @@ const useStyles = makeStyles({
|
|||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
fontSize: '1em',
|
fontSize: '1em',
|
||||||
},
|
},
|
||||||
})
|
artistLink: {
|
||||||
|
color: theme.palette.primary.light,
|
||||||
|
},
|
||||||
|
}))
|
||||||
|
|
||||||
const getColsForWidth = (width) => {
|
const getColsForWidth = (width) => {
|
||||||
if (width === 'xs') return 2
|
if (width === 'xs') return 2
|
||||||
@ -69,7 +72,10 @@ const LoadedAlbumGrid = ({ ids, data, basePath, width }) => {
|
|||||||
title={data[id].name}
|
title={data[id].name}
|
||||||
subtitle={
|
subtitle={
|
||||||
<div className={classes.albumArtistName}>
|
<div className={classes.albumArtistName}>
|
||||||
<ArtistLinkField record={data[id]}>
|
<ArtistLinkField
|
||||||
|
record={data[id]}
|
||||||
|
className={classes.artistLink}
|
||||||
|
>
|
||||||
{data[id].albumArtist}
|
{data[id].albumArtist}
|
||||||
</ArtistLinkField>
|
</ArtistLinkField>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,18 +1,24 @@
|
|||||||
import { Link } from 'react-admin'
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
import { Link } from 'react-admin'
|
||||||
|
|
||||||
export const ArtistLinkField = (props) => {
|
export const ArtistLinkField = ({ record, className }) => {
|
||||||
const filter = { artist_id: props.record.albumArtistId }
|
const filter = { artist_id: record.albumArtistId }
|
||||||
const url = `/album?filter=${JSON.stringify(
|
const url = `/album?filter=${JSON.stringify(
|
||||||
filter
|
filter
|
||||||
)}&order=ASC&sort=maxYear&displayedFilters={"compilation":true}`
|
)}&order=ASC&sort=maxYear&displayedFilters={"compilation":true}`
|
||||||
return (
|
return (
|
||||||
<Link to={url} onClick={(e) => e.stopPropagation()}>
|
<Link to={url} onClick={(e) => e.stopPropagation()} className={className}>
|
||||||
{props.record.albumArtist}
|
{record.albumArtist}
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ArtistLinkField.propTypes = {
|
||||||
|
className: PropTypes.string,
|
||||||
|
source: PropTypes.string,
|
||||||
|
}
|
||||||
|
|
||||||
ArtistLinkField.defaultProps = {
|
ArtistLinkField.defaultProps = {
|
||||||
source: 'artistId',
|
source: 'artistId',
|
||||||
addLabel: true,
|
addLabel: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user