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(MenuItem): be able to provide a component to title #1938

Merged
merged 3 commits into from
Feb 8, 2024

Conversation

talkor
Copy link
Member

@talkor talkor commented Feb 8, 2024

@talkor talkor added the feature label Feb 8, 2024
@talkor talkor requested a review from a team as a code owner February 8, 2024 15:25
}

const MenuItem: VibeComponent<MenuItemProps> & {
interface MenuItemTitleComponentProps extends Omit<MenuItemProps, "title"> {
Copy link
Member Author

Choose a reason for hiding this comment

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

@YossiSaadi changed it eventually because MenuItemProps is exported so it breaks stuff

@@ -220,6 +237,8 @@ const MenuItem: VibeComponent<MenuItemProps> & {
[setSubMenuIsOpenByIndex, index, closeMenu]
);

const iconLabel = typeof title === "string" ? title : ariaLabel;

const renderSubMenuIconIfNeeded = () => {
if (!hasChildren) return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would say not to take title's type into account. aria || title

Copy link
Member Author

Choose a reason for hiding this comment

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

it fails TS, it's not smart enough

@talkor talkor merged commit 28dff21 into master Feb 8, 2024
11 checks passed
@talkor talkor deleted the feat/menu-item/use-title-component branch February 8, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants