chore: allow for children in MenuItemTitle

This commit is contained in:
Roman Hotsiy 2018-05-18 15:09:30 +03:00
parent 59571596c0
commit e13d172502
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -47,10 +47,13 @@ export class MenuItem extends React.Component<MenuItemProps> {
data-item-id={item.id}
>
{item.type === 'operation' ? (
<OperationMenuItemContent item={item as OperationModel} />
<OperationMenuItemContent {...this.props} item={item as OperationModel} />
) : (
<MenuItemLabel depth={item.depth} active={item.active} type={item.type}>
<MenuItemTitle title={item.name}>{item.name}</MenuItemTitle>
<MenuItemTitle title={item.name}>
{item.name}
{this.props.children}
</MenuItemTitle>
{(item.depth > 0 &&
item.items.length > 0 && (
<ShelfIcon float={'right'} direction={item.active ? 'down' : 'right'} />
@ -85,7 +88,10 @@ class OperationMenuItemContent extends React.Component<OperationMenuItemContentP
deprecated={item.deprecated}
>
<OperationBadge type={item.httpVerb} />
<MenuItemTitle width="calc(100% - 32px)">{item.name}</MenuItemTitle>
<MenuItemTitle width="calc(100% - 32px)">
{item.name}
{this.props.children}
</MenuItemTitle>
</MenuItemLabel>
);
}