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

v3: Menu is using ListItem #1295

Merged
merged 29 commits into from Jun 1, 2023
Merged

v3: Menu is using ListItem #1295

merged 29 commits into from Jun 1, 2023

Conversation

gretanausedaite
Copy link
Contributor

@gretanausedaite gretanausedaite commented May 18, 2023

Changes

Using ListItem inside of MenuItem;
Updated code to use new MenuItem inside ComboBox and Select;
Updated CSS tests for Menu;

Renamed MenuItem props:

  • icon > startIcon
  • badge > EndIcon

MenuItemSkeleton is still using some menu-item class stuff;

TODO:

  • Remove cloneObject code
    Removed some of the cloneObject code

Testing

Visual tests pass;
Updated unit tests for new classnames;

Docs

https://github.com/iTwin/iTwinUI/wiki/iTwinUI-react-v3-migration-guide#menuitem

@gretanausedaite gretanausedaite added this to the React 3.0 milestone May 18, 2023
@gretanausedaite gretanausedaite self-assigned this May 18, 2023
@gretanausedaite gretanausedaite mentioned this pull request May 24, 2023
24 tasks
@gretanausedaite gretanausedaite marked this pull request as ready for review May 24, 2023 13:02
@gretanausedaite gretanausedaite requested a review from a team as a code owner May 24, 2023 13:02
@gretanausedaite gretanausedaite requested review from a team, mayank99 and adamhock and removed request for a team May 24, 2023 13:02
@mayank99

This comment was marked as resolved.

);

return React.cloneElement<MenuItemProps>(menuItem, {
Copy link
Contributor

Choose a reason for hiding this comment

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

the original reason for using cloneElement here was for adding extra stuff to menuItem returned by custom itemRenderer.

so if we're removing it, there needs to be a way to expose equivalent functionality

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking if we need to remove this cloneElement statement?
Reverted changes for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

it's ok to keep for now because we are not passing className inside it. we can try to figure out a better solution in the future

Co-authored-by: Mayank <9084735+mayank99@users.noreply.github.com>
@gretanausedaite gretanausedaite requested review from a team as code owners June 1, 2023 06:43
Copy link
Contributor

@mayank99 mayank99 left a comment

Choose a reason for hiding this comment

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

LGTM

@gretanausedaite gretanausedaite added this pull request to the merge queue Jun 1, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 1, 2023
@gretanausedaite gretanausedaite merged commit 86a9acf into dev Jun 1, 2023
12 checks passed
@gretanausedaite gretanausedaite deleted the greta/new-menu-item branch June 1, 2023 14:53
@imodeljs-admin imodeljs-admin mentioned this pull request Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v3: Rename MenuItem props (badge → endIcon and icon → startIcon)
2 participants