Skip to content

Commit

Permalink
[Snackbar] Custom body style
Browse files Browse the repository at this point in the history
Merge the body style with a custom style
passed by properties
  • Loading branch information
Manuel Mazzuola committed Nov 10, 2015
1 parent 615c4eb commit 80c0308
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/snackbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const Snackbar = React.createClass({
onDismiss: React.PropTypes.func,
openOnMount: React.PropTypes.bool,
style: React.PropTypes.object,
bodyStyle: React.PropTypes.object
},

//for passing default theme context to children
Expand Down Expand Up @@ -215,6 +216,7 @@ const Snackbar = React.createClass({
const {
onActionTouchTap,
style,
bodyStyle,
...others,
} = this.props;
const styles = this.getStyles();
Expand All @@ -239,11 +241,13 @@ const Snackbar = React.createClass({
);
}

const mergedBodyStyle = this.mergeStyles(styles.body, bodyStyle);

const contentStyle = open ? this.mergeStyles(styles.content, styles.contentWhenOpen) : styles.content;

return (
<div {...others} style={rootStyles}>
<div style={styles.body}>
<div style={mergedBodyStyle}>
<div style={contentStyle}>
<span>{message}</span>
{actionButton}
Expand Down

0 comments on commit 80c0308

Please sign in to comment.