Skip to content
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

Fix(HeaderMenu + HeaderNavigation): handle null item #4682

Merged
merged 4 commits into from
Nov 15, 2019

Conversation

breid1313
Copy link
Contributor

Related to #4261

Allows <HeaderMenu> and <HeaderNavigation> to handle a null item/child on render.

Changelog

Changed

  • check if child/item is a valid React element before rendering

Testing / Reviewing

In packages/react/src/components/UIShell/UIShell-story.js pass a null <HeaderMenuItem> to a <HeaderNavigation> and <HeaderMenu> component.
ie change:
line 158 to {false && <HeaderMenuItem href="#">Link 1</HeaderMenuItem>}
line 162 to {false &&<HeaderMenuItem href="#">Sub-link 1</HeaderMenuItem>}

Link 1 should no longer be visible in the header, and sub-link 1 should disappear from the link 4 dropdown.

@breid1313 breid1313 requested a review from a team as a code owner November 14, 2019 18:06
@ghost ghost requested review from aledavila and jnm2377 November 14, 2019 18:06
@netlify
Copy link

netlify bot commented Nov 14, 2019

Deploy preview for carbon-elements ready!

Built with commit 63d96c6

https://deploy-preview-4682--carbon-elements.netlify.com

@netlify
Copy link

netlify bot commented Nov 14, 2019

Deploy preview for the-carbon-components ready!

Built with commit 63d96c6

https://deploy-preview-4682--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Nov 14, 2019

Deploy preview for carbon-components-react ready!

Built with commit 63d96c6

https://deploy-preview-4682--carbon-components-react.netlify.com

Copy link
Contributor

@asudoh asudoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 - Thanks @breid1313!

@joshblack joshblack merged commit e8888a1 into carbon-design-system:master Nov 15, 2019
@breid1313 breid1313 deleted the fix-headermenu branch November 15, 2019 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants