UNPKG

eunomia-controller

Version:

18 lines (14 loc) 831 B
import React from 'react'; import Helmet from 'react-helmet'; // Boiler Plate Reduction for the i18n module.exports = (config) => { const titleDefault = `${(typeof config.title !== 'undefined') ? (typeof config.title.default !== 'undefined' ? config.title.default : '') : ''}` const titlePrefix = `${(typeof config.title !== 'undefined') ? (typeof config.title.prefix !== 'undefined' ? config.title.prefix : '') : ''}` const titleSuffix = `${(typeof config.title !== 'undefined') ? (typeof config.title.suffix !== 'undefined' ? config.title.suffix : '') : ''}` const author = `${(typeof config.author !== 'undefined') ? config.author : ''}` return ( <Helmet titleTemplate={`${titlePrefix}%s${titleSuffix}`} defaultTitle={titleDefault}> <meta name="author" content={author} /> </Helmet> ) }