Skip to content

Commit b094c4c

Browse files
author
Nick Baroni
committed
Refactored to remove getTheme method.
1 parent 3e9e379 commit b094c4c

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/badge.jsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,24 @@ export default React.createClass({
4949
muiTheme: newMuiTheme,
5050
});
5151
},
52-
getTheme() {
53-
return this.state.muiTheme.badge;
54-
},
5552
getStyles() {
53+
const theme = this.state.muiTheme.badge;
54+
5655
const backgroundColor = this.props.backgroundColor
5756
? this.props.backgroundColor
5857
: this.props.primary
59-
? this.getTheme().primaryColor
58+
? theme.primaryColor
6059
: this.props.secondary
61-
? this.getTheme().secondaryColor
62-
: this.getTheme().color;
60+
? theme.secondaryColor
61+
: theme.color;
6362

6463
const labelColor = this.props.labelColor
6564
? this.props.labelColor
6665
: this.props.primary
67-
? this.getTheme().primaryTextColor
66+
? theme.primaryTextColor
6867
: this.props.secondary
69-
? this.getTheme().secondaryTextColor
70-
: this.getTheme().textColor;
68+
? theme.secondaryTextColor
69+
: theme.textColor;
7170

7271
const style = {
7372
root: {

0 commit comments

Comments
 (0)