uptick / react-keyed-file-browser

Folder based file browser given a flat keyed list of objects, powered by React.
MIT License
307 stars 145 forks source link

Allow icons to be set by type of file #38

Open marpontes opened 5 years ago

marpontes commented 5 years ago

It would very nice to be able to define icons by type of file like so:

<FileBrowser
  ... 
  iconsByType={{
    txt: <i ... />,
    csv: <i ... />,
    pdf: <i ... />,
    exdef: <i ... />,
    default: <i ... />,
    folder:  <i ... />,
  }}
  icons={{
      Rename: <i className="i-cursor" aria-hidden="true" />,
      Folder: <i className="folder" aria-hidden="true" />,
      FolderOpen: <i className="folder-open" aria-hidden="true" />,
      Delete: <i className="trash" aria-hidden="true" />,
      Loading: <i className="circle-notch spin" aria-hidden="true" />,
  }}
/>

The icons prop could be kept for specific mappings.

tabby-or-not commented 5 years ago

Nice idea 👍