uptick / react-keyed-file-browser

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

Disabling Filter at top page #160

Open mikecrophones07 opened 3 years ago

mikecrophones07 commented 3 years ago

Hello, is their anyway to disble or visible=false for filter at the top of the page? Thanks for the feedback

jlo-1 commented 3 years ago

The browser specifies the filter through props and has a defaultProp set See here: https://github.com/uptick/react-keyed-file-browser/blob/master/src/browser.js#L127

If you don't wish to have the default filter you should explicitly set the prop to a function that returns null. Furthermore, if you have no other actions, the actionRenderer will render with nothing taking up excess space which may not be desired.To avoid this you could also set ActionRenderer prop to return null.

i.e

<FileBrowser
  ...
  FilterRenderer={() => null}
  ActionRenderer={() => null}
  ...
/>

Hope this helps :)

mikecrophones07 commented 3 years ago

Hi @jlo-1

thanks, the filter section is gone. another question, with regards to column headers, there are default columns: Name, Type, and Last Modified. can I customize it by specifying my own columns and values per file and folder? I saw that there's a props headerRenderer and headerRendererProps but don't know how to implement it. Can you provide samples for it. Seems like I cant find resources in creating TableHeader

Thanks hoping for your reply :)

raguiar2 commented 2 years ago

@mikecrophones07 use headerRenderer={() => null} as a prop to FileBrowser