Skip to content

Commit 78aaf6b

Browse files
author
Luke Barnard
committed
Use the teamToken threaded through from react sdk
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
1 parent f2a6d2c commit 78aaf6b

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎src/components/structures/BottomLeftMenu.js‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module.exports = React.createClass({
2727

2828
propTypes: {
2929
collapsed: React.PropTypes.bool.isRequired,
30+
teamToken: React.PropTypes.string,
3031
},
3132

3233
getInitialState: function() {
@@ -36,13 +37,6 @@ module.exports = React.createClass({
3637
homeHover: false,
3738
peopleHover : false,
3839
settingsHover : false,
39-
teamToken: null,
40-
});
41-
},
42-
43-
componentWillMount: function() {
44-
this.setState({
45-
teamToken: window.localStorage.getItem('mx_team_token'),
4640
});
4741
},
4842

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

124118
var homeButton;
125-
if (this.state.teamToken) {
119+
if (this.props.teamToken) {
126120
homeButton = (
127121
<AccessibleButton className="mx_BottomLeftMenu_homePage" onClick={ this.onHomeClick } onMouseEnter={ this.onHomeMouseEnter } onMouseLeave={ this.onHomeMouseLeave } >
128122
<TintableSvg src="img/icons-home.svg" width="25" height="25" />

‎src/components/structures/LeftPanel.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ var CallHandler = require("matrix-react-sdk/lib/CallHandler");
2828
var LeftPanel = React.createClass({
2929
displayName: 'LeftPanel',
3030

31+
propTypes: {
32+
collapsed: React.PropTypes.bool.isRequired,
33+
teamToken: React.PropTypes.string,
34+
},
35+
3136
getInitialState: function() {
3237
return {
3338
showCallElement: null,
@@ -124,7 +129,7 @@ var LeftPanel = React.createClass({
124129
collapsed={this.props.collapsed}
125130
searchFilter={this.state.searchFilter}
126131
ConferenceHandler={VectorConferenceHandler} />
127-
<BottomLeftMenu collapsed={this.props.collapsed}/>
132+
<BottomLeftMenu collapsed={this.props.collapsed} teamToken={this.props.teamToken}/>
128133
</aside>
129134
);
130135
}

0 commit comments

Comments
 (0)