()
| 7 | |
| 8 | /** Sets various HTML meta tags, depending on the currently opened resource */ |
| 9 | export function MetaSetter(): JSX.Element { |
| 10 | const { mainColor, darkMode } = useSettings(); |
| 11 | const [subject] = useCurrentSubject(); |
| 12 | const resource = useResource(subject); |
| 13 | let title = useTitle(resource); |
| 14 | let [description] = useString(resource, properties.description); |
| 15 | const hasResource = resource.isReady(); |
| 16 | |
| 17 | title = hasResource && title ? title : 'Atomic Data'; |
| 18 | description = |
| 19 | hasResource && description |
| 20 | ? description |
| 21 | : 'The easiest way to create and share linked data.'; |
| 22 | |
| 23 | return ( |
| 24 | <Helmet> |
| 25 | <title>{title}</title> |
| 26 | <meta name='theme-color' content={darkMode ? 'black' : 'white'} /> |
| 27 | <meta name='theme-color' content={darkMode ? 'black' : 'white'} /> |
| 28 | <meta |
| 29 | name='apple-mobile-web-app-status-bar-style' |
| 30 | content={darkMode ? 'black' : 'default'} |
| 31 | /> |
| 32 | <meta name='msapplication-TileColor' content={mainColor} /> |
| 33 | <meta name='description' content={description} /> |
| 34 | <meta property='og:title' content={title} /> |
| 35 | <meta property='og:description' content={description} /> |
| 36 | <meta property='og:url' content={subject} /> |
| 37 | </Helmet> |
| 38 | ); |
| 39 | } |
nothing calls this directly
no test coverage detected