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 introduces several updates to the
ContextMenu
component, including the addition of aSubMenu
feature and various enhancements to the existing functionality. The changes span multiple files, with significant updates to the component structure, utility functions, and styles.New Feature: SubMenu
src/components/SubMenu.tsx
: Added a newSubMenu
component to support nested menu items. This includes logic for positioning and visibility management.app/components/App.tsx
: Integrated the newSubMenu
component within theContextMenu
structure.Component Enhancements
src/components/ContextMenu.tsx
: Updated theContextMenu
component to include theSubMenu
and adjusted the positioning validation function. [1] [2] [3] [4]src/components/MenuItem.tsx
: Ensured theMenuItem
component resets its state after an animation ends.Utility and Style Updates
src/utils.ts
: Renamed thevalidateWindowPosition
function tovalidateMenuPosition
and updated thecloneChildren
function to handle optional props. [1] [2]src/styles.css
: Added styles for theSubMenu
component, including positioning and hover effects. Adjusted existing styles for better integration with the new submenu feature. [1] [2] [3] [4]Export Updates
src/components/index.ts
: Exported the newSubMenu
component.src/index.ts
: IncludedSubMenu
in the main export list.