Convert exiting Modal component from class into functional component to simplify the logic and make future changes easier. No logic changes has been made.
Details
Details
All existing modals should work as before
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Looks good!
web/modals/modal.react.js | ||
---|---|---|
18 ↗ | (On Diff #11224) | Setting the default when destructuring looks a lot cleaner than the old defaultProps approach. |
32 ↗ | (On Diff #11224) | Outside of the scope of this diff, but might be good to add a comment noting that keyCode 27 corresponds to the ESC key? I had a hunch, but still had to google to double check. |
web/modals/modal.react.js | ||
---|---|---|
32 ↗ | (On Diff #11224) | Good idea. I was thinking about adding the comment (as I also had to use https://keycode.info/ to check), but I forgot about it. |