summaryrefslogtreecommitdiffstats
path: root/web/react/components
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-11-11 12:53:18 -0500
committerJoramWilander <jwawilander@gmail.com>2015-11-11 12:53:18 -0500
commit782709aa56d8e3ad9d65cd05f33640887d771b89 (patch)
treeacf53dd7a00cfa083e4226cd97b63ee3cdbbec48 /web/react/components
parente32b92052e48a37e7989d89d5969ea9a13ca43ae (diff)
downloadchat-782709aa56d8e3ad9d65cd05f33640887d771b89.tar.gz
chat-782709aa56d8e3ad9d65cd05f33640887d771b89.tar.bz2
chat-782709aa56d8e3ad9d65cd05f33640887d771b89.zip
Fix channel invite button on channel intro message and fix empty channel invite modal.
Diffstat (limited to 'web/react/components')
-rw-r--r--web/react/components/posts_view_container.jsx12
-rw-r--r--web/react/components/sidebar.jsx2
2 files changed, 11 insertions, 3 deletions
diff --git a/web/react/components/posts_view_container.jsx b/web/react/components/posts_view_container.jsx
index 5037a86cd..8b92a26a7 100644
--- a/web/react/components/posts_view_container.jsx
+++ b/web/react/components/posts_view_container.jsx
@@ -3,6 +3,7 @@
const PostsView = require('./posts_view.jsx');
const LoadingScreen = require('./loading_screen.jsx');
+const ChannelInviteModal = require('./channel_invite_modal.jsx');
const ChannelStore = require('../stores/channel_store.jsx');
const PostStore = require('../stores/post_store.jsx');
@@ -50,6 +51,7 @@ export default class PostsViewContainer extends React.Component {
});
}
+ state.showInviteModal = false;
this.state = state;
}
componentDidMount() {
@@ -248,7 +250,7 @@ export default class PostsViewContainer extends React.Component {
postViewScrolled={this.handlePostsViewScroll}
loadMorePostsTopClicked={this.loadMorePostsTop}
numPostsToDisplay={this.state.numPostsToDisplay}
- introText={channel ? createChannelIntroMessage(channel) : null}
+ introText={channel ? createChannelIntroMessage(channel, () => this.setState({showInviteModal: true})) : null}
messageSeparatorTime={this.state.currentLastViewed}
/>
);
@@ -263,7 +265,13 @@ export default class PostsViewContainer extends React.Component {
}
return (
- <div id='post-list'>{postListCtls}</div>
+ <div id='post-list'>
+ {postListCtls}
+ <ChannelInviteModal
+ show={this.state.showInviteModal}
+ onModalDismissed={() => this.setState({showInviteModal: false})}
+ />
+ </div>
);
}
}
diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx
index f5ce5c10e..0b1abe4fe 100644
--- a/web/react/components/sidebar.jsx
+++ b/web/react/components/sidebar.jsx
@@ -142,7 +142,7 @@ export default class Sidebar extends React.Component {
}
}
- const hiddenDirectChannelCount = UserStore.getActiveOnlyProfileList().length - visibleDirectChannels.length;
+ const hiddenDirectChannelCount = UserStore.getActiveOnlyProfileList(true).length - visibleDirectChannels.length;
visibleDirectChannels.sort(this.sortChannelsByDisplayName);