Skip to content

Instantly share code, notes, and snippets.

View DrBoolean's full-sized avatar

Brian Lonsdorf DrBoolean

View GitHub Profile
@DrBoolean
DrBoolean / app_2.js
Created August 25, 2015 22:52
Blog post about salesforce design system + react 2
var App = React.createClass({
render: function() {
return (
<div>
<Notification>
<h2 className="slds-text-heading--small">Beware of the Trash Dragons!</h2>
</Notification>
</div>
);
@DrBoolean
DrBoolean / app_1.js
Last active August 26, 2015 17:17
Blog post about salesforce design system + react
var React = require('react');
var Notification = require('./notification');
var App = React.createClass({
render: function() {
return (
<div>
<Notification />
</div>
@DrBoolean
DrBoolean / notification_2.js
Last active August 26, 2015 17:17
Blog post about salesforce design system + react 4
render: function() {
return (
<div className="slds-notify-container">
<div className="slds-notify slds-notify--alert" role="alert">
<span className="slds-assistive-text">info</span>
<button className="slds-button slds-notify__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>
@DrBoolean
DrBoolean / app_3.js
Created August 26, 2015 17:36
Blog post about salesforce design system + react 8
var App = React.createClass({
render: function() {
return (
<div>
<Notification.Toast theme="error">
<h2 className="slds-text-heading--small">Beware of the Trash Dragons!</h2>
</Notification.Toast>
</div>
);
@DrBoolean
DrBoolean / notification_1.js
Last active August 26, 2015 17:58
Blog post about salesforce design system + react 3
var React = require('react');
var Notification = React.createClass({
render: function() {
return <div />;
}
}
module.exports = Notification;
@DrBoolean
DrBoolean / notification_3.js
Last active August 26, 2015 21:45
Blog post about salesforce design system + react 5
render: function() {
return (
<div className="slds-notify-container">
<div className="slds-notify slds-notify--alert" role="alert">
<span className="slds-assistive-text">info</span>
<button className="slds-button slds-notify__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>
@DrBoolean
DrBoolean / app_4.js
Created August 26, 2015 23:36
Blog post about salesforce design system + react n
var App = React.createClass({
render: function() {
return (
<div>
<Notification theme="error">
<h2 className="slds-text-heading--small">Beware of the Trash Dragons!</h2>
</Notification>
</div>
);
@DrBoolean
DrBoolean / notification_4.js
Last active August 27, 2015 00:19
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">
@DrBoolean
DrBoolean / notification_5.js
Last active August 27, 2015 00:20
Blog post about salesforce design system + react 7
var Notification = function(variant) {
var comp = React.createClass({
render: function() {
var theme = this.props.theme || 'info';
var themeClass = 'slds-theme--' + theme;
var className = "slds-notify slds-notify--" + variant + ' ' + themeClass;
return (
<div className="slds-notify-container">
<div className={className} role="alert">
@DrBoolean
DrBoolean / NEL.js
Last active August 29, 2015 14:06
Non empty list comonad in js
var _One = function(v) {
this.value = v;
};
var _Many = function(v, vs) {
this.value = v;
this.tail = vs;
};
var One = function(x) { return new _One(x); };