Sha256: 4c62e2d8f50cb92e514c7eb90abfe1cc9f2476c4aa653bbb484fcc556aee9c39

Contents?: true

Size: 751 Bytes

Versions: 848

Compression:

Stored size: 751 Bytes

Contents

import React, { useState } from 'react'
import {
  FileUpload,
  List,
  ListItem,
} from 'playbook-ui'

const AcceptedFilesList = ({ files }) => (
  <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

848 entries across 848 versions & 2 rubygems

Version Path
playbook_ui_docs-14.11.0.pre.rc.4 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-14.11.0.pre.rc.4 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-14.11.0.pre.rc.3 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-14.11.0.pre.rc.3 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-14.10.0.pre.alpha.PBNTR662stickyrightcolumnreact5160 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-14.10.0.pre.alpha.PBNTR662stickyrightcolumnreact5160 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-14.11.0.pre.rc.2 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-14.11.0.pre.rc.2 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-14.11.0.pre.rc.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-14.11.0.pre.rc.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-14.10.0.pre.alpha.PBNTR775formmatingmaskdefaultvalue5137 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-14.10.0.pre.alpha.PBNTR775formmatingmaskdefaultvalue5137 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-14.11.0.pre.rc.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-14.11.0.pre.rc.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-14.9.0.pre.alpha.PBNTR767advancedtablemultiheadercolumns5136 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-14.9.0.pre.alpha.PBNTR767advancedtablemultiheadercolumns5136 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-14.9.0.pre.alpha.PBNTR775formmatingmaskdefaultvalue5121 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-14.9.0.pre.alpha.PBNTR775formmatingmaskdefaultvalue5121 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-14.9.0.pre.alpha.PBNTR775formmatingmaskdefaultvalue5120 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-14.9.0.pre.alpha.PBNTR775formmatingmaskdefaultvalue5120 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx