-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add extra check for sidebar item type #4065
Conversation
🦋 Changeset detectedLatest commit: 1107bb2 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 |
@toptal-bot run package:alpha-release |
Your alpha package is ready 🎉 |
@toptal-anvil ping reviewers |
1b78bd0
to
1107bb2
Compare
Greetings from FX team, @pudek357 👋 Thank you so much for contributing 🙇 We have got high priority ticket generated on our Kanban board so we will do our best to make your experience supreme! What's next? We will collaborate using this workflow. For you this practically means making sure DONE criteria is met and responding promptly to code review comments 😉 🙏 please, help us improve, rate your contributing experience after merge |
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.
thanks for the contribution!
@@ -50,7 +50,7 @@ export const SidebarMenu = forwardRef<HTMLUListElement, Props>( | |||
}, [parentSidebarItemIndex, setExpandedItemKey, children]) | |||
|
|||
const items = React.Children.map(children, (child, index) => { | |||
if (React.isValidElement(child)) { | |||
if (React.isValidElement(child) && child.type === SidebarItem) { |
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.
I think, it's kinda a strict requirement, because, some components may be extended from SidebarItem. We may break tha backward compatibility
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.
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.
good point
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.
Got it @dmaklygin 👍
For now, I don't see any other way to fix it, I will close the PR.
Description
This PR aims to add extra check for sidebar item type.
To fixes the two warnings in Client Portal:
Here is how our Sidebar looks like in CP:
As you can see we have additional banner between the items.
How to test
Development checks
props
in component with documentationexamples
for componentBreaking change
PR commands
List of available commands:
@toptal-bot run package:alpha-release
- Release alpha version@toptal-anvil ping reviewers
- Ping FX team for reviewPR Review Guidelines
When to approve? ✅
You are OK with merging this PR and
nit:
to your comment. (ex.nit: I'd rename this variable from makeCircle to getCircle
)When to request changes? ❌
You are not OK with merging this PR because
When to comment (neither ✅ nor ❌)
You want your comments to be addressed before merging this PR in cases like:
How to handle the comments?