-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(navbar): remove NavbarMenu when closed #4506
base: canary
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: a40bc95 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughA patch has been introduced for the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
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: 0
🧹 Nitpick comments (2)
packages/components/navbar/src/navbar-menu.tsx (2)
45-46
: Consider removing the ts-expect-error.Instead of suppressing the TypeScript error, consider defining a proper type for the style object that includes the custom CSS variable.
- // @ts-expect-error - "--navbar-height": typeof height === "number" ? `${height}px` : height, + ["--navbar-height" as string]: typeof height === "number" ? `${height}px` : height,
44-51
: Consider extracting shared styles to reduce duplication.The navbar height style logic is duplicated between the animated and non-animated versions. Consider extracting it to a shared object or function.
const getNavbarStyles = (height: number | string, additionalStyles = {}) => ({ ["--navbar-height" as string]: typeof height === "number" ? `${height}px` : height, ...additionalStyles, });Also applies to: 82-89
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.changeset/nice-beds-battle.md
(1 hunks)packages/components/navbar/src/navbar-menu.tsx
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: TypeScript
- GitHub Check: Build
🔇 Additional comments (2)
packages/components/navbar/src/navbar-menu.tsx (1)
35-54
: LGTM! Clean implementation of the non-animated menu.The implementation correctly handles the disabled animation case by removing the menu from DOM when closed and using data attributes for visibility control when open.
.changeset/nice-beds-battle.md (1)
1-5
: LGTM! Clear and accurate changeset.The changeset correctly describes the patch and references the fixed issue.
Closes #4501
📝 Description
display: none
display: none
when closed⛳️ Current behavior (updates)
no actual behaviour changes
🚀 New behavior
no actual behaviour changes, console error fixed
💣 Is this a breaking change (Yes/No):
No
📝 Additional Information
Summary by CodeRabbit
NavbarMenu
component of the@nextui-org/navbar
package