Skip to content

Conversation

@Aman8543
Copy link

@Aman8543 Aman8543 commented Dec 13, 2025

This pull request improves the responsiveness of the navigation bar and hero section, especially on small and mobile screens.

Changes made:

  • Added a mobile-friendly hamburger menu so navigation links are accessible on small screens.
  • Ensured the navbar layout scales properly without breaking the desktop view.
  • Fixed hero section text cropping issues on narrow screens by adjusting spacing and responsive typography.

These changes improve overall mobile usability and ensure a consistent experience across different screen sizes.

Fixes #49
Fixes #50

Summary by CodeRabbit

  • New Features

    • Added mobile navigation menu with hamburger toggle for improved mobile experience.
    • Enhanced active route highlighting in navigation for better clarity.
  • Style

    • Restructured hero section for improved visual hierarchy and responsive typography.
    • Refined layout spacing and margins across all breakpoints for consistent appearance.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 13, 2025

Walkthrough

The PR restructures the hero section with simplified, responsive typography to address mobile text cropping issues, and reworks the navigation component to include a collapsible mobile menu with responsive layout adjustments and a reusable NavButton component for consistency.

Changes

Cohort / File(s) Summary
Hero section restructuring
app/page.tsx
Flattened hero heading structure from deeply nested markup to a relative block with two-span layout. Removed outer container horizontal padding. Applied responsive text scaling across breakpoints. Maintained DecryptedText animations and gradient styling while adjusting spacing and line height for tighter vertical rhythm.
Navigation responsive redesign
components/navigation.tsx
Added mobile menu state management with toggle functionality. Introduced reusable NavButton component for consistent desktop navigation styling with active route highlighting. Created MobileLink component for mobile menu items. Restructured header layout with responsive padding/height, explicit logo styling, and a right-side section containing ConnectButton (hidden on small screens) and hamburger icon. Mobile menu renders conditionally when open. Updated getImagePath helper for conciseness. Removed unused Avatar imports.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • components/navigation.tsx requires careful attention to the new state management logic (mobile menu open/close), interaction between NavButton and active route detection, and the responsive breakpoint behavior across desktop/mobile views.
  • app/page.tsx JSX restructuring is straightforward but should be visually verified against mobile breakpoints (sm/md/lg) to ensure text no longer crops and responsive scaling works as expected.
  • Verify that DecryptedText animation parameters are correctly preserved in both files after restructuring.

Possibly related PRs

  • Requested changes #41: Modifies the same files (app/page.tsx and components/navigation.tsx) and related UI areas, suggesting overlapping responsive layout work.
  • Home page edits #13: Updates app/page.tsx hero and revolution sections with JSX/layout changes that may interact with this PR's hero restructuring.
  • image fix #5: Modifies app/page.tsx hero and image handling with getImagePath usage that may share refactoring patterns.

Poem

🐰 A mobile tale, now smooth and tight,
The hero text shines clear and bright,
Navigation menus dance on screen,
Responsive flows, a sight so keen,
From cramped to spacious, left to right! 📱✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'navbar herosection' is vague and generic, using non-descriptive terms that don't clearly convey the specific changes made to either component. Revise title to be more specific, such as 'Improve mobile responsiveness in navbar and hero section' to clearly indicate the main objectives.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The pull request successfully addresses both linked issues by restructuring the navigation bar with a mobile hamburger menu and fixing hero section text cropping through responsive typography and layout adjustments.
Out of Scope Changes check ✅ Passed All changes are directly scoped to improving mobile responsiveness in the navbar and hero section; no unrelated modifications or scope creep detected in the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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 (5)
components/navigation.tsx (3)

10-12: Consider removing or simplifying getImagePath helper.

The function now simply returns the path unchanged (just normalizing a leading slash). This appears to be vestigial from a previous implementation. If no path transformation is needed, consider removing it entirely and using paths directly, or add a comment explaining when this helper would be needed.


60-68: Improve hamburger button accessibility.

The button lacks state indication for screen readers and doesn't support closing the menu via keyboard (Escape key). The visual state also doesn't change when the menu is open.

Apply this diff to improve accessibility:

             {/* Hamburger */}
             <button
               onClick={() => setOpen(!open)}
               className="md:hidden flex flex-col justify-center gap-1.5 p-2"
-              aria-label="Open menu"
+              aria-label={open ? "Close menu" : "Open menu"}
+              aria-expanded={open}
             >
-              <span className="w-6 h-0.5 bg-gray-800" />
-              <span className="w-6 h-0.5 bg-gray-800" />
-              <span className="w-6 h-0.5 bg-gray-800" />
+              <span className={`w-6 h-0.5 bg-gray-800 transition-transform ${open ? 'rotate-45 translate-y-2' : ''}`} />
+              <span className={`w-6 h-0.5 bg-gray-800 transition-opacity ${open ? 'opacity-0' : ''}`} />
+              <span className={`w-6 h-0.5 bg-gray-800 transition-transform ${open ? '-rotate-45 -translate-y-2' : ''}`} />
             </button>

Additionally, consider adding an effect to close the menu on Escape key press:

useEffect(() => {
  const handleEscape = (e: KeyboardEvent) => {
    if (e.key === 'Escape') setOpen(false)
  }
  if (open) document.addEventListener('keydown', handleEscape)
  return () => document.removeEventListener('keydown', handleEscape)
}, [open])

74-92: Consider closing mobile menu on route change.

When a user navigates via MobileLink, the menu closes due to the onClick handler. However, if navigation occurs through other means (e.g., browser back/forward), the menu would remain open.

Consider adding an effect to close the menu when the pathname changes:

useEffect(() => {
  setOpen(false)
}, [pathname])
app/page.tsx (2)

219-284: Fix inconsistent indentation in hero section.

The hero section JSX has inconsistent indentation (lines 219-284 appear to have extra leading spaces compared to the surrounding code structure). This affects code readability and maintainability.

The content within <div className="space-y-6"> should be indented consistently with the rest of the file. Consider reformatting this block to match the 2-space indentation used elsewhere:

             <div className="space-y-6">
-  <div className="relative">
-    {/* Main heading with enhanced styling */}
-    <div className="relative z-10 
+              <div className="relative">
+                {/* Main heading with enhanced styling */}
+                <div className="relative z-10 
                     ...

232-241: Remove empty className props from DecryptedText components.

The className="" props are unnecessary and add noise to the code. Based on the DecryptedText component in the relevant snippets, these props are optional.

           <DecryptedText 
             text="Welcome to the On-Chain"
             animateOn="view"
             speed={75}
             maxIterations={15}
             sequential={true}
             revealDirection="start"
-            className=""
             encryptedClassName="text-amber-400/40"
           />

Apply similar changes to the other DecryptedText instances at lines 248 and 269.

Also applies to: 248-257, 269-278

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f06d428 and 1cc792c.

📒 Files selected for processing (2)
  • app/page.tsx (1 hunks)
  • components/navigation.tsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
app/page.tsx (1)
components/DecryptedText.tsx (1)
  • DecryptedText (35-239)
components/navigation.tsx (1)
components/ui/button.tsx (1)
  • Button (56-56)
🔇 Additional comments (6)
components/navigation.tsx (3)

41-51: LGTM on desktop navigation structure.

The NavButton abstraction provides clean, reusable styling with proper active state highlighting. Good use of responsive hiding with hidden md:flex.


99-122: NavButton implementation is clean.

Good separation of concerns with proper TypeScript typing. The conditional styling for active state is clear and the component is appropriately scoped as a non-exported helper.


124-142: MobileLink implementation is straightforward.

Clean implementation with proper click handler for closing the menu. The styling is consistent with the overall design system.

app/page.tsx (3)

212-212: LGTM on container adjustment.

Removing padding/margin from the root container (px-0 mx-0) allows the hero section to utilize full width appropriately.


225-259: Responsive typography addresses the hero text cropping issue.

Good implementation of responsive breakpoints (text-4xl sm:text-5xl md:text-6xl lg:text-7xl) to ensure text scales properly across screen sizes. The max-w-full break-words on the h1 element provides a fallback for edge cases.


221-223: Verify negative margin behavior on different screen sizes.

The negative top margins (-mt-16 lg:-mt-24) shift content upward. Ensure this doesn't cause content to overlap with the navigation or get clipped on various screen sizes, especially when combined with the sticky header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hero text gets cropped in narrow screens Layout is not adjusting well on Mobile screens

1 participant