-
Notifications
You must be signed in to change notification settings - Fork 200
Solved BUG #331 on scroll to top when user click in logo #339
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
base: main
Are you sure you want to change the base?
Solved BUG #331 on scroll to top when user click in logo #339
Conversation
|
@OfficialSubham is attempting to deploy a commit to the AJEET PRATAP SINGH's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThe navbar component now includes a Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/web/src/components/landing-sections/navbar.tsx (1)
91-94:⚠️ Potential issue | 🟡 MinorAlt text
"background"is incorrect for a logo image.This is the site logo, not a background image. A meaningful alt text like
"Opensox AI logo"improves accessibility.
🤖 Fix all issues with AI agents
In `@apps/web/src/components/landing-sections/navbar.tsx`:
- Line 88: The logo container is interactive (onClick={scrollToTop}) but lacks
keyboard and ARIA semantics; replace the <div> used in Navbar (the element with
class "text-xl md:text-2xl ... cursor-pointer") with an accessible control
(preferably a <button>) or add tabindex="0", role="button", aria-label="Scroll
to top", and an onKeyDown handler that calls scrollToTop on Enter/Space; ensure
the element uses the same class names and that the scrollToTop function is
invoked from both onClick and onKeyDown so keyboard and screen-reader users can
activate it.
🧹 Nitpick comments (1)
apps/web/src/components/landing-sections/navbar.tsx (1)
51-56: Rename tohandleScrollToTopand add a type annotation.Per coding guidelines, event handler functions should use the
handleprefix, and const functions should have a type defined.♻️ Proposed rename
- const scrollToTop = () => { + const handleScrollToTop: () => void = () => { window.scrollTo({ top: 0, - behavior: "smooth" - }) - } + behavior: "smooth", + }); + };As per coding guidelines: "name event functions with a 'handle' prefix" and "Define a type when defining const functions."
User can scroll to top by clicking in the logo in landing page
Summary by CodeRabbit