mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
## Description Currently, when the command menu is opened using the Command+K hotkey, two modals are getting rendered. This is because the modals are mounted in two components: header and desktop-nav. Upon triggering the hotkey, both modals are rendered. ## Related Issue #1032 ## Changes Made The changes I made are in the desktop nav component. If the desktop nav receives the command menu state value and the state setter function, it will trigger only that. If not, it will trigger the state setter that is defined in the desktop nav. This way, we are preventing the modal from mounting two times. ## Testing Performed - Tested behaviour of command menu in the portal - Tested on browsers chrome, arc, safari, chrome, firefox ## Checklist - [x] I have tested these changes locally and they work as expected. - [ ] I have added/updated tests that prove the effectiveness of these changes. - [ ] I have updated the documentation to reflect these changes, if applicable. - [x] I have followed the project's coding style guidelines. - [ ] I have addressed the code review feedback from the previous submission, if applicable. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced the navigation experience by integrating command menu state management directly within the `DesktopNav` component, allowing for smoother interactions and control. - **Refactor** - Simplified the handling of the command menu by removing the `CommandMenu` component and managing its functionality within `DesktopNav`. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: David Nguyen <davidngu28@gmail.com>