mirror of
https://github.com/navidrome/navidrome.git
synced 2025-06-01 08:01:15 +03:00
Show external links on all resolutions but mobile
This commit is contained in:
parent
104679ca6e
commit
2a756eab88
@ -206,6 +206,7 @@ const Details = (props) => {
|
||||
|
||||
const AlbumDetails = (props) => {
|
||||
const record = useRecordContext(props)
|
||||
const isXsmall = useMediaQuery((theme) => theme.breakpoints.down('xs'))
|
||||
const isDesktop = useMediaQuery((theme) => theme.breakpoints.up('lg'))
|
||||
const classes = useStyles()
|
||||
const [isLightboxOpen, setLightboxOpen] = React.useState(false)
|
||||
@ -270,7 +271,7 @@ const AlbumDetails = (props) => {
|
||||
) : (
|
||||
<Typography component={'p'}>{record.genre}</Typography>
|
||||
)}
|
||||
{isDesktop && (
|
||||
{!isXsmall && (
|
||||
<Typography component={'div'} className={classes.recordMeta}>
|
||||
<AlbumExternalLinks className={classes.externalLinks} />
|
||||
</Typography>
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react'
|
||||
import { useTranslate } from 'react-admin'
|
||||
import { IconButton, Tooltip, Link, useMediaQuery } from '@material-ui/core'
|
||||
import { IconButton, Tooltip, Link } from '@material-ui/core'
|
||||
|
||||
import { ImLastfm2 } from 'react-icons/im'
|
||||
import MusicBrainz from '../icons/MusicBrainz'
|
||||
@ -21,8 +21,6 @@ const ArtistExternalLinks = ({ artistInfo, record }) => {
|
||||
links.push(`https://musicbrainz.org/artist/${artistInfo.musicBrainzId}`)
|
||||
}
|
||||
|
||||
const isDesktop = useMediaQuery((theme) => theme.breakpoints.up('sm'))
|
||||
|
||||
const addLink = (url, title, icon) => {
|
||||
const translatedTitle = translate(title)
|
||||
const link = (
|
||||
@ -38,13 +36,11 @@ const ArtistExternalLinks = ({ artistInfo, record }) => {
|
||||
linkButtons.push(<span key={`link-${record.id}-${id}`}>{link}</span>)
|
||||
}
|
||||
|
||||
isDesktop && addLink(links[0], 'message.openIn.lastfm', <ImLastfm2 />)
|
||||
|
||||
isDesktop &&
|
||||
artistInfo?.musicBrainzId &&
|
||||
addLink(links[0], 'message.openIn.lastfm', <ImLastfm2 />)
|
||||
artistInfo?.musicBrainzId &&
|
||||
addLink(links[1], 'message.openIn.musicbrainz', <MusicBrainz />)
|
||||
|
||||
return isDesktop && <div>{intersperse(linkButtons, ' ')}</div>
|
||||
return <div>{intersperse(linkButtons, ' ')}</div>
|
||||
}
|
||||
|
||||
export default ArtistExternalLinks
|
||||
|
Loading…
x
Reference in New Issue
Block a user