Skip to content

Commit

Permalink
[AppBar] Add iconStyleLeft prop (fix #3667)
Browse files Browse the repository at this point in the history
  • Loading branch information
59naga committed Mar 11, 2016
1 parent d768a13 commit 91e90bb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/app-bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ const AppBar = React.createClass({
*/
iconElementRight: React.PropTypes.element,

/**
* Override the inline-styles of the element displayed on the left side of the app bar.
*/
iconStyleLeft: React.PropTypes.object,

/**
* Override the inline-styles of the element displayed on the right side of the app bar.
*/
Expand Down Expand Up @@ -216,6 +221,7 @@ const AppBar = React.createClass({
const {
title,
titleStyle,
iconStyleLeft,
iconStyleRight,
showMenuIconButton,
iconElementLeft,
Expand Down Expand Up @@ -247,6 +253,8 @@ const AppBar = React.createClass({
style: prepareStyles(Object.assign(styles.title, styles.mainElement, titleStyle)),
}, title);

const iconLeftStyle = Object.assign({}, styles.iconButtonStyle, iconStyleLeft);

if (showMenuIconButton) {
let iconElementLeftNode = iconElementLeft;

Expand All @@ -260,15 +268,15 @@ const AppBar = React.createClass({
}

menuElementLeft = (
<div style={prepareStyles(Object.assign({}, styles.iconButtonStyle))}>
<div style={prepareStyles(iconLeftStyle)}>
{iconElementLeftNode}
</div>
);
} else {
const child = iconClassNameLeft ? '' : <NavigationMenu style={Object.assign({}, styles.iconButtonIconStyle)} />;
menuElementLeft = (
<IconButton
style={styles.iconButtonStyle}
style={iconLeftStyle}
iconStyle={styles.iconButtonIconStyle}
iconClassName={iconClassNameLeft}
onTouchTap={this._onLeftIconButtonTouchTap}
Expand Down

0 comments on commit 91e90bb

Please sign in to comment.