Sha256: 6625560535397dcf1c68c4f908279457088e6fbbc08162e81509385a74b2cc0a

Contents?: true

Size: 732 Bytes

Versions: 1065

Compression:

Stored size: 732 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 = (props) => {
  const [filesToUpload, setFilesToUpload] = useState([])

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

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

export default FileUploadDefault

Version data entries

1,065 entries across 1,065 versions & 2 rubygems

Version Path
playbook_ui_docs-13.34.1.pre.alpha.play1407statvaluekitinconsistencies3388 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-13.34.1.pre.alpha.play1407statvaluekitinconsistencies3388 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-13.34.1.pre.alpha.PLAY14703378 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-13.34.1.pre.alpha.PLAY14703378 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-13.34.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-13.34.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3370 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3370 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3369 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3369 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3368 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3366 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3366 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-13.34.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-13.33.1.pre.alpha.play1407statvaluekitinconsistencies3352 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-13.33.1.pre.alpha.play1407statvaluekitinconsistencies3352 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-13.33.1.pre.alpha.PLAY14063320 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-13.33.1.pre.alpha.PLAY14063320 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui-13.33.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
playbook_ui_docs-13.33.0.pre.alpha.PBNTR405dropdownformfixesrails3311 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx