Skip to content

Instantly share code, notes, and snippets.

@DrBoolean
Last active August 27, 2015 00:19
Show Gist options
  • Select an option

  • Save DrBoolean/b25a627be5e28ec8b761 to your computer and use it in GitHub Desktop.

Select an option

Save DrBoolean/b25a627be5e28ec8b761 to your computer and use it in GitHub Desktop.
Blog post about salesforce design system + react 6
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