[EP-2362] Move footer buttons to user-match-modal #1139
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The goal of this PR is to move the
.footer-buttons
buttons outside of the nested child components and into a.modal-footer
element in the DOM that is a sibling of.modal-content
. That makes it much easier to style them correctly without relying on hacks like large negative padding to align them with the edges of the modal.We can adjust the buttons' styling if needed. With the work in this PR, that should be much easier now.
Notable changes
I moved the
.modal-body
class into each of the modal components instead of having it in theregister-account-modal
.I removed the dedicated
failed-verification
state inregister-account-modal
. Now,register-account-modal
goes to the user match state if verification failed, anduser-match-modal
displays the failed verification state.The logic for the "Next" buttons is more complex now so that the parent can trigger a form submission in the child. I used the same pattern as some checkout components where the parent passes a
submitted
prop to the child that is initiallyfalse
. The child watches for changes to the prop, and the parent sets it totrue
to submit the form.