Skip to content

feat(header): update header actions and add dashboard link#73

Merged
ViktorSvertoka merged 1 commit into
developfrom
yn/fix/header
Dec 21, 2025
Merged

feat(header): update header actions and add dashboard link#73
ViktorSvertoka merged 1 commit into
developfrom
yn/fix/header

Conversation

@YNazymko12
Copy link
Copy Markdown
Collaborator

@YNazymko12 YNazymko12 commented Dec 21, 2025

  • remove ThemeToggleButton from site header
  • add dashboard user icon linking to /dashboard for authenticated users
  • refine header auth actions for desktop and mobile

Summary by CodeRabbit

  • New Features

    • Dashboard link now appears in the header when you're logged in.
  • Style

    • Removed theme toggle button from the header.
    • Minor adjustments to header icon sizing for better visual consistency.

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

- remove ThemeToggleButton from site header
- add dashboard user icon linking to /dashboard for authenticated users
- refine header auth actions for desktop and mobile
@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 21, 2025

Deploy Preview for develop-devlovers ready!

Name Link
🔨 Latest commit b5971cd
🔍 Latest deploy log https://app.netlify.com/projects/develop-devlovers/deploys/69484ffa1037da000829f1b0
😎 Deploy Preview https://deploy-preview-73--develop-devlovers.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 21, 2025

Walkthrough

This PR consolidates navigation link definitions into a centralized module (frontend/lib/navigation.ts) and updates header components to import from it. A conditional Dashboard link is added to display when a user exists, replacing the ThemeToggleButton component.

Changes

Cohort / File(s) Change Summary
Header component refactoring
frontend/components/header/SiteHeader.tsx, frontend/components/header/SiteMobileHeader.tsx
Import SITE_LINKS from centralized location instead of local definition. SiteHeader adds conditional Dashboard link (with User icon) displayed when userExists is true; removes ThemeToggleButton. SiteMobileHeader adjusts Menu icon size from 6×6 to 5×5.
Centralized navigation constant
frontend/lib/navigation.ts
New file exporting SITE_LINKS constant containing seven navigation items (Q&A, Quiz, Leaderboard, Blog, About, Contacts, Shop) with as const assertion for immutability and literal typing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Straightforward constant extraction and import updates
  • Simple conditional rendering of Dashboard link based on user existence
  • Minor UI adjustment (icon sizing) with consistent pattern across files

Possibly related PRs

Suggested reviewers

  • AM1007
  • ViktorSvertoka

Poem

🐰 With paws of care, I hop along,
To centralize where links belong,
Dashboard glows for those who're known,
Navigation blooms, no longer lone!
A tidy burrow, all in place,

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: removing theme toggle button, adding dashboard link, and updating header actions.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch yn/fix/header

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

Copy link
Copy Markdown
Contributor

@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: 1

🧹 Nitpick comments (2)
frontend/lib/navigation.ts (1)

1-9: Consider adding an explicit type definition.

While as const provides literal typing, defining an explicit interface would improve type safety and serve as documentation for the link structure.

🔎 Suggested type definition
+export interface SiteLink {
+  href: string;
+  label: string;
+}
+
-export const SITE_LINKS = [
+export const SITE_LINKS: readonly SiteLink[] = [
   { href: '/q&a', label: 'Q&A' },
   { href: '/quiz/react-fundamentals', label: 'Quiz' },
   { href: '/leaderboard', label: 'Leaderboard' },
   { href: '/blog', label: 'Blog' },
   { href: '/about', label: 'About' },
   { href: '/contacts', label: 'Contacts' },
   { href: '/shop', label: 'Shop' },
 ] as const;
frontend/components/header/SiteHeader.tsx (1)

62-71: LGTM! Mobile dashboard link mirrors desktop implementation.

The mobile dashboard link correctly replicates the desktop version with appropriate accessibility attributes and styling.

💡 Optional: Extract dashboard link to reduce duplication

The dashboard link is duplicated between desktop (lines 36-45) and mobile (lines 62-71) sections. Consider extracting it:

const DashboardLink = () => (
  <Link
    href="/dashboard"
    aria-label="Dashboard"
    title="Dashboard"
    className="inline-flex h-10 w-10 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground"
  >
    <User className="h-5 w-5" />
  </Link>
);

Then use {userExists && <DashboardLink />} in both sections.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9a2407b and b5971cd.

📒 Files selected for processing (3)
  • frontend/components/header/SiteHeader.tsx (3 hunks)
  • frontend/components/header/SiteMobileHeader.tsx (2 hunks)
  • frontend/lib/navigation.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
frontend/lib/navigation.ts (2)
frontend/components/shop/header/nav-links.tsx (3)
  • NavLinks (31-62)
  • NavLinksProps (25-29)
  • link (36-50)
frontend/components/shop/shop-header.tsx (1)
  • Header (14-61)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Redirect rules - develop-devlovers
  • GitHub Check: Header rules - develop-devlovers
  • GitHub Check: Pages changed - develop-devlovers
🔇 Additional comments (5)
frontend/components/header/SiteMobileHeader.tsx (2)

3-3: LGTM! Good refactor to centralize navigation links.

Importing SITE_LINKS from a shared module eliminates duplication and ensures consistency across header components.


34-34: LGTM! Icon size consistency improvement.

Aligning the Menu icon size (h-5 w-5) with the X icon ensures a smooth visual transition when toggling the mobile menu.

frontend/components/header/SiteHeader.tsx (2)

3-4: LGTM! Import changes support the refactoring.

Centralizing SITE_LINKS and importing the User icon for the new dashboard link are appropriate changes.


36-45: LGTM! Dashboard link implementation is solid.

The conditional dashboard link for authenticated users is well-implemented with:

  • Appropriate accessibility attributes (aria-label, title)
  • Consistent styling and icon sizing
  • Proper conditional rendering based on userExists
frontend/lib/navigation.ts (1)

2-2: The '/q&a' route is properly configured and functional. The route exists at frontend/app/[locale]/q&a/page.tsx and is consistently referenced throughout the codebase in navigation, components, and routing logic. Next.js handles the ampersand character correctly in this context without issues.

@@ -0,0 +1,9 @@
export const SITE_LINKS = [
{ href: '/q&a', label: 'Q&A' },
{ href: '/quiz/react-fundamentals', label: 'Quiz' },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for quiz-related routes and structure

# Check what quiz routes exist in the frontend
echo "=== Quiz routes/pages ==="
find frontend -type d -name "quiz" 2>/dev/null

echo -e "\n=== Quiz page files ==="
find frontend -path "*quiz*" -name "page.tsx" -o -path "*quiz*" -name "page.ts" 2>/dev/null | head -20

echo -e "\n=== Quiz directory structure ==="
find frontend/app -type d -name "quiz" -exec find {} -type f \; 2>/dev/null | head -30

Repository: DevLoversTeam/devlovers.net

Length of output: 436


🏁 Script executed:

#!/bin/bash
# Check the quizzes listing page content
echo "=== Checking /quizzes page ==="
head -50 frontend/app/\[locale\]/quizzes/page.tsx

echo -e "\n=== Check if there's a general /quiz route ==="
ls -la frontend/app/\[locale\]/quiz/ 2>/dev/null | head -20

echo -e "\n=== Check navigation.ts content ==="
cat frontend/lib/navigation.ts

Repository: DevLoversTeam/devlovers.net

Length of output: 2392


Update Quiz link to point to the quiz listing page instead of a specific quiz.

The Quiz navigation currently links directly to /quiz/react-fundamentals, which bypasses the quiz listing page at /quizzes. Change the href to /quizzes to allow users to browse all available quizzes before selecting one.

🤖 Prompt for AI Agents
In frontend/lib/navigation.ts around line 3, the navigation entry currently
links to a specific quiz path (/quiz/react-fundamentals) instead of the quiz
listing page; update the href value to point to /quizzes so the "Quiz" nav item
routes users to the quiz listing page rather than directly to a single quiz.

@ViktorSvertoka ViktorSvertoka merged commit 7e1c1e0 into develop Dec 21, 2025
5 checks passed
@ViktorSvertoka ViktorSvertoka deleted the yn/fix/header branch December 21, 2025 20:53
liudmylasovetovs pushed a commit that referenced this pull request Jan 9, 2026
feat(header): update header actions and add dashboard link
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.

2 participants