eBay / nice-modal-react

A modal state manager for React.
https://ebay.github.io/nice-modal-react
MIT License
1.96k stars 109 forks source link

feat: implement radix dialog helper #113

Closed geisterfurz007 closed 9 months ago

geisterfurz007 commented 1 year ago

This implements a helper for radix dialogs, closing #84.

I've also taken creative liberty to add some missing helpers to the default export.

supnate commented 1 year ago

Thanks @geisterfurz007 , LGTM. Would you like to also add the unit test for the radix helper?

geisterfurz007 commented 1 year ago

@supnate yes, can do! Give me a couple days; my schedule is fairly busy :)

supnate commented 1 year ago

Thanks @geisterfurz007 ! No problem, take your time.

joestrkr commented 1 year ago

Thanks for the helper!

I am currently trying to figure out if there is a way to remove (instead of hide) the dialog but still keep the close animations. When I use the dialog by itself, it unmounts properly with animantion but when used together with NiceModal, I can only chose between hiding with animations or removing without animations.

geisterfurz007 commented 1 year ago

@supnate I had some time to fiddle with the tests today; they failed (oops) and while setting up the radix helper in the example for a more isolated reproduction than in my production, I failed to install the dependencies on first attempt. The yarn.lock contains references to npm.corp.ebay.com which failed to resolve for me. Two questions:

  1. Should I (next to the test) include an example implementation of the radix dialog in the example (probably yes)?
  2. To do so, I have to get rid of the "broken" entries in the lockfile; is there a better strategy than delete and regenerate? I haven't tried find and replace yet, actually but maybe you have a better suggestion all around.