Add upload-list component

This commit is contained in:
Michael Merrill 2017-04-04 12:05:48 -06:00
parent 70e48c49af
commit 824af6db76
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,23 @@
import {graphql, gql} from 'react-apollo'
const UploadList = ({data: {allUploads, loading}}) => {
return (
<ul>
{allUploads.map((file) => {
return <li key={file.id}>{file.name}</li>
})}
</ul>
)
}
export default graphql(gql`
query allUploads {
allUploads {
id
name
type
size
path
}
}
`)(UploadList)

View File

@ -2,6 +2,7 @@ import Head from 'next/head'
import withData from '../helpers/with-data'
import SingleUploader from '../components/single-uploader'
import MultiUploader from '../components/multi-uploader'
import UploadList from '../components/upload-list'
export default withData(props => (
<div>
@ -30,5 +31,8 @@ export default withData(props => (
<p>Select multiple images to upload and view the response in the console.</p>
<MultiUploader />
</section>
<section>
<UploadList />
</section>
</div>
))