quintodrome/ui/src/common/Title.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
473 B
JavaScript
Raw Normal View History

import React from 'react'
import { useMediaQuery } from '@material-ui/core'
2020-04-27 19:22:17 -08:00
import { useTranslate } from 'react-admin'
export const Title = ({ subTitle, args }) => {
2020-04-27 19:22:17 -08:00
const translate = useTranslate()
const isDesktop = useMediaQuery((theme) => theme.breakpoints.up('md'))
2020-04-27 19:22:17 -08:00
const text = translate(subTitle, { ...args, _: subTitle })
if (isDesktop) {
2020-04-27 19:22:17 -08:00
return <span>Navidrome {text ? ` - ${text}` : ''}</span>
}
2020-04-27 19:22:17 -08:00
return <span>{text ? text : 'Navidrome'}</span>
}