Conversation
Codecov Report
@@ Coverage Diff @@
## master #73 +/- ##
==========================================
- Coverage 86.27% 86.05% -0.22%
==========================================
Files 39 39
Lines 663 667 +4
Branches 99 102 +3
==========================================
+ Hits 572 574 +2
- Misses 88 90 +2
Partials 3 3
Continue to review full report at Codecov.
|
| Icon.create(this.props.icon, { | ||
| defaultProps: { xSpacing: !!content ? 'after' : 'none' }, | ||
| })} | ||
| {content} |
There was a problem hiding this comment.
Should we consider using the Layout component for aligning the content inside the MenuItem? Are there going to be other types of menus with media in the start and end?
There was a problem hiding this comment.
Good point. I would suggest leaving it as it is for now and refactor by adding Layout later as new requirements for the component come.
| render() { | ||
| return <Menu icons defaultActiveIndex={0} items={items} /> | ||
| } | ||
| } |
There was a problem hiding this comment.
This could be stateless for brevity.
| <Menu.Item active={activeItem === 'a'} onClick={this.handleItemClick('a')}> | ||
| <Icon name="home" xSpacing="after" /> | ||
| Home | ||
| </Menu.Item> |
There was a problem hiding this comment.
If we are removing shorthand, shouldn't this example be removed?
| examplePath="components/Menu/Variations/MenuExampleWithIcons" | ||
| /> | ||
| <ComponentExample | ||
| title="Vertical Menu with Icons" |
There was a problem hiding this comment.
Titles should reflect props when possible:
"Vertical Icon" for <Menu vertical icon />
src/components/Menu/MenuItem.tsx
Outdated
| onClick={this.handleClick} | ||
| {...accessibility.attributes.anchor} | ||
| > | ||
| {this.props.icon && |
There was a problem hiding this comment.
Please use destructuring for consistency.
src/components/Menu/Menu.tsx
Outdated
| 'className', | ||
| 'defaultActiveIndex', | ||
| 'fluid', | ||
| 'icons', |
There was a problem hiding this comment.
icon and icons props may confuse users. Proposal:
There is no icon prop for Menu yet, propose we use <Menu icon /> to signify the type of the menu.
There is an icon prop already for Menu.Item, propose we use <Menu.item iconOnly /> to signify there is an icon only and no content.
Thoughts?
There was a problem hiding this comment.
- Agree that
iconvsiconsonMenuItemis confusing. - But in your proposal
iconproperty means something different inMenuandMenuItem- are we ok with that? - Or we can use
iconOnlyinMenuas well.
There was a problem hiding this comment.
Let's go with iconOnly for now, I will post an RFC about icon type components. There are many considerations beyond the scope of this PR.
API Proposal
stardust-ui/react-old#121
Menu Items with icons
MenuItems can now contain icons:
Menu can also consist of Icons only (no text):


Icons only menu intentionally has no spacing between items. In Teams, the free space around the icons is part of the SVG icons. If there is spacing required, it can be achived using
IMenuVariables.iconsMenuItemSpacingProblems
TODO