Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EP-2362] Move footer buttons to user-match-modal #1139

Merged
merged 5 commits into from
Jan 29, 2025

Conversation

canac
Copy link
Contributor

@canac canac commented Jan 28, 2025

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 the register-account-modal.

I removed the dedicated failed-verification state in register-account-modal. Now, register-account-modal goes to the user match state if verification failed, and user-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 initially false. The child watches for changes to the prop, and the parent sets it to true to submit the form.

@canac canac requested a review from dr-bizz January 28, 2025 22:39
@canac canac self-assigned this Jan 28, 2025
Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is more complex. It took me some time to wrap my head around. Would you be able yo add more comments explaining how this works. I'm thinking about other devs reviewing this in years to come.

I wasn't able to test it, but the code looks good. I will approve to not block you

@canac canac force-pushed the 2362-okta-user-match-buttons branch from ef5f9a4 to 3948601 Compare January 29, 2025 18:49
@canac
Copy link
Contributor Author

canac commented Jan 29, 2025

@dr-bizz I added additional tests and more comments in the last two commits. Do you feel like those comments explain it well for future devs?

@canac canac force-pushed the 2362-okta-user-match-buttons branch from 2d67e08 to bc4f652 Compare January 29, 2025 19:44
@canac canac merged commit 823af36 into 2362-okta Jan 29, 2025
1 check passed
@canac canac deleted the 2362-okta-user-match-buttons branch January 29, 2025 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants