Sha256: 5a3618fb3dc6e45d19ebc697d9d83c234c6573e82498768c0d0aef9deb89b320

Contents?: true

Size: 791 Bytes

Versions: 824

Compression:

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

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

  return (
    <div>
      <AcceptedFilesList
          files={filesToUpload}
          {...props}
      />
      <FileUpload
          customMessage="Playbook is awesome!"
          onFilesAccepted={handleOnFilesAccepted}
          {...props}
      />
    </div>
  )
}

export default FileUploadCustomMessage

Version data entries

824 entries across 824 versions & 2 rubygems

Version Path
playbook_ui_docs-13.30.0.pre.alpha.PBNTR353draggablev53136 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-13.30.0.pre.alpha.PBNTR353draggablev53136 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-13.30.0.pre.alpha.PLAY1328fixtimelinekitglobalpropsreact3096 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-13.30.0.pre.alpha.PLAY1328fixtimelinekitglobalpropsreact3096 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-13.30.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-13.29.0.pre.alpha.removeduplicatekitexampleclass3063 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-13.29.0.pre.alpha.removeduplicatekitexampleclass3063 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-13.29.0.pre.alpha.PBNTR329draggablev33060 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-13.29.0.pre.alpha.PBNTR329draggablev33060 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-13.29.0.pre.alpha.PBNTR329draggablev33059 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-13.29.0.pre.alpha.PBNTR329draggablev33059 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-13.29.0.pre.alpha.testingcollapsibleissue3052 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-13.29.0.pre.alpha.testingcollapsibleissue3052 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-13.29.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-13.28.0.pre.alpha.PBNTR297gradientoverlay3029 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-13.28.0.pre.alpha.PBNTR297gradientoverlay3029 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-13.28.0.pre.alpha.pbntr312tableheaderflexremoval3019 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-13.28.0.pre.alpha.pbntr312tableheaderflexremoval3019 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-13.28.0.pre.alpha.dialogturbostreameventlistener3017 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-13.28.0.pre.alpha.dialogturbostreameventlistener3017 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx