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.23.0.pre.alpha.PLAY1284investigation2657 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.23.0.pre.alpha.PLAY1284investigation2657 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.24.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.24.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.22.0.pre.alpha.pbntr254barchartnegativenumber2640 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.22.0.pre.alpha.pbntr254barchartnegativenumber2640 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.22.0.pre.alpha.PLAY1297updatetextstyles2636 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.22.0.pre.alpha.PLAY1297updatetextstyles2636 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.22.0.pre.alpha.playbookgemspecrailsversion2608 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.22.0.pre.alpha.playbookgemspecrailsversion2608 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.23.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.23.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.21.0.pre.alpha.PLAY12582531 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.21.0.pre.alpha.PLAY12582531 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.21.0.pre.alpha.PLAY12582516 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.21.0.pre.alpha.PLAY12582516 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.21.0.pre.alpha.PLAY12582515 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.21.0.pre.alpha.PLAY12582515 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui_docs-13.21.0.pre.alpha.PLAY12582514 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx
playbook_ui-13.21.0.pre.alpha.PLAY12582514 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx