New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor confirm modal #3876
Refactor confirm modal #3876
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
5676480
to
2deddae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. Some missed low-hanging fruits in the refactoring of the AttendanceModal but overall super clean. This pattern is a lot better than the old HOCs 馃挴
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks better! 馃挴
Our modals have been a mess for a long time, so this was much needed!!
173bcc7
to
2c9b7f9
Compare
2c9b7f9
to
16a59f6
Compare
Description
Replaces the
ConfirmModalWithParent
-component which used a lot of confusing higher-order-component trickery with a simpler functional component. The refactored component uses the Function as Child Component pattern to pass aopenConfirmModal
-function to the children, allowing f.ex. a button to open the modal. This makes for way more readable code imo.Also rewrote the modal logic from class-component to function with hooks.
Aaand I also did the same thing for
AttendanceModal
Result
No visual or functional changes, just cleaner code 馃Ъ
Testing
I have tested multiple confirm modals to ensure no changes in behaviour. I have also double-checked that I set the onClick correctly in all the usages of the new component.
Resolves ... (either GitHub issue or Linear task)