From 80c03083f274b8dffb56923f35d3382b1686d278 Mon Sep 17 00:00:00 2001 From: Manuel Mazzuola Date: Tue, 10 Nov 2015 11:15:28 +0100 Subject: [PATCH 1/3] [Snackbar] Custom body style Merge the body style with a custom style passed by properties --- src/snackbar.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/snackbar.jsx b/src/snackbar.jsx index 129e4b381bb2d7..24e452f8312333 100644 --- a/src/snackbar.jsx +++ b/src/snackbar.jsx @@ -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 @@ -215,6 +216,7 @@ const Snackbar = React.createClass({ const { onActionTouchTap, style, + bodyStyle, ...others, } = this.props; const styles = this.getStyles(); @@ -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 (
-
+
{message} {actionButton} From f8bfcf26a48cc4fe95e7320b7d1f9dddb64146ae Mon Sep 17 00:00:00 2001 From: Manuel Mazzuola Date: Tue, 10 Nov 2015 11:23:51 +0100 Subject: [PATCH 2/3] Add missing trailing comma --- src/snackbar.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/snackbar.jsx b/src/snackbar.jsx index 24e452f8312333..5a4b7967bdec66 100644 --- a/src/snackbar.jsx +++ b/src/snackbar.jsx @@ -63,7 +63,7 @@ const Snackbar = React.createClass({ onDismiss: React.PropTypes.func, openOnMount: React.PropTypes.bool, style: React.PropTypes.object, - bodyStyle: React.PropTypes.object + bodyStyle: React.PropTypes.object, }, //for passing default theme context to children From 369021df8fb83e26835da55b90e5a896813b7f20 Mon Sep 17 00:00:00 2001 From: Manuel Mazzuola Date: Tue, 10 Nov 2015 11:32:12 +0100 Subject: [PATCH 3/3] [Snackbar] Add bodyStyle documentation --- docs/src/app/components/pages/components/snackbar.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/src/app/components/pages/components/snackbar.jsx b/docs/src/app/components/pages/components/snackbar.jsx index b6684f7d67fef7..074e3dd9ecbba2 100644 --- a/docs/src/app/components/pages/components/snackbar.jsx +++ b/docs/src/app/components/pages/components/snackbar.jsx @@ -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.', + }, ], }, {