Clean up Item JSX (#7584)

feature/default_network_editable
Whymarrh Whitby 5 years ago committed by GitHub
parent 359be03db8
commit 867dcc48ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      ui/app/components/app/dropdowns/components/menu.js

@ -38,10 +38,6 @@ function Item (props) {
const itemClassName = classnames('menu__item', className, {
'menu__item--clickable': Boolean(onClick),
})
const iconComponent = icon ? <div className="menu__item__icon">{icon}</div> : null
const textComponent = text ? <div className="menu__item__text">{text}</div> : null
const subTextComponent = subText ? <div className="menu__item__subtext">{subText}</div> : null
return children
? <div className={itemClassName} onClick={onClick}>{children}</div>
: (
@ -49,7 +45,9 @@ function Item (props) {
className={itemClassName}
onClick={onClick}
>
{[ iconComponent, textComponent, subTextComponent ].filter(d => Boolean(d))}
{icon ? <div className="menu__item__icon">{icon}</div> : null}
{text ? <div className="menu__item__text">{text}</div> : null}
{subText ? <div className="menu__item__subtext">{subText}</div> : null}
</div>
)
}

Loading…
Cancel
Save