import React from 'react' import { createWrapper } from 'unistack/unihelpers.js' const PageNotFound = ({ title }) => { title(<title>404!</title>) return ( <div> {"...And I still haven't found what I'm looking for..."} </div> ) } export default createWrapper(PageNotFound)
import React from 'react' import PageInfo from '../containers/page-info.js' import { createPage } from 'unistack/unihelpers.js' const Index = ({ title }) => { // Update the page's meta properties. For example, title: title(<title>Welcome to the index page!</title>) return [PageInfo] } export default createPage(Index)
// Use this to wrap your route components with other components that is common // to all pages const Layout = ({ baseTitle, scripts, children }) => { baseTitle(<title>App: %s</title>) if (environment === 'production') { scripts([ <script src="/dist/js/hello-world.js"/>, <script src="/dist/js/hello-world-2.js"/> ]) } return ( <div> <header> Links: {' '} <Link to="/">Home</Link> {' '} <Link to="/about">About</Link> {' '} <Link to="/non-existent">Unknown</Link> </header> {children} </div> ) } export default createWrapper(Layout)