Page MenuHomePhabricator

[web] Convert `Modal` into functional component
ClosedPublic

Authored by jacek on Apr 8 2022, 4:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 7:18 AM
Unknown Object (File)
Fri, Dec 6, 4:49 PM
Unknown Object (File)
Tue, Dec 3, 4:45 AM
Unknown Object (File)
Nov 17 2024, 9:53 PM
Unknown Object (File)
Nov 15 2024, 6:08 AM
Unknown Object (File)
Nov 15 2024, 6:08 AM
Unknown Object (File)
Nov 14 2024, 4:36 PM
Unknown Object (File)
Nov 14 2024, 4:35 PM

Details

Summary

Convert exiting Modal component from class into functional component to simplify the logic and make future changes easier. No logic changes has been made.

Test Plan

All existing modals should work as before

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

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.

This revision is now accepted and ready to land.Apr 8 2022, 10:38 AM
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.