Sha256: a2c9832a1612eb2ebbc3431633a6ca095846266616b6e594ede5556d05dc7f32

Contents?: true

Size: 669 Bytes

Versions: 157

Compression:

Stored size: 669 Bytes

Contents

/* @flow */

import React, { useState } from 'react'
import {
  FileUpload,
  List,
  ListItem,
} from '../..'

const AcceptedFilesList = ({ files }: FileList) => (
  <List>
    {files.map((file) => (
      <ListItem key={file.name}>{file.name}</ListItem>
    ))}
  </List>
)

const FileUploadDefault = () => {
  const [filesToUpload, setFilesToUpload] = useState([])

  const handleOnFilesAccepted = (files) => {
    setFilesToUpload([...filesToUpload, ...files])
  }

  return (
    <div>
      <AcceptedFilesList files={filesToUpload} />
      <FileUpload
          onFilesAccepted={handleOnFilesAccepted}
      />
    </div>
  )
}

export default FileUploadDefault

Version data entries

157 entries across 157 versions & 1 rubygems

Version Path
playbook_ui-7.3.0.pre.alpha3 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.3.0.pre.alpha2 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.3.0.pre.alpha1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.2.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.1.2 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.1.0.pre.alpha2 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.1.1.pre.alpha1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.0.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.1.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.1.0.pre.alpha1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.1.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.0.1.pre.alpha15 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-6.8.2.pre.alpha1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.0.0.pre.alpha15 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.0.1.pre.alpha14 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.0.0.pre.alpha14 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.0.0.pre.alpha13 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.0.0.pre.alpha12 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.0.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.0.0.pre.alpha11 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx