Initial SidebarNav implementation#221
Draft
douglaswinter wants to merge 4 commits into
Draft
Conversation
Author
|
Similarly to NavBar (as far as I can make out), this component does not handle selected state generically. When using react router NavLinks, the selected button because selected, but it should probably handle this consistently across link implementations. |
The solution in this commit is to simply have a `selected` optional prop
on the NavItemDefinition which propagates to the button component. When
using standard anchor tags, the caller will need to keep track of this
state and set it some way e.g.
selected: window.location.pathname === "/docs"
When using react-router-dom, the state is handled in internally within
the NavLink component.
Stories have been added to demonstrate the two cases.
ffffa4e to
07f40ba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #210