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

feat(HeaderMenuItem): update prop #13375

Merged
merged 13 commits into from
Mar 22, 2023

Conversation

pratikkarad
Copy link
Contributor

Closes #13369

Changelog

Changed

  • Added isActive prop
  • Deprecated isCurrentPage in HeaderMenuItem

Testing / Reviewing

To verify these changes are working, we can check to see if the existing storybook behavior is still working correctly.

@pratikkarad pratikkarad requested a review from a team as a code owner March 20, 2023 09:53
@netlify
Copy link

netlify bot commented Mar 20, 2023

Deploy Preview for carbon-components-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit e0d84fe
🔍 Latest deploy log https://app.netlify.com/sites/carbon-components-react/deploys/64182d1d5d024b000868c84e
😎 Deploy Preview https://deploy-preview-13375--carbon-components-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Mar 20, 2023

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit e0d84fe
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/64182d1d9acb2e0008c797a8
😎 Deploy Preview https://deploy-preview-13375--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Mar 20, 2023

Deploy Preview for carbon-components-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit b8e0288
🔍 Latest deploy log https://app.netlify.com/sites/carbon-components-react/deploys/641b1e101a2a0f0008d58608
😎 Deploy Preview https://deploy-preview-13375--carbon-components-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Mar 20, 2023

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit b8e0288
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/641b1e10d9f09100083121e8
😎 Deploy Preview https://deploy-preview-13375--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Thanks for this! Just a couple minor things to address


/**
* Applies selected styles to the item if a user sets this to true and `aria-current !== 'page'`.
* @deprecated Please use `isActive`. This will be removed soon in v12.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @deprecated Please use `isActive`. This will be removed soon in v12.
* @deprecated Please use `isActive` instead. This will be removed in the next major release.


/**
* Applies selected styles to the item if a user sets this to true and `aria-current !== 'page'`.
* @deprecated Please use `isActive`. This will be removed soon in v12.
*/
isCurrentPage: PropTypes.bool,
Copy link
Member

Choose a reason for hiding this comment

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

This needs the deprecate() prop types function helper applied here.

Here's an example of how it's used:

light: deprecate(
PropTypes.bool,
'The `light` prop for `Combobox` has ' +
'been deprecated in favor of the new `Layer` component. It will be removed in the next major release.'
),

@pratikkarad
Copy link
Contributor Author

Hey @tay1orjones, I have updated the PR. PTAL, Thanks! 😃

@pratikkarad
Copy link
Contributor Author

Hi @tay1orjones, as suggested by @tw15egan, I tried doing the same thing to HeaderMenu and updated the test cases but it's still failing for some reason. Any suggestion?

packages/react/src/components/UIShell/HeaderMenu.js Outdated Show resolved Hide resolved
packages/react/src/components/UIShell/HeaderMenu.js Outdated Show resolved Hide resolved
packages/react/src/components/UIShell/HeaderMenu.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

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

LGTM 👍 ✅

@pratikkarad pratikkarad requested a review from a team as a code owner March 21, 2023 20:39
@kodiakhq kodiakhq bot merged commit 0bd4507 into carbon-design-system:main Mar 22, 2023
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.

[Feature Request]: Update HeaderMenuItem to use isActive, like SideNavMenuItem
3 participants