import Head from 'next/head'; import Router from 'next/router'; import NProgress from 'nprogress'; import { node, string } from 'prop-types'; Router.onRouteChangeStart = () => NProgress.start(); Router.onRouteChangeComplete = () => NProgress.done(); Router.onRouteChangeError = () => NProgress.done(); const Page = ({ children, pageTitle }) => (
{ `@romuloalves${pageTitle ? ` – ${pageTitle}` : ''}` } { children }
); Page.propTypes = { children: node.isRequired, pageTitle: string }; Page.defaultProps = { pageTitle: '' }; export default Page;