Sha256: 7d0e6f4b6dc4e1832b2075a1412839975377b6710ae23737b9e289968c474399

Contents?: true

Size: 1017 Bytes

Versions: 38

Compression:

Stored size: 1017 Bytes

Contents

/* eslint-disable react/no-multi-comp */

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 FileUploadCustomDescription = (props) => {
  const [filesToUpload, setFilesToUpload] = useState([]);

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

  return (
    <div>
      <AcceptedFilesList
          files={filesToUpload}
          {...props}
      />
      <FileUpload
          accept={{
            "application/pdf": [".pdf"],
            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [".xlsx"],
          }}
          acceptedFilesDescription="Adobe (.pdf) and Microsoft (.xslx)"
          onFilesAccepted={handleOnFilesAccepted}
          {...props}
      />
    </div>
  );
};

export default FileUploadCustomDescription;

Version data entries

38 entries across 38 versions & 2 rubygems

Version Path
playbook_ui_docs-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5341 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5341 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5340 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5340 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5339 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5339 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-14.12.0.pre.rc.3 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-14.12.0.pre.rc.3 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-14.12.0.pre.rc.2 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-14.12.0.pre.rc.2 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-14.12.0.pre.rc.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-14.12.0.pre.rc.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-14.12.0.pre.rc.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-14.12.0.pre.rc.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5315 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5315 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5314 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5314 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-14.10.0.pre.alpha.PLAY1750pbcontenttagkitbutton5308 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-14.10.0.pre.alpha.PLAY1750pbcontenttagkitbutton5308 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx