Skip to content

Commit

Permalink
Use the teamToken threaded through from react sdk
Browse files Browse the repository at this point in the history
The bottom left menu now uses the same teamToken that the rest of the components use. This will require changes to react-sdk: matrix-org/matrix-react-sdk#684
  • Loading branch information
Luke Barnard committed Feb 10, 2017
1 parent f2a6d2c commit 78aaf6b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 2 additions & 8 deletions src/components/structures/BottomLeftMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = React.createClass({

propTypes: {
collapsed: React.PropTypes.bool.isRequired,
teamToken: React.PropTypes.string,
},

getInitialState: function() {
Expand All @@ -36,13 +37,6 @@ module.exports = React.createClass({
homeHover: false,
peopleHover : false,
settingsHover : false,
teamToken: null,
});
},

componentWillMount: function() {
this.setState({
teamToken: window.localStorage.getItem('mx_team_token'),
});
},

Expand Down Expand Up @@ -122,7 +116,7 @@ module.exports = React.createClass({
var TintableSvg = sdk.getComponent('elements.TintableSvg');

var homeButton;
if (this.state.teamToken) {
if (this.props.teamToken) {
homeButton = (
<AccessibleButton className="mx_BottomLeftMenu_homePage" onClick={ this.onHomeClick } onMouseEnter={ this.onHomeMouseEnter } onMouseLeave={ this.onHomeMouseLeave } >
<TintableSvg src="img/icons-home.svg" width="25" height="25" />
Expand Down
7 changes: 6 additions & 1 deletion src/components/structures/LeftPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ var CallHandler = require("matrix-react-sdk/lib/CallHandler");
var LeftPanel = React.createClass({
displayName: 'LeftPanel',

propTypes: {
collapsed: React.PropTypes.bool.isRequired,
teamToken: React.PropTypes.string,
},

getInitialState: function() {
return {
showCallElement: null,
Expand Down Expand Up @@ -124,7 +129,7 @@ var LeftPanel = React.createClass({
collapsed={this.props.collapsed}
searchFilter={this.state.searchFilter}
ConferenceHandler={VectorConferenceHandler} />
<BottomLeftMenu collapsed={this.props.collapsed}/>
<BottomLeftMenu collapsed={this.props.collapsed} teamToken={this.props.teamToken}/>
</aside>
);
}
Expand Down

0 comments on commit 78aaf6b

Please sign in to comment.