Skip to content

Initial SidebarNav implementation#221

Draft
douglaswinter wants to merge 4 commits into
mainfrom
dw/sidebar_nav
Draft

Initial SidebarNav implementation#221
douglaswinter wants to merge 4 commits into
mainfrom
dw/sidebar_nav

Conversation

@douglaswinter

Copy link
Copy Markdown

Closes #210

@douglaswinter

Copy link
Copy Markdown
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.
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.

New component: sidebar navigation

1 participant