-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fix(navbar): prevent GitHub button from wrapping on mid-size screens #4649
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
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for asyncapi-website ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
WalkthroughThe GitHub button component now uses Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-4649--asyncapi-website.netlify.app/ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4649 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 799 799
Branches 146 146
=========================================
Hits 799 799 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 (1)
components/buttons/GithubButton.tsx (1)
2-40: twMerge usage looks good; consider scoping the left margin to navbar use onlyUsing
twMergewith the default classes first and the incomingclassNamesecond is a solid approach here: it gives the GitHub button sane defaults (flex,items-center, responsive padding,whitespace-nowrapto avoid wrapping in the navbar) while still letting consumers override spacing/layout viaclassName. This should directly help with the mid-size breakpoint wrapping issue.One minor refinement:
ml-2is now applied unconditionally, which might not be ideal ifGithubButtonis reused outside the navbar where that left margin isn’t desired. You could gate the margin oninNav(or push that concern to the navbar container) while keeping the rest of the defaults global, for example:- className={twMerge('ml-2 px-2 py-2 md:px-4 md:py-3 flex items-center whitespace-nowrap', className)} + className={twMerge( + 'px-2 py-2 md:px-4 md:py-3 flex items-center whitespace-nowrap', + inNav ? 'ml-2' : '', + className + )}Please also double-check the preview around the ~1032px width and at other breakpoints to confirm the button no longer wraps and that non-navbar usages (if any) still look correct.
Fixes #4648
Description
When the browser window width is reduced to around 1032px, the navigation bar layout breaks. Specifically, the GitHub button wraps to the next line, causing misalignment in the navbar. The UI becomes inconsistent until the screen reaches the mobile breakpoint, where the hamburger menu appears and the layout becomes stable again.
This issue affects the visual consistency of the navbar on medium-sized screens.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.