-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat(Modal): Add closeIcon #932
Conversation
@@ -45,9 +47,18 @@ class Modal extends Component { | |||
/** Additional classes. */ | |||
className: PropTypes.string, | |||
|
|||
/** Icon */ | |||
closeIcon: PropTypes.oneOfType([ | |||
PropTypes.node, |
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.
How about allowing boolean as well? I would think closeIcon
alone would be the primary use case for this prop.
I believe this also fixes #436, if so, want to update the description to close it on merge? |
@levithomason - you're right, added that issue to the description 👍 |
Cool, what do you think about the boolean prop for the default |
Added in da00365 👍 |
👍 will merge on pass |
Current coverage is 100% (diff: 100%)@@ master #932 diff @@
====================================
Files 137 137
Lines 2262 2267 +5
Methods 0 0
Messages 0 0
Branches 0 0
====================================
+ Hits 2262 2267 +5
Misses 0 0
Partials 0 0
|
Released in |
* feat(Modal): Add closeIcon * Default closeIcon to `close` if closeIcon=true
Fixes #436
Given #893 is a little controversial due to the reliance on the DOM and data props, this solves a more acute need of adding a close icon to the
Modal
, which is standard in SUI core (see http://semantic-ui.com/modules/modal.html#/usage):While this mixes shorthand with children, I think it's reasonable given:
Message
: https://github.com/Semantic-Org/Semantic-UI-React/blob/master/src/collections/Message/Message.js#L74-L81)open
state yourself, which I think is overkill for something as simple/common as the close icon.closeIcon='whatever'
. And even then, by default it's absolutely positioned so it doesn't affect the rest of the markup at all.