Skip to content

Commit

Permalink
Refactored to remove getTheme method.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Baroni committed Nov 4, 2015
1 parent 3e9e379 commit b094c4c
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/badge.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit b094c4c

Please sign in to comment.