SyntaxUI / syntaxui

Get free access to pre-built, Tailwind CSS-powered components, animations and effects - brought to life using Framer Motion. Just copy, paste and you're ready to go!
https://syntaxui.com
MIT License
573 stars 42 forks source link

fixes the active state of the naviagtion component #226

Closed siddhant-agrawal01 closed 1 week ago

siddhant-agrawal01 commented 3 weeks ago

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

https://github.com/SyntaxUI/syntaxui/issues/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

Screenshot from 2024-06-15 01-14-09

Screenshot from 2024-06-15 01-16-54

Checklist

Please check the boxes that apply:

vercel[bot] commented 3 weeks ago

Someone is attempting to deploy a commit to the SyntaxUI Team on Vercel.

A member of the Team first needs to authorize it.

siddhant-agrawal01 commented 3 weeks ago

Does this PR work on your end?

On my end the PR doesn't change anything.

Screenshot 2024-06-14 at 5 26 54 PM

It change the active state of navigation menu like the button component is become active when you choose specific button component Screenshot from 2024-06-15 11-00-26 Screenshot from 2024-06-15 11-07-01

vercel[bot] commented 2 weeks ago

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

Name Status Preview Comments Updated (UTC)
syntax-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 15, 2024 3:41pm
Ansub commented 2 weeks ago

Button's active state background disappears when navigating to a child element such as a 3D button.

https://github.com/SyntaxUI/syntaxui/assets/12985873/02ebeafb-372d-4444-8000-5f2fdd275901

ton in this case

siddhant-agrawal01 commented 2 weeks ago

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.mp4 ton in this case Thanks for the clarification , let me try my best to fix that .

siddhant-agrawal01 commented 2 weeks ago

image Button's active state background is now appears.what i use is that the background effect is applied only to the exact active route.but this way the introduction still remain active even when we navigate to button and its child component.
so how can i disable the introduction active state when going to button component(or any other component)?

Ansub commented 1 week ago

fixed in https://github.com/SyntaxUI/syntaxui/pull/236