xh / hoist-react

🏗️ ⚛️ The XH Hoist toolkit for React
https://xh.io
Apache License 2.0
24 stars 9 forks source link

Review / simplify `FileChooser` based on real-world usage #3527

Open amcclain opened 10 months ago

amcclain commented 10 months ago

Expanding ticket to more general review of this comp and the various apps where we decided not to use it and had to roll our own.


The FileChooser component accepts a targetText prop, but always shows its own text when actively hovering over the target. It does not provide any control over the text displayed when a drop is rejected.

https://github.com/xh/hoist-react/blob/9538b51b8e8e8c23755d4ee9b215504a2b80f2a5/desktop/cmp/filechooser/FileChooser.ts#L93

We have a usage in a client app where we are showing the target in a tightly-managed layout and want the ability to customize both.

amcclain commented 10 months ago

I'd propose the following mildly-breaking (but not in a bad way) API changes:

leogretz2 commented 10 months ago

https://github.com/react-dropzone/react-dropzone/issues/752 points to adding reasons for file rejection in the FileRejection object that onDrop and onDropRejected (of React Dropzone) take in react-dropzone version 11.0.0.