Last active
August 27, 2015 00:19
-
-
Save DrBoolean/b25a627be5e28ec8b761 to your computer and use it in GitHub Desktop.
Blog post about salesforce design system + react 6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Notification = React.createClass({ | |
| render: function() { | |
| var theme = this.props.theme || 'info'; | |
| var themeClass = 'slds-theme--' + theme; | |
| var className = "slds-notify slds-notify-alert " + themeClass; | |
| return ( | |
| <div className="slds-notify-container"> | |
| <div className={className} role="alert"> | |
| <span className="slds-assistive-text">{theme}</span> | |
| <button className="slds-button close slds-icon--small"> | |
| <svg aria-hidden="true" className="slds-button__icon slds-button__icon--inverse" dangerouslySetInnerHTML={{__html:'<use xlink:href="/assets/icons/action-sprite/svg/symbols.svg#close"></use>'}}> | |
| </svg> | |
| <span className="slds-assistive-text">Close</span> | |
| </button> | |
| {this.props.children} | |
| </div> | |
| </div> | |
| ); | |
| } | |
| }); | |
| Notification.propTypes = {theme: React.PropTypes.oneOf(['success', 'warn', 'error', 'info'])}; | |
| module.exports = Notification; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment