Resolve Double Navbar Overlap on Dashboard & Layout Conflicts#319
Conversation
|
@karthikc1125 is attempting to deploy a commit to the santanu-atta03's projects Team on Vercel. A member of the Team first needs to authorize it. |
Thanks for creating a PR for your Issue!
|
There was a problem hiding this comment.
Pull request overview
This PR updates route-level layout behavior to prevent multiple navigation bars from rendering simultaneously and to ensure page content doesn’t sit underneath the fixed global navbar. It also includes some Backend configuration cleanup/changes that should be reflected in the PR scope.
Changes:
- Conditionally render the global
<Navbar />inApp.jsxbased on the current route to avoid “double navbar” overlap. - Add consistent top padding (e.g.,
pt-32) on several pages that use the fixed global navbar so content starts below it. - Refactor/format several page/component files and adjust Backend DB/OAuth callback configuration.
Reviewed changes
Copilot reviewed 12 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Frontend/src/App.jsx | Adds route-based navbar visibility logic and conditionally renders <Navbar />. |
| Frontend/src/components/Navbar.jsx | Minor formatting changes to className template strings. |
| Frontend/src/pages/Results.jsx | Adds pt-32 top padding to avoid content being hidden under the fixed navbar; formatting tweaks. |
| Frontend/src/pages/Analytics.jsx | Adds pt-32 top padding for navbar offset. |
| Frontend/src/pages/AdvancedFeaturesDashboard.jsx | Adds pt-32 top padding; minor formatting tweaks. |
| Frontend/src/pages/PracticeLab.jsx | Adds pt-32 top padding; minor formatting in empty catch blocks. |
| Frontend/src/components/Blogs/BlogPlatform.jsx | Adds pt-32 top padding; formatting/indentation cleanup. |
| Frontend/src/pages/Leaderboard.jsx | Adds large top padding (pt-[25vh]) and formatting tweaks. |
| Frontend/src/pages/Landing.jsx | Removes leading BOM/indentation on the first import line. |
| Frontend/src/pages/Terms.jsx | Formatting/indentation cleanup (page still has its own navbar). |
| Frontend/src/pages/Privacy.jsx | Formatting/indentation cleanup (page still has its own navbar). |
| Frontend/src/pages/CookiePolicy.jsx | Formatting/indentation cleanup (page still has its own navbar). |
| Backend/config/db.js | Simplifies DB connect logic; removes in-memory fallback code. |
| Backend/config/Passport.js | Changes OAuth callback URLs to relative paths. |
| Backend/routes/User.route.js | Removes large commented-out OAuth/cookie code blocks (no functional change intended). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🐛 Problem
The Dashboard page was rendering two navigation bars simultaneously:
Global from App.jsx
Internal Dashboard navigation/header
This caused:
Navbar stacking/overlapping at the top
Layout shifting issues
Content being pushed or hidden
Inconsistent spacing across routes
Additionally, several pages had content rendering beneath the fixed global navbar due to missing layout offset.
✅ Fixes Implemented
1️⃣ Removed Duplicate Navbar Rendering
Updated App.jsx to conditionally render the global
Hidden global navbar on routes that include their own internal navigation:
/dashboard
/settings
/pricing
/career
/interview-setup
/interview-room
Complex interactive/dashboard-style pages
This ensures only one navigation bar is rendered per route.
2️⃣ Fixed Content Hidden Behind Fixed Navbar
Added consistent top spacing (pt-32) to pages that rely on the global fixed navbar:
Auth pages (Login, Register, Verify Email)
Domain selection
Analytics
Advanced Features Dashboard
Practice Lab
Blog Platform
Results
This guarantees content always renders below the navbar.
3️⃣ Centralized Layout Control
Consolidated navbar + footer visibility logic inside App.jsx
Simplified route-based layout handling
Made navigation behavior predictable and scalable for future pages
🎯 Result
✅ No more double navbar rendering
✅ No overlapping headers
✅ Consistent spacing across all pages
✅ Improved route-based layout structure
✅ Cleaner and more maintainable navigation logic
Before
After