-
Notifications
You must be signed in to change notification settings - Fork 150
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
feat(SideNav): add description and onLevelChange callback #2488
Conversation
🦋 Changeset detectedLatest commit: be18e87 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ PR title follows Conventional Commits specification. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit be18e87:
|
Bundle Size ReportUpdated Components
|
Here, onLevelChange is being called twice when I am on the same level. When I am on level 2, I hover over level 1 items, and the level gets changed, triggering onLevelChange. Then I click on a level 1 item. Although the level has not changed, onLevelChange is still being called. SideNav.mov |
* | ||
* **Note**: Only applicable for L2 items | ||
*/ | ||
description?: string; |
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.
can we have a check for this ? we can throw warning in console if description is provided to L1 items ?
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.
makes sense. We can throw dev-only error. I was avoiding production error because if backend API mistakenly sends description then we don't want the sidenav to error out completely.
So I was kind of thinking onLevelChange as callback that also gets triggered when the active level changes. So in future we can have argument of But yes without the activeLevel argument it looks confusing. What do you think should we add |
@tewarig Renamed the prop |
.changeset/lucky-toys-hunt.md
Outdated
"@razorpay/blade": minor | ||
--- | ||
|
||
feat(SideNav): add `description` on SideNavLink and `onLevelChange` callback on `SideNav` |
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.
onVisualLevelChange
Description
onVisibleLevelChange
callbackChanges
Additional Information
Component Checklist