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

Update Navbar for deprecation fix, accessibility, and performance (Closes #291) #292

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

amrit1004
Copy link

@amrit1004 amrit1004 commented Mar 18, 2025

feat(navbar): update Navbar for deprecation fix, accessibility, and performance

Closes #291

This pull request updates the Navbar component to resolve the Ant Design Dropdown overlay prop deprecation, enhance accessibility with ARIA labels and keyboard navigation, optimize performance with useMemo and static styles, and improve type safety with TypeScript. It also introduces basic error handling for images and suggests better file organization.

Changes

  • Replaced deprecated overlay with menu in Dropdown components for Ant Design compatibility.
  • Added aria-label attributes to interactive elements and keyboard navigation support with role and tabIndex.
  • Memoized helpMenuItems using useMemo to prevent unnecessary re-renders.
  • Moved styles to a static styles object outside the component to improve performance.
  • Enhanced type safety with FC<NavbarProps> and as const for styles.
  • Added onError handler to the logo Image component for basic error handling.
  • Structured menu items to align with TypeScript and suggested splitting into separate files.

Flags

  • Color contrast for hover states (white text on light backgrounds) should be reviewed for accessibility compliance.
  • File organization improvements (e.g., moving menu items to menuConfig.ts) are suggested but not fully implemented—consider follow-up work.

Screenshots or Video

image

(Note: Replace with actual links if available)

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests (Note: Add tests if required by the project).
  • Commits messages follow AP format.
  • Extend the documentation, if necessary (Note: Update if documentation exists).
  • Merging to main from fork:branchname.

@amrit1004 amrit1004 requested a review from a team as a code owner March 18, 2025 17:19
Copy link

netlify bot commented Mar 18, 2025

Deploy Preview for ap-template-playground ready!

Name Link
🔨 Latest commit 712857f
🔍 Latest deploy log https://app.netlify.com/sites/ap-template-playground/deploys/67d9ab0658af6400089ecbaf
😎 Deploy Preview https://deploy-preview-292--ap-template-playground.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 site configuration.

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.

Address Deprecation, Accessibility, Performance, and Type Safety Issues in Navbar Component
1 participant