Skip to content

Conversation

@interim17
Copy link
Contributor

Problem

Closes #404

Solution

Can improve/modify this in conversation with UX but this is a functional patch for the navbar below a mobile breakpoint

Screenshots (optional):

Screenshot 2026-01-09 at 12 36 59 PM Screenshot 2026-01-09 at 12 37 11 PM

Keyfiles (delete if not relevant):

  1. main file/entry point
  2. other important file

Thanks for contributing!

@interim17 interim17 requested review from meganrm and rugeli January 9, 2026 20:38
@netlify
Copy link

netlify bot commented Jan 9, 2026

Deploy Preview for cell-catalog ready!

Name Link
🔨 Latest commit 092fc37
🔍 Latest deploy log https://app.netlify.com/projects/cell-catalog/deploys/696167377ae1060008b5b715
😎 Deploy Preview https://deploy-preview-406--cell-catalog.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.

// crossing the breakpoint.
useEffect(() => {
const handleResize = () => {
const isMobile = window.innerWidth <= 768;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should use the breakpoint constant.

Also, 768 is more standard, but the designs travis made have the cuttoff at 744. I don't have strong opinions but it should be consistent

Copy link
Collaborator

Choose a reason for hiding this comment

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

there is also also already a useWindowWidth hook with a resize listener, did that not work for this?

Copy link
Contributor Author

@interim17 interim17 Jan 10, 2026

Choose a reason for hiding this comment

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

Thanks for pointing that out. I forgot about it. I just added a little wrapper for that in this PR that i think is an improvement... If you want to review that first and I can bring that change in here?

#409

@meganrm meganrm requested a review from Copilot January 10, 2026 01:42
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 adds a responsive hamburger menu to the navbar that appears on small screens (≤768px). The changes enable a mobile-friendly navigation experience by hiding the standard dropdown buttons and displaying a drawer-based menu instead.

Changes:

  • Added a new HamburgerMenu component that renders a drawer with organized sections for Catalogs, Protocols, and Collections
  • Implemented responsive CSS to toggle between standard dropdowns and hamburger menu based on screen width
  • Added theme styling for the new Drawer and Menu components

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/components/HamburgerMenu/HamburgerMenu.tsx New component implementing the hamburger menu with drawer UI
src/style/hamburgerMenu.module.css Styles for the hamburger button and drawer content
src/style/navbar.module.css Media query logic to show/hide hamburger menu and dropdowns
src/style/theme.ts Theme configuration for Drawer and Menu components
src/component-queries/NavBar.tsx Integration of hamburger menu with resize handling logic

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

// crossing the breakpoint.
useEffect(() => {
const handleResize = () => {
const isMobile = window.innerWidth <= 768;
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

The breakpoint value 768 is hardcoded here and also in navbar.module.css line 60. Consider extracting this to a shared constant to ensure consistency and ease of maintenance.

Copilot uses AI. Check for mistakes.
Comment on lines 82 to 87
const handleResize = () => {
const isMobile = window.innerWidth <= 768;
if (isMobile) {
setDropdownKey((prev) => prev + 1);
}
};
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

The resize event listener fires continuously during window resizing. Consider debouncing this handler to avoid excessive state updates and re-renders.

Copilot uses AI. Check for mistakes.
open={open}
width={300}
className={drawerContainer}
destroyOnHidden
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

The prop name 'destroyOnHidden' appears incorrect. The Ant Design Drawer component uses 'destroyOnClose' to control whether to destroy child elements when the drawer is closed.

Suggested change
destroyOnHidden
destroyOnClose

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is wrong.

Copy link
Collaborator

@rugeli rugeli left a comment

Choose a reason for hiding this comment

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

Tested the menu on iphone and it works well!

one thing I noticed in the banner: on a same-sized android phone, some of the text overlaps. Might be worth a quick follow-up or ux check.

cc28fe6e77d3f43c178b5a4847cf085a

@interim17 interim17 merged commit 76cc8e6 into main Jan 12, 2026
3 checks passed
@interim17 interim17 deleted the feature/hamburger branch January 12, 2026 20:44
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.

Mobile style for the navbar

4 participants