-
-
Notifications
You must be signed in to change notification settings - Fork 114
Button in menu #256
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
Button in menu #256
Changes from all commits
0ce6685
ee9cd09
5a58113
4187877
7d35bf0
ba86cd1
6fbe513
b720f2e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import PropTypes from 'prop-types'; | ||
| import React, {cloneElement, Component} from 'react'; | ||
| import Button from '../widgets/Button'; | ||
|
|
||
| export default class SingleSidebarItem extends Component { | ||
| render() { | ||
| let {children} = this.props; | ||
| children = React.Children.map(children, child => { | ||
| if (child.type === Button) { | ||
| return cloneElement(child, {className: 'button--menu'}); | ||
| } | ||
| return child; | ||
| }); | ||
| return children ? ( | ||
| <div className="sidebar__item--single">{children}</div> | ||
| ) : null; | ||
| } | ||
| } | ||
|
|
||
| SingleSidebarItem.propTypes = { | ||
| children: PropTypes.any, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| import Button from './Button'; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hadn't added a widget index since widgets are meant to be internal. That said I am using some in the batch app so apparently they are not that internal. I suppose we may as expose more widgets!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we could put Dropdown in here eventually as well (and other useful components folks may wish to use in their apps) |
||
| export {Button}; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,7 +51,9 @@ button { | |
| padding-left: 0; | ||
| } | ||
| } | ||
|
|
||
| &--menu { | ||
| min-width: 75px; | ||
| } | ||
| &--default { | ||
| @include button(); | ||
| } | ||
|
|
||
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.
Yeh I like this API!