Sha256: 7c629cdcab2eff1ce56343199b9eb4b96d57c310ecbb3e05eb783b0bd19674a3

Contents?: true

Size: 974 Bytes

Versions: 907

Compression:

Stored size: 974 Bytes

Contents

/* eslint-disable react/no-multi-comp */
/* @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 FileUploadCustomDescription = (props) => {
  const [filesToUpload, setFilesToUpload] = useState([]);

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

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

export default FileUploadCustomDescription;

Version data entries

907 entries across 907 versions & 2 rubygems

Version Path
playbook_ui_docs-13.34.1.pre.alpha.play1407statvaluekitinconsistencies3388 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-13.34.1.pre.alpha.play1407statvaluekitinconsistencies3388 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-13.34.1.pre.alpha.PLAY14703378 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-13.34.1.pre.alpha.PLAY14703378 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-13.34.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-13.34.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3370 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3370 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3369 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3369 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3368 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3366 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3366 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-13.34.0 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-13.33.1.pre.alpha.play1407statvaluekitinconsistencies3352 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-13.33.1.pre.alpha.play1407statvaluekitinconsistencies3352 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-13.33.1.pre.alpha.PLAY14063320 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-13.33.1.pre.alpha.PLAY14063320 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui-13.33.1 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx
playbook_ui_docs-13.33.0.pre.alpha.PBNTR405dropdownformfixesrails3311 app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx