Skip to content

This PR fixes issue #1286 where mobile screens showed extra blank space#1289

Open
iaadillatif wants to merge 1 commit intorecodehive:mainfrom
iaadillatif:fix-mobile-header-whitespace
Open

This PR fixes issue #1286 where mobile screens showed extra blank space#1289
iaadillatif wants to merge 1 commit intorecodehive:mainfrom
iaadillatif:fix-mobile-header-whitespace

Conversation

@iaadillatif
Copy link
Contributor

This PR resolves the mobile top whitespace issue and finalizes the homepage component separation by migrating hero rendering into a dedicated component.

Fixes #1286


Type of Change

  • New feature (e.g., new page, component, or functionality)
  • Bug fix (non-breaking change that fixes an issue)
  • UI/UX improvement (design, layout, or styling updates)
  • Performance optimization (e.g., code splitting, caching)
  • Documentation update (README, contribution guidelines, etc.)
  • Other (please specify):

Changes Made

Mobile Navbar / Top Offset Fix

  • Reset navbar top offset for small screens in custom.css.
  • Prevented hidden announcement containers from reserving vertical space.
  • Enforced fixed navbar top positioning for mobile and tablet breakpoints.
  • Ensured hero content starts near the top for viewports below 768px.

Mobile UI before:

Screenshot 2026-03-01 170123

Mobile UI after changes:

Screenshot 2026-03-01 170153

Hero Rendering Refactor

  • Created dedicated hero.tsx component.
  • Added hero.css for isolated styling.
  • Updated homepage to render Hero from index.tsx.
  • Removed legacy src/components/header/header.tsx.

Floating Contributors Prop Alignment

  • Renamed embedded prop usage to heroEmbedded in index.tsx.
  • Updated component documentation in README.md.

Behavior After Fix

  • On viewport widths below 768px, hero content starts near the top without unnecessary blank space.
  • Homepage hero renders the same content and animations as before.
  • Rendering now occurs through dedicated Hero component files.
  • Layout behavior is consistent across breakpoints.

Desktop Hero rendering correctly

Screenshot 2026-03-01 170321

Dependencies

  • No new dependencies added.
  • No version changes required.
  • No configuration updates required.

Checklist

  • My code follows the style guidelines of this project.
  • I have tested my changes across major browsers and devices
  • My changes do not generate new console warnings or errors .
  • I ran npm run build and attached screenshot(s) in this PR.
  • This is already assigned Issue to me, not an unassigned issue.

… blank space above the homepage hero content.
Copilot AI review requested due to automatic review settings March 1, 2026 12:04
@vercel
Copy link
Contributor

vercel bot commented Mar 1, 2026

@iaadillatif is attempting to deploy a commit to the recode Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link

github-actions bot commented Mar 1, 2026

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. The estimated time for response is 5–8 hrs.

In the meantime, please provide all necessary screenshots and make sure you run - npm build run , command and provide a screenshot, a video recording, or an image of the update you made below, which helps speed up the review and assignment. If you have questions, reach out to LinkedIn. Your contributions are highly appreciated!😊

Note: I maintain the repo issue every day twice at 8:00 AM IST and 9:00 PM IST. If your PR goes stale for more than one day, you can tag and comment on this same issue by tagging @sanjay-kv.

We are here to help you on this journey of open source. Consistent 20 contributions are eligible for sponsorship 💰

🎁 check our list of amazing people we sponsored so far: GitHub Sponsorship. ✨

📚Your perks for contribution to this community 👇🏻

  1. Get free Consultation use code recode50 to get free: Mentorship for free.

  2. Get the Ebook for free use code recode at checkout: Data Science cheatsheet for Beginners.

  3. Check out this weekly Newsletter: Sanjay's Newsletter.

If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

@github-actions github-actions bot added recode this is label for leaderboard level 1 10 points labels Mar 1, 2026
@github-actions
Copy link

github-actions bot commented Mar 1, 2026

✅ Synchronized metadata from Issue #1286:

  • Labels: level 1, recode
  • Milestone: None

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses the reported extra top whitespace on mobile/tablet viewports by adjusting navbar/announcement-bar behavior, and completes a homepage refactor by moving the hero/header rendering into a dedicated Hero component (including aligning FloatingContributors embed prop naming).

Changes:

  • Adjusted mobile/tablet navbar CSS to remove top offset and prevent hidden announcement-bar spacing.
  • Replaced homepage Header usage with a new Hero component + isolated hero.css.
  • Renamed FloatingContributors embed prop from headerEmbedded to heroEmbedded and updated its README.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/pages/index.tsx Switches homepage to render the new Hero component and adjusts hero wrapper spacing.
src/css/custom.css Adds mobile/tablet navbar/announcement-bar rules intended to eliminate top whitespace.
src/components/hero/hero.tsx Introduces the dedicated Hero component and wires FloatingContributors into it.
src/components/hero/hero.css Renames/updates hero styles to match the new component structure and responsive behavior.
src/components/header.tsx Removes the legacy header implementation.
src/components/FloatingContributors/index.tsx Renames the embed prop to heroEmbedded and updates behavior accordingly.
src/components/FloatingContributors/README.md Updates documentation to use heroEmbedded.
Comments suppressed due to low confidence (3)

src/components/hero/hero.tsx:57

  • In JSX, <br> is typically written as a self-closing tag (<br />). Using <br></br> is valid but inconsistent with the <br /> used a few lines above and can trip formatting/linting rules; consider switching these to <br /> for consistency.
    src/components/hero/hero.tsx:17
  • hero.tsx imports Framer Motion via import * as FramerMotion and then casts motion out of the module namespace. This drops the normal motion.* typings (props become effectively unknown) and deviates from how Framer Motion is imported everywhere else in the repo (e.g. import { motion } from "framer-motion"). Prefer using the standard named import so TS can type-check the motion components and avoid runtime surprises if module shape changes.
    src/pages/index.tsx:45
  • This change removes the <Head> injection of the amp-auto-ads script from the homepage. Other pages in the codebase still inject this script (e.g. showcase, sponsors), so this is a functional change beyond the stated whitespace/hero refactor. Please confirm this is intentional; if the homepage should still load AMP auto ads, keep the Head block here or move the script injection to a shared/global location.
    <Layout
      title={`${siteConfig.title}`}
      description="Welcome to recode hive. Learn the basics to advanced concepts of web development. sql, python, Cloud, GitHub and more."
    >
      {/* ✅ Wrap in solid background to fix light mode */}
      <div
        className="transition-colors duration-300"
        style={{

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


/* Clean mobile navbar layout - prevent overflow */
.navbar {

Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

There’s an extra blank line inside the .navbar rule which looks accidental and adds noise to custom.css. Consider removing it to keep the stylesheet tidy.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines +494 to +498
className={`floating-contributors-container ${heroEmbedded ? "header-embedded" : ""}`}
initial={{
opacity: 0,
y: headerEmbedded ? 0 : 50,
scale: headerEmbedded ? 1 : 0.9,
y: heroEmbedded ? 0 : 50,
scale: heroEmbedded ? 1 : 0.9,
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

The prop was renamed to heroEmbedded, but the conditional class name is still "header-embedded". This naming mismatch is confusing for future maintenance and makes it harder to grep/understand which styles apply to the hero vs other contexts. Consider renaming the CSS hook to hero-embedded (and updating the corresponding selectors in FloatingContributors.css), or keep the prop name aligned with the existing header-embedded styling.

Copilot uses AI. Check for mistakes.
@iaadillatif iaadillatif changed the title This PR fixes issue #1286 where mobile screens showed extra blank spa… This PR fixes issue #1286 where mobile screens showed extra blank space Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level 1 10 points recode this is label for leaderboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐞[Bug]: Mobile header has unnecessary top whitespace (<768px)

2 participants