Skip to content

Fix issue #50 Make navbar functional - #51

Open
DeveloperAmrit wants to merge 3 commits into
DjedAlliance:mainfrom
DeveloperAmrit:amrit-branch
Open

Fix issue #50 Make navbar functional #51
DeveloperAmrit wants to merge 3 commits into
DjedAlliance:mainfrom
DeveloperAmrit:amrit-branch

Conversation

@DeveloperAmrit

@DeveloperAmrit DeveloperAmrit commented Dec 28, 2025

Copy link
Copy Markdown
Member

Fixes #50 and Fixes #49 and Fixes #4

Summary by CodeRabbit

  • New Features

    • Added stable in-page anchors and smooth-scroll navigation to jump to major sections.
    • Upgraded the logo ticker to display partner logos, loop seamlessly, and run with quicker animation.
  • Style

    • Enhanced button visuals with refined gradient, hover/active transitions, and subtle scaling for improved interactivity.

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

	modified:   src/sections/CallToAction.tsx
	modified:   src/sections/Features.tsx
	modified:   src/sections/Header.tsx
@coderabbitai

coderabbitai Bot commented Dec 28, 2025

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Added stable DOM ids to Features and CallToAction sections, a smooth-scrolling click handler wired in Header for in-page navigation, interactive hover/active styling on Button, and a LogoTicker update that adds logos and adjusts looping/animation timing. No exported/public API changes.

Changes

Cohort / File(s) Summary
Scroll target anchors
src/sections/CallToAction.tsx, src/sections/Features.tsx
Added id="developer-guide" and id="features" to root section elements to expose stable in-page anchors. No behavior/state changes beyond DOM ids.
Navigation scroll handler
src/sections/Header.tsx
Added handleScroll helper; replaced static anchor hrefs with #features and #developer-guide and attached onClick handlers that call preventDefault() and smoothly scroll targets into view.
Button interactive styles
src/components/Button.tsx
Added hover/active gradient, transition and scale classes for interactive visual feedback. No logic or signature changes.
Logo ticker & assets
src/sections/LogoTicker.tsx, src/assets/*
Introduced logo imports and Image usage; ticker items now include logo, rendering uses doubled array for seamless loop; animation timing and translateX changed (duration reduced, translate changed from -100% to -50%).

Sequence Diagram(s)

(Skipped — changes are small UI additions and do not introduce complex multi-component control flows warranting a sequence diagram.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • Tanya-ruby

Poem

🐰 I hop to an id with a gentle glide,
Buttons shimmer as I prance and guide,
Logos spin in a looping tune,
Smooth-scroll paths beneath the moon,
A tiny rabbit cheers — hop, review, and smile! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Changes include in-scope navbar scrolling, button hover effects, and section IDs. The LogoTicker updates with new assets and animation adjustments are not mentioned in linked issues but appear to be unrelated enhancements. The LogoTicker.tsx changes (logo assets, doubled rendering, animation timing adjustments) are out of scope for issues #50 and #49; consider moving them to a separate PR or document their necessity.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly addresses the main objective of issue #50 to make the navbar functional, clearly summarizing the primary purpose of the pull request.
Linked Issues check ✅ Passed The PR implements all coding requirements: navbar scroll functionality for Features and CallToAction sections [#50], and button hover styling with visual effects [#49].
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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)
src/sections/Header.tsx (2)

25-30: Consider extracting the id from href to reduce duplication.

The current implementation passes the id both in the href attribute and as a parameter to handleScroll. You could extract it from the href instead.

🔎 Proposed refactor to eliminate duplication
-  const handleScroll = (e: React.MouseEvent<HTMLAnchorElement>, id: string) => {
+  const handleScroll = (e: React.MouseEvent<HTMLAnchorElement>) => {
     e.preventDefault()
+    const id = e.currentTarget.getAttribute('href')?.slice(1)
+    if (!id) return
     const element = document.getElementById(id)
     if (element) {
       element.scrollIntoView({ behavior: 'smooth', block: 'start' })
     }
   }

Then update the links:

-              <a href="#features" onClick={(e) => handleScroll(e, 'features')} className="text-white/70 hover:text-white transition">
+              <a href="#features" onClick={handleScroll} className="text-white/70 hover:text-white transition">
                 Features
               </a>
-              <a href="#developer-guide" onClick={(e) => handleScroll(e, 'developer-guide')} className="text-white/70 hover:text-white transition">
+              <a href="#developer-guide" onClick={handleScroll} className="text-white/70 hover:text-white transition">
                 Developers Guide
               </a>

31-33: Consider updating the "Integration Docs" link for consistency.

The "Integration Docs" link still uses href="#" without a scroll handler, which is inconsistent with the updated "Features" and "Developers Guide" links. If this link should navigate elsewhere or remain as a placeholder, consider adding a comment or handling it consistently.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ccf238 and 03b3348.

📒 Files selected for processing (3)
  • src/sections/CallToAction.tsx
  • src/sections/Features.tsx
  • src/sections/Header.tsx
🔇 Additional comments (4)
src/sections/CallToAction.tsx (1)

49-49: LGTM! Scroll anchor added correctly.

The id="developer-guide" attribute establishes the scroll target for the navbar's "Developers Guide" link.

src/sections/Features.tsx (1)

133-133: LGTM! Scroll anchor added correctly.

The id="features" attribute establishes the scroll target for the navbar's "Features" link.

src/sections/Header.tsx (2)

1-1: Correct use of 'use client' directive.

The directive is necessary for client-side event handlers and DOM manipulation in the scroll handler.


7-13: LGTM! Smooth scroll implementation is functional.

The handleScroll function correctly prevents default anchor behavior and implements smooth scrolling with proper null checking.

	modified:   src/components/Button.tsx
	new file:   src/assets/StabilityNexus.png
	new file:   src/assets/StabilityNexus.svg
	new file:   src/assets/StablePay.svg
	new file:   src/assets/djed-alliance.png
	modified:   src/sections/LogoTicker.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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)
src/sections/LogoTicker.tsx (2)

9-12: Simplify the items array to avoid redundancy.

The items array currently contains duplicates (Stability Nexus and Djed Alliance each appear twice), and then the array is doubled again on line 35 with [...items, ...items]. This results in 8 rendered items when only 2 unique logos exist.

🔎 Proposed refactor to define only unique items
  const items = [
    { label: 'Stability Nexus', logo: StabilityNexusLogo },
    { label: 'Djed Alliance', logo: DjedAllianceLogo },
-   { label: 'Stability Nexus', logo: StabilityNexusLogo },
-   { label: 'Djed Alliance', logo: DjedAllianceLogo },
  ]

The doubling logic on line 35 will handle the repetition needed for seamless looping.


35-40: Consider more explicit keys for duplicate items.

While using index as the key is acceptable for this static content, a more explicit key like key={\${item.label}-${index}`}` would make the relationship clearer, especially given that the same logos appear multiple times.

🔎 Optional improvement for key prop
-           {[...items, ...items].map((item, index) => (
-             <div key={index} className="flex items-center gap-2">
+           {[...items, ...items].map((item, index) => (
+             <div key={`${item.label}-${index}`} className="flex items-center gap-2">
                <Image src={item.logo} alt={item.label} className="h-5 w-5 sm:h-6 sm:w-6 object-contain" width={24} height={24} />
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 58b434e and 557edd4.

⛔ Files ignored due to path filters (4)
  • src/assets/StabilityNexus.png is excluded by !**/*.png
  • src/assets/StabilityNexus.svg is excluded by !**/*.svg
  • src/assets/StablePay.svg is excluded by !**/*.svg
  • src/assets/djed-alliance.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • src/sections/LogoTicker.tsx
🔇 Additional comments (2)
src/sections/LogoTicker.tsx (2)

3-5: LGTM! Appropriate use of Next.js Image component.

The imports are correct, and using the Next.js Image component will provide automatic optimization for the logos.


27-27: Animation logic correctly implements seamless looping.

The -50% translation combined with the doubled items array (line 35) creates a smooth infinite loop: when the animation completes, the visual position matches the starting state. The reduced duration speeds up the ticker appropriately.

Also applies to: 30-30

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.

Make Navbar functional Add Feature: Make buttons respond on hover Add Stability Nexus and Djed Alliance Logos to the Logo Spinner

1 participant