Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snackbar style #2104

Merged
merged 3 commits into from
Nov 10, 2015
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions docs/src/app/components/pages/components/snackbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ export default class SnackbarPage extends React.Component {
header: 'optional',
desc: 'Override the inline-styles of the Snackbar\'s root element.',
},
{
name: 'bodyStyle',
type: 'object',
header: 'optional',
desc: 'Override the inline-styles of the Snackbar\'s body element.',
},
],
},
{
Expand Down
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