Sha256: a8af3d38ebeb647cc019811cbf7f5035d2cf0caa49286e0854cf0857b623b57f

Contents?: true

Size: 767 Bytes

Versions: 1065

Compression:

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

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

  return (
    <div>
      <AcceptedFilesList
          files={filesToUpload}
          {...props}
      />
      <FileUpload
          accept={['image/svg+xml']}
          onFilesAccepted={handleOnFilesAccepted}
          {...props}
      />
    </div>
  )
}

export default FileUploadAccept

Version data entries

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

Version Path
playbook_ui_docs-13.25.0.pre.alpha.PLAY1249fixTooltipswrappingformelementscausingmisalignment2785 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.25.0.pre.alpha.PLAY1249fixTooltipswrappingformelementscausingmisalignment2785 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.25.0.pre.alpha.PLAY1249fixTooltipswrappingformelementscausingmisalignment2783 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.25.0.pre.alpha.PLAY1249fixTooltipswrappingformelementscausingmisalignment2783 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.25.0.pre.alpha.PBNTR272Dropdownkitv42769 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.25.0.pre.alpha.PBNTR272Dropdownkitv42769 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.25.0.pre.alpha.barchartfix2766 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.25.0.pre.alpha.barchartfix2766 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.25.0.pre.alpha.PLAY761globalpaddingpropsbuttons2713 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.25.0.pre.alpha.PLAY761globalpaddingpropsbuttons2713 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.25.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.25.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.24.0.pre.alpha.play1305drycontenttag2689 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.24.0.pre.alpha.play1305drycontenttag2689 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.24.0.pre.alpha.PBNTR261NewKitDropdown2681 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.24.0.pre.alpha.PBNTR261NewKitDropdown2681 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.24.0.pre.alpha.PLAY1181circleiconkitfixsizingerrorglobalspacingprops2675 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.24.0.pre.alpha.PLAY1181circleiconkitfixsizingerrorglobalspacingprops2675 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.24.0.pre.alpha.PLAY998backgroundkitremoveemptyinlinline2666 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.24.0.pre.alpha.PLAY998backgroundkitremoveemptyinlinline2666 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx