Add upload-list component
This commit is contained in:
parent
70e48c49af
commit
824af6db76
23
app/components/upload-list.js
Normal file
23
app/components/upload-list.js
Normal 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)
|
||||||
@ -2,6 +2,7 @@ import Head from 'next/head'
|
|||||||
import withData from '../helpers/with-data'
|
import withData from '../helpers/with-data'
|
||||||
import SingleUploader from '../components/single-uploader'
|
import SingleUploader from '../components/single-uploader'
|
||||||
import MultiUploader from '../components/multi-uploader'
|
import MultiUploader from '../components/multi-uploader'
|
||||||
|
import UploadList from '../components/upload-list'
|
||||||
|
|
||||||
export default withData(props => (
|
export default withData(props => (
|
||||||
<div>
|
<div>
|
||||||
@ -30,5 +31,8 @@ export default withData(props => (
|
|||||||
<p>Select multiple images to upload and view the response in the console.</p>
|
<p>Select multiple images to upload and view the response in the console.</p>
|
||||||
<MultiUploader />
|
<MultiUploader />
|
||||||
</section>
|
</section>
|
||||||
|
<section>
|
||||||
|
<UploadList />
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user