-
Notifications
You must be signed in to change notification settings - Fork 44
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
sidebar groups, close user menu on outside click #555
Conversation
Caution Review failedThe pull request is closed. WalkthroughThis update introduces two main changes. In the DropdownMenu component, a new reference ( Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant DM as DropdownMenu Component
participant DR as dropdownRef (DOM Element)
U->>DM: Click on page
DM->>DR: Check if click target is outside dropdown
alt Click is outside
DR-->>DM: Return false for containment
DM->>DM: Set dropdown open state to false (close dropdown)
else Click is inside
DR-->>DM: Element contained within dropdown
DM->>DM: Maintain current state (dropdown remains open)
end
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
frontend/src/components/LeftMenu/LeftMenu.jsx (1)
26-26
: Missing color styling for the ChecklistIconThe ChecklistIcon is missing the same styling pattern applied to other icons in the menu items.
- { text: 'Checklist', icon: <ChecklistIcon /> }, + { text: 'Checklist', icon: <ChecklistIcon style={{ color: 'var(--menu-icon-color)'}} /> },
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
frontend/src/components/DropdownMenu/DropdownMenu.jsx
(4 hunks)frontend/src/components/LeftMenu/LeftMenu.jsx
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build (22.x)
🔇 Additional comments (6)
frontend/src/components/LeftMenu/LeftMenu.jsx (2)
23-24
: Nice work on re-enabling the "SERVE A CONTENT" section and Tours route!The implementation looks clean and maintains consistent styling with the menu icon color.
27-27
: Group title for announcements looks good!The "MAKE AN ANNOUNCEMENT" title helps organize the sidebar items logically.
frontend/src/components/DropdownMenu/DropdownMenu.jsx (4)
1-1
: Good addition of required hooksThe import statement now correctly includes the necessary hooks for the outside click functionality.
12-12
: Good implementation of dropdown referenceThe useRef hook is properly used to reference the dropdown DOM element.
48-62
: Excellent implementation of outside click detection!This useEffect hook properly handles closing the dropdown when clicking outside, which aligns with the PR objective. The cleanup function correctly removes the event listener to prevent memory leaks.
65-76
: Button wrapped properly with ref connectionThe dropdown button is now correctly wrapped in a div with the ref attachment, enabling the outside click detection to work as expected.
Close user menu dropdown when click outside the dropdown
Re-enabled sidebar groups