Refactor(navbar): Use twMerge for z-index className management instead of template literal
Problem
NavBar.tsx (line 147) uses template literal for className concatenation instead of twMerge, which is the established pattern used throughout the codebase.
Current:
<div className={bg-white ${className} z-50}>
Expected: <div className={twMerge('bg-white z-50', className)}>
Issues
- Inconsistent with codebase conventions (a lot of components use
twMerge) - Hardcoded
z-50should be in base className - Template literals don't handle Tailwind class conflicts properly
Solution
Import twMerge from tailwind-merge and use it for className management, following the pattern used in Button.tsx, TOC.tsx, and other components.
Benefits
- ✅ Consistent with codebase conventions
- ✅ Proper class conflict resolution
- ✅ Better CSS organization
- ✅ Improved maintainability
- ✅ Allows proper className prop overrides
Related Files
Example of proper twMerge usage
components/buttons/Button.tsxcomponents/TOC.tsxcomponents/typography/Paragraph.tsx
Hi! @princerajpoot20 I've fixed the NavBar className issue (a small refactor) to match the codebase pattern. Let me know if this looks good and I'll open a PR! 👍
Hi @princerajpoot20 I can help in fixing this issue. Let me know if i can open a PR?
@Sam-61s Can you please watch out for other such places in the codebase where twMerge isn't used but should be used. Add all such changes in the same PR.
Is this issue open? Can i work on this
Is this issue open? Can i work on this
hey @aaryab27 I have already raised a PR and waiting for its review !!
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart: