Fix NavBar title translations
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
import React from 'react'
|
||||
import { useMediaQuery } from '@material-ui/core'
|
||||
import { useTranslate } from 'react-admin'
|
||||
|
||||
const Title = ({ subTitle }) => {
|
||||
const Title = ({ subTitle, args }) => {
|
||||
const translate = useTranslate()
|
||||
const isDesktop = useMediaQuery((theme) => theme.breakpoints.up('md'))
|
||||
const text = translate(subTitle, { ...args, _: subTitle })
|
||||
|
||||
if (isDesktop) {
|
||||
return <span>Navidrome {subTitle ? ` - ${subTitle}` : ''}</span>
|
||||
return <span>Navidrome {text ? ` - ${text}` : ''}</span>
|
||||
}
|
||||
return <span>{subTitle ? subTitle : 'Navidrome'}</span>
|
||||
return <span>{text ? text : 'Navidrome'}</span>
|
||||
}
|
||||
|
||||
export default Title
|
||||
|
||||
Reference in New Issue
Block a user