Fix NavBar title translations

This commit is contained in:
Deluan
2020-04-27 23:22:17 -04:00
parent 069de0f9ea
commit ea1d534c29
14 changed files with 97 additions and 26 deletions
+6 -3
View File
@@ -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