Skip to content

Commit

Permalink
Merge pull request #3229 from newoga/#2852/left-nav
Browse files Browse the repository at this point in the history
[LeftNav] Remove style-propable mixin
  • Loading branch information
oliviertassinari committed Feb 8, 2016
2 parents 61014dc + a329174 commit 9283a6f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/left-nav.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import KeyCode from './utils/key-code';
import StylePropable from './mixins/style-propable';
import autoPrefix from './styles/auto-prefix';
import Transitions from './styles/transitions';
import WindowListenable from './mixins/window-listenable';
Expand Down Expand Up @@ -89,13 +88,11 @@ const LeftNav = React.createClass({
muiTheme: React.PropTypes.object,
},

//for passing default theme context to children
childContextTypes: {
muiTheme: React.PropTypes.object,
},

mixins: [
StylePropable,
WindowListenable,
],

Expand Down Expand Up @@ -133,11 +130,8 @@ const LeftNav = React.createClass({
this._enableSwipeHandling();
},

//to update theme inside state whenever a new theme is passed down
//from the parent / owner using context
componentWillReceiveProps(nextProps, nextContext) {
const newMuiTheme = nextContext.muiTheme ? nextContext.muiTheme : this.state.muiTheme;
const newState = {muiTheme: newMuiTheme};
const newState = {muiTheme: nextContext.muiTheme || this.state.muiTheme};

// If docked is changed, change the open state for when uncontrolled.
if (this.props.docked !== nextProps.docked) newState.open = nextProps.docked;
Expand Down Expand Up @@ -383,7 +377,7 @@ const LeftNav = React.createClass({
ref="overlay"
show={this._shouldShow()}
className={overlayClassName}
style={this.mergeStyles(styles.overlay, overlayStyle)}
style={Object.assign(styles.overlay, overlayStyle)}
transitionEnabled={!this.state.swiping}
onTouchTap={this._onOverlayTouchTap}
/>
Expand All @@ -399,7 +393,7 @@ const LeftNav = React.createClass({
rounded={false}
transitionEnabled={!this.state.swiping}
className={className}
style={this.mergeStyles(styles.root, openRight && styles.rootWhenOpenRight, style)}
style={Object.assign(styles.root, openRight && styles.rootWhenOpenRight, style)}
>
{children}
</Paper>
Expand Down

0 comments on commit 9283a6f

Please sign in to comment.