Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enhance Navbar Styling and improve mobile navigation #686

Closed
wants to merge 1 commit into from

Conversation

yalsik86
Copy link

@yalsik86 yalsik86 commented Oct 11, 2024

Fixes #682

Changes proposed

changes to navbar buttons to make the home page more aesthetically pleasing.

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots

Screenshot 2024-10-11 124335

Screenshot 2024-10-11 124327

Note to reviewers

@SaptarshiSarkar12 please review it.

Summary by CodeRabbit

  • New Features

    • Enhanced button styling for navigation links in the header, including improved borders, padding, rounded corners, and hover effects.
    • Updated styling applied to mobile navigation links for a consistent visual experience.
  • Bug Fixes

    • Ensured mobile navigation closes on scroll for better user experience on smaller screens.

Copy link

vercel bot commented Oct 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drifty ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2024 7:19am

Copy link
Contributor

coderabbitai bot commented Oct 11, 2024

📝 Walkthrough

Walkthrough

The changes in this pull request focus on the Header.js component of a React application, specifically enhancing the styling of the NavLink components. The button styling has been updated with new utility classes for borders, padding, rounded corners, and hover effects. While the MobileNav component structure remains largely unchanged, it now incorporates the updated NavLink styling. The overall functionality, including the onScroll function for managing navigation state, has not been altered.

Changes

File Change Summary
Website/app/Header.js Updated button styling for NavLink components with new utility classes. MobileNav components now use updated styles. No structural changes to Header or MobileNav. onScroll function remains unchanged.

Possibly related PRs

  • Fix nav bar scrolling issue on mobile devices #672: This PR modifies the MobileNav and Header functions in Header.js, which are directly related to the changes made in the main PR regarding the NavLink components and the onScroll function.
  • Fix hydration error in Header.js #674: This PR introduces changes to the NavLink component and the MobileNav component in Header.js, which are relevant to the styling and functionality updates made in the main PR.

Suggested labels

Website 🌐

Suggested reviewers

  • SaptarshiSarkar12

Poem

In the header where links do play,
A style update brightens the day.
With borders and padding, they dance with glee,
Mobile navs twirl, oh what a spree!
So hop along, let’s celebrate,
A prettier site, oh isn’t it great? 🐰✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Website 🌐 Issues/Pull Requests regarding Website dependencies 📦️ Pull Requests that update dependencies npm 📦️ Pull Requests that update npm dependencies labels Oct 11, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Yeah! You did it 🎉 Now, Relax 😉, Grab a drink ☕, and wait for the maintainers to check your contributions. Meanwhile, you can discuss on other issues and solve them 😀. Thank You 😃!

Meanwhile you can also discuss about the project in our Discord Server 😀

Copy link
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: 0

🧹 Outside diff range and nitpick comments (2)
Website/app/Header.js (2)

20-22: Improved button styling enhances visual appeal.

The updated NavLink styling with new utility classes for borders, padding, rounded corners, and hover effects significantly improves the visual appeal of the navbar buttons. This change aligns well with the PR objective.

Consider extracting these common styles into a separate CSS class or Tailwind component to improve maintainability and consistency across the application. For example:

const navLinkStyles = "border-2 px-3 py-2 text-white rounded hover:border-[#191B33] hover:bg-[#191B33] hover:scale-105 duration-500 text-sm lg:text-base";

// Usage
<button
  onClick={() => handleNavLinkClick(to, setOpen)}
  className={`${navLinkStyles} ${cn}`}
>
  {children}
</button>

This approach would make it easier to update the styling consistently across all NavLink components in the future.


Line range hint 27-75: MobileNav component updated consistently with new styling.

The MobileNav component has been updated to use the new NavLink styling, maintaining consistency between desktop and mobile navigation. This change aligns well with the overall navbar enhancement objective.

To improve accessibility, consider adding an aria-label attribute to the mobile navigation toggle button. This will help screen reader users understand the purpose of the button. For example:

<div
  className="z-40 flex relative w-8 h-8 flex-col justify-between items-center md:hidden"
  onClick={() => {
    setOpen(!open);
  }}
  role="button"
  aria-label="Toggle mobile navigation"
>
  {/* ... existing spans ... */}
</div>

This small addition will enhance the user experience for users relying on assistive technologies.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 487a1d1 and 6ac1906.

⛔ Files ignored due to path filters (2)
  • Website/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • Website/package.json is excluded by !**/*.json
📒 Files selected for processing (1)
  • Website/app/Header.js (1 hunks)
🧰 Additional context used
🔇 Additional comments (1)
Website/app/Header.js (1)

Line range hint 1-191: Overall, the navbar changes successfully enhance visual appeal.

The changes made to the Header.js component effectively improve the aesthetic appeal of the navbar buttons, aligning well with the PR objectives. The new styling has been consistently applied to both desktop and mobile navigation components, maintaining a cohesive look across different screen sizes.

Key improvements:

  1. Enhanced button styling with better visual feedback on hover.
  2. Consistent application of new styles across NavLink components.
  3. Preserved functionality while improving aesthetics.

The changes do not introduce any apparent issues or regressions, and the overall structure and behavior of the component remain intact.

To further improve the code:

  1. Consider extracting common styles into a separate CSS class or Tailwind component for better maintainability.
  2. Add an aria-label to the mobile navigation toggle button for improved accessibility.

These minor enhancements will contribute to a more maintainable and accessible codebase.

@SaptarshiSarkar12 SaptarshiSarkar12 added the feature ✨ New feature request or addition label Oct 11, 2024
@SaptarshiSarkar12 SaptarshiSarkar12 changed the title navbar change feat: Enhance Navbar Styling and improve mobile navigation Oct 11, 2024
Copy link
Owner

@SaptarshiSarkar12 SaptarshiSarkar12 left a comment

Choose a reason for hiding this comment

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

@yalsik86 Awesome work 👏. Just one change needed.
Please make the buttons a bit larger for mobiles.
Currently it looks like this 👇 (tested in Pixel 7 phone)
drifty-k1vbelf1q-saptarshi-sarkars-projects vercel app_(Pixel 7)

@FabrizioJordan
Copy link
Contributor

I think the scale in the hover is innecesary.
I will share another idea.
More simple, clean, no borders and no scale (because scale is not good with anchors).

When the user is seeing below the first section -> the hover background on this anchors is not different from the div background.
And so I'll give you a different idea.

My proposal: (two anchors normal and two on hover effect)

image

image

@SaptarshiSarkar12
Copy link
Owner

As @yalsik86 has been inactive for over a month and @FabrizioJordan has created an issue to revamp the website design in #720, I'm closing this PR. @yalsik86 Feel free to open whenever you want to make any further changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies 📦️ Pull Requests that update dependencies feature ✨ New feature request or addition npm 📦️ Pull Requests that update npm dependencies Website 🌐 Issues/Pull Requests regarding Website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add buttons for navbar items
3 participants