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