-
Notifications
You must be signed in to change notification settings - Fork 78
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: props spreading to Menu #236
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging blocked until fundamental-bot admin rights are restored.
src/Menu/Menu.Component.js
Outdated
{ | ||
name: 'titleProps', | ||
description: 'object - additional props to be spread to the Menu Group title' | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addonProps
and linkProps
are actually for the MenuItem
component and the titleProps
are actually for the MenuGroup
component. That said, I would like to circle back in another story and adjust the documentation pages to properly define all the components AND sub components AND each of their respective props better.
See #238
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a good start -- certainly good enough for this PR. 👍 I created #238 for a more widespread change across all component pages for a later date.
src/Menu/Menu.js
Outdated
{children} | ||
</Link> | ||
} | ||
{url && | ||
<a className={`fd-menu__item${isLink ? ' fd-menu__link' : ''}`} href={url}> | ||
<a {...linkProps} className={`fd-menu__item${isLink ? ' fd-menu__link' : ''}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do <Link>
and <a>
need separate props. Maybe a urlProps
for the latter? I'm not quite sure why both exist either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added new prop - urlProps for elements
src/Menu/Menu.test.js
Outdated
<MemoryRouter> | ||
<Menu> | ||
<MenuList> | ||
<MenuItem linkProps={{ 'data-sample': 'Sample' }} url='/' /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per comment above, should this be a new prop (urlProps
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New prop - urlProps added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. 🚢
* fix: props spreading to Menu * added urlProps spread * update to documentation for Menu subcomponents
Add props spreading to the Menu component