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