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.
This pull request refactors how modals are rendered and managed in the user invitation settings components for campaigns, projects, and workspaces. The main improvement is the introduction of an
appendNodemechanism, allowing modals (such as user removal confirmations) to be appended to a specific DOM node, improving modal placement and behavior. This change is consistently applied across related components and their usages.Modal rendering and placement improvements:
appendNodestate and asetModalNodecallback incampaignSettings.tsx,projectSettings.tsx, andworkspaceSettings.tsxto track and set the DOM node where modals should be appended. TheModalcomponent is now given arefto this callback to capture its node. [1] [2] [3] [4] [5] [6]UserItemcomponent to accept an optionalappendNodeprop, which is passed down to theRemoveConfirmModalfor correct modal placement. [1] [2]RemoveConfirmModalto accept anappendToNodeprop and forward it to the underlyingModalcomponent, ensuring the modal is rendered in the correct DOM location.Consistent prop passing and usage:
appendNodeprop from parent settings components (campaignSettings.tsx,projectSettings.tsx,workspaceSettings.tsx) to everyUserIteminstance, ensuring all user-related modals use the new placement logic. [1] [2] [3] [4]General code improvements:
useCallbackwhere needed to optimize thesetModalNodecallback and prevent unnecessary re-renders. [1] [2] [3]These changes make modal management more flexible and robust, especially in complex UI hierarchies.