Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions docs/src/app/components/pages/components/snackbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ var ComponentDoc = require('../../component-doc.jsx');
var SnackbarPage = React.createClass({

render: function() {
var code = '<Snackbar message="Time for a snack" action="dismiss" />';
var code =
'<Snackbar\n' +
' message="Event added to your calendar"\n' +
' action="undo"\n' +
' onActionTouchTap={this._handleAction}/>\n\n' +
'//Somewhere in our code\n' +
'_handleAction: function() {\n' +
' //We can add more code to this function, but for now we\'ll just include an alert.\n' +
' alert("We removed the event from your calendar.");\n' +
'}';
;

var componentInfo = [
{
Expand Down Expand Up @@ -66,15 +76,27 @@ var SnackbarPage = React.createClass({
code={code}
componentInfo={componentInfo}>

<RaisedButton onClick={this._handleClick} label="Show Snackbar" />
<Snackbar ref="snackbar" message="Time for a snack" action="dismiss" />
<RaisedButton
onClick={this._handleClick}
label="Add to my calendar" />

<Snackbar
ref="snackbar"
message="Event added to your calendar"
action="undo"
onActionTouchTap={this._handleAction} />

</ComponentDoc>
);
},

_handleClick: function(e) {
this.refs.snackbar.show();
},

_handleAction: function() {
//We can add more code here! In this example, we'll just include an alert.
alert("We removed the event from your calendar.");
}

});
Expand Down