Added a page component.

This commit is contained in:
Jayden Seric 2017-08-21 15:14:43 +10:00
parent 6a163846f8
commit 449b64b17f
2 changed files with 29 additions and 19 deletions

25
app/components/page.js Normal file
View File

@ -0,0 +1,25 @@
import Head from 'next/head'
const Page = ({ title, children }) =>
<div>
<Head>
<title>
{title}
</title>
<style>
{`
html {
font-family: sans-serif;
color: white;
background-color: #22a699;
}
body {
margin: 2em;
}
`}
</style>
</Head>
{children}
</div>
export default Page

View File

@ -1,29 +1,14 @@
import Head from 'next/head' import Page from '../components/page'
import withData from '../helpers/with-data'
import SingleUploader from '../components/single-uploader' import SingleUploader from '../components/single-uploader'
import MultipleUploader from '../components/multiple-uploader' import MultipleUploader from '../components/multiple-uploader'
import UploadList from '../components/upload-list' import UploadList from '../components/upload-list'
import withData from '../helpers/with-data'
const HomePage = () => const HomePage = () =>
<div> <Page title="Apollo upload examples">
<Head>
<title>Apollo upload examples</title>
<style>
{`
html {
font-family: sans-serif;
color: white;
background-color: #22a699;
}
body {
margin: 2em;
}
`}
</style>
</Head>
<SingleUploader /> <SingleUploader />
<MultipleUploader /> <MultipleUploader />
<UploadList /> <UploadList />
</div> </Page>
export default withData(HomePage) export default withData(HomePage)