summaryrefslogtreecommitdiffstats
path: root/web/react/components
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-10-01 17:52:47 -0700
committer=Corey Hulen <corey@hulen.com>2015-10-01 17:52:47 -0700
commit430806301da06e927b8d7d6dcba20ea4b6b6d6c1 (patch)
tree8a457efc7d5570679c3a2ae607b0a52f79cfa981 /web/react/components
parent013df9f6614fcf8816dc29bc8f07d05a605e47e0 (diff)
downloadchat-430806301da06e927b8d7d6dcba20ea4b6b6d6c1.tar.gz
chat-430806301da06e927b8d7d6dcba20ea4b6b6d6c1.tar.bz2
chat-430806301da06e927b8d7d6dcba20ea4b6b6d6c1.zip
PLT-44 allow team switching without the need to login
Diffstat (limited to 'web/react/components')
-rw-r--r--web/react/components/navbar_dropdown.jsx10
-rw-r--r--web/react/components/sidebar.jsx4
-rw-r--r--web/react/components/sidebar_header.jsx3
3 files changed, 12 insertions, 5 deletions
diff --git a/web/react/components/navbar_dropdown.jsx b/web/react/components/navbar_dropdown.jsx
index 57a78a0d4..dc5983f1e 100644
--- a/web/react/components/navbar_dropdown.jsx
+++ b/web/react/components/navbar_dropdown.jsx
@@ -142,10 +142,10 @@ export default class NavbarDropdown extends React.Component {
>
</li>
);
- if (this.state.teams.length > 1 && this.state.currentTeam) {
- var curTeamName = this.state.currentTeam.name;
+
+ if (this.state.teams.length > 1) {
this.state.teams.forEach((teamName) => {
- if (teamName !== curTeamName) {
+ if (teamName !== this.props.teamName) {
teams.push(<li key={teamName}><a href={Utils.getWindowLocationOrigin() + '/' + teamName}>{'Switch to ' + teamName}</a></li>);
}
});
@@ -234,5 +234,7 @@ NavbarDropdown.defaultProps = {
teamType: ''
};
NavbarDropdown.propTypes = {
- teamType: React.PropTypes.string
+ teamType: React.PropTypes.string,
+ teamDisplayName: React.PropTypes.string,
+ teamName: React.PropTypes.string
};
diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx
index 6033f200f..dfaa4c794 100644
--- a/web/react/components/sidebar.jsx
+++ b/web/react/components/sidebar.jsx
@@ -508,6 +508,7 @@ export default class Sidebar extends React.Component {
/>
<SidebarHeader
teamDisplayName={this.props.teamDisplayName}
+ teamName={this.props.teamName}
teamType={this.props.teamType}
/>
<SearchBox />
@@ -587,5 +588,6 @@ Sidebar.defaultProps = {
};
Sidebar.propTypes = {
teamType: React.PropTypes.string,
- teamDisplayName: React.PropTypes.string
+ teamDisplayName: React.PropTypes.string,
+ teamName: React.PropTypes.string
};
diff --git a/web/react/components/sidebar_header.jsx b/web/react/components/sidebar_header.jsx
index 072c14e0a..33de35064 100644
--- a/web/react/components/sidebar_header.jsx
+++ b/web/react/components/sidebar_header.jsx
@@ -52,6 +52,8 @@ export default class SidebarHeader extends React.Component {
<NavbarDropdown
ref='dropdown'
teamType={this.props.teamType}
+ teamDisplayName={this.props.teamDisplayName}
+ teamName={this.props.teamName}
/>
</div>
);
@@ -64,5 +66,6 @@ SidebarHeader.defaultProps = {
};
SidebarHeader.propTypes = {
teamDisplayName: React.PropTypes.string,
+ teamName: React.PropTypes.string,
teamType: React.PropTypes.string
};