From b094c4c49322ae2ff524c9e0bae3e4f13de88557 Mon Sep 17 00:00:00 2001 From: Nick Baroni Date: Wed, 4 Nov 2015 09:24:29 +0900 Subject: [PATCH] Refactored to remove getTheme method. --- src/badge.jsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/badge.jsx b/src/badge.jsx index eda7a269a77695..af065a1edb50c2 100644 --- a/src/badge.jsx +++ b/src/badge.jsx @@ -49,25 +49,24 @@ export default React.createClass({ muiTheme: newMuiTheme, }); }, - getTheme() { - return this.state.muiTheme.badge; - }, getStyles() { + const theme = this.state.muiTheme.badge; + const backgroundColor = this.props.backgroundColor ? this.props.backgroundColor : this.props.primary - ? this.getTheme().primaryColor + ? theme.primaryColor : this.props.secondary - ? this.getTheme().secondaryColor - : this.getTheme().color; + ? theme.secondaryColor + : theme.color; const labelColor = this.props.labelColor ? this.props.labelColor : this.props.primary - ? this.getTheme().primaryTextColor + ? theme.primaryTextColor : this.props.secondary - ? this.getTheme().secondaryTextColor - : this.getTheme().textColor; + ? theme.secondaryTextColor + : theme.textColor; const style = { root: {