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.11.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.11.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.11.0.pre.alpha1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.10.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.9.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.8.4 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.8.3 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.8.2 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.8.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.8.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.7.0.pre.alpha1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.7.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.6.2.pre.alpha1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.6.2 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.6.1.pre.alpha1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.6.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.6.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.5.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.5.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-7.4.2 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx