Sha256: 2f7da2c6b11517edf689a82671774e02ff9e6e9899b848af66cacff15bf89e4f

Contents?: true

Size: 775 Bytes

Versions: 944

Compression:

Stored size: 775 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 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

944 entries across 944 versions & 2 rubygems

Version Path
playbook_ui_docs-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui_docs-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx
playbook_ui-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx