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

Gutenberg: contribute type migration for menu-item #79

Closed
bangank36 opened this issue Jul 28, 2023 · 3 comments
Closed

Gutenberg: contribute type migration for menu-item #79

bangank36 opened this issue Jul 28, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@bangank36
Copy link
Owner

bangank36 commented Jul 28, 2023

Summary

Use this issue to track the progress of migration to typescript for menu-item component

🚧 Proposed PR:

MenuItem: Refactor to TypeScript

Reference

Prior effort PR
Migration on menu-items-choice, type discussion
Collection migration issue
Kick off discussion (on storybook)

Found a blog on the component as prop, it suits for icon issue but it also answer some question raised with the Navigator Context #19

@bangank36
Copy link
Owner Author

bangank36 commented Jul 28, 2023

28 July 2023

  • icon prop seems off, link to readme is incorrect as well, so I used IconType for now

29 July 2023

  • menuItem has been used on several places and mismatch type can be seen on
  1. label: make it option
  2. icon: isSelected && check result false | Element is mismatched on menu-items-choice tools-panel-header
  3. variant on tools-panel-header: not relevant

@bangank36 bangank36 added the enhancement New feature or request label Jul 29, 2023
@bangank36 bangank36 self-assigned this Jul 29, 2023
@bangank36
Copy link
Owner Author

bangank36 commented Aug 6, 2023

06 Aug 2023

Addressing the feedback

  1. variant can not be removed, comment
  • Since variant is passed to button component, it can not be removed, check ...buttonProps
  1. Using WordPressComponentProps

Extend existing components’ props if possible, especially when a component internally forwards its props to another component in the package.
If the component forwards its ...restProps to an underlying element/component, you should use the WordPressComponentProps type for the component's props:

  1. Add JSDoc above export

  2. Rename type file

  3. Import button props

  4. IconPosition fix

  5. Remove all button props

  6. Rebase to latest changes & update changelogs

@bangank36
Copy link
Owner Author

Closed as merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

1 participant