Skip to content

Commit

Permalink
Merge pull request #1454 from cozy/action-menu-improvs
Browse files Browse the repository at this point in the history
ActionMenu improvements
  • Loading branch information
probot-auto-merge[bot] authored Apr 30, 2020
2 parents 9495576 + d3b5125 commit 4bdc571
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
20 changes: 15 additions & 5 deletions react/ActionMenu/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,23 @@ ActionMenu.defaultProps = {
autoclose: false
}

const ActionMenuHeader = ({ children }) => {
return <div className={styles['c-actionmenu-header']}>{children}</div>
const ActionMenuHeader = ({ children, className }) => {
return (
<div className={cx(styles['c-actionmenu-header'], className)}>
{children}
</div>
)
}

ActionMenuHeader.propTypes = {
children: PropTypes.node,
className: PropTypes.string
}

const ActionMenuItem = ({ left, children, right, onClick }) => {
const ActionMenuItem = ({ left, children, right, onClick, className }) => {
return (
<Media
className={styles['c-actionmenu-item']}
className={cx(styles['c-actionmenu-item'], className)}
onClick={onClick}
align="top"
>
Expand All @@ -151,7 +160,8 @@ ActionMenuItem.propTypes = {
left: PropTypes.node,
right: PropTypes.node,
children: PropTypes.node,
onClick: PropTypes.func
onClick: PropTypes.func,
className: PropTypes.string
}
export default withBreakpoints()(ActionMenu)
export { ActionMenuHeader, ActionMenuItem }
2 changes: 1 addition & 1 deletion stylus/components/action-menu.styl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

$actionmenu
@extend $popover

color var(--charcoalGrey)
hr
margin-top 0

Expand Down

0 comments on commit 4bdc571

Please sign in to comment.