-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
fixes the active state of the naviagtion component #226
fixes the active state of the naviagtion component #226
Conversation
Someone is attempting to deploy a commit to the SyntaxUI Team on Vercel. A member of the Team first needs to authorize it. |
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.
@@ -12,7 +12,7 @@ import { | |||
} from '@/components/ui/table' | |||
|
|||
export const metadata = { | |||
title: 'Skewed Infinite Scroll', | |||
title: ' Infinite Scroll', |
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.
Is there a reason for this title change?
@@ -38,14 +38,18 @@ function NavLink({ | |||
active?: boolean | |||
isAnchorLink?: boolean | |||
}) { | |||
const isActive = usePathname().startsWith(href); //checking if the pathname starts with the link's href. |
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.
We should remove isActive
or active
. It is confusing to have both isActive
and active
variables when only one is being used.
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.
Remove active variable
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Button's active state background disappears when navigating to a child element such as a 3D button. CleanShot.2024-06-15.at.19.44.11.mp4ton in this case |
|
fixed in #236 |
Description
This pull request addresses an issue where the "Button" component in the sidebar does not show as active when navigating to sub-routes like /components/button/neubrutalism-button. The changes ensure that the sidebar correctly highlights the "Button" component link when on any of its sub-routes.
Related Issue
#173
Fixes # (issue)
Proposed Changes
-> Modify the NavLink component to check if the pathname starts with the link's href to determine the active state.
-> Adjust the ActivePageMarker component to handle the same logic, ensuring correct highlighting in the sidebar.
Screenshots
Checklist
Please check the boxes that apply:
main
branch.npm run build
and build is successful