From 12c19e3390fa501b25b1b746ddc3f48e525d7fff Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Sun, 19 Jul 2015 20:31:37 -0700 Subject: Added channel name to RHS comment threads; minor css changes to compensate for addition --- web/react/components/post_right.jsx | 6 ++++++ web/react/components/search_results.jsx | 2 +- web/sass-files/sass/partials/_post_right.scss | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/web/react/components/post_right.jsx b/web/react/components/post_right.jsx index cc6751738..9ec9d8eaf 100644 --- a/web/react/components/post_right.jsx +++ b/web/react/components/post_right.jsx @@ -68,6 +68,7 @@ RootPost = React.createClass({ var filenames = this.props.post.filenames; var isOwner = UserStore.getCurrentId() == this.props.post.user_id; var timestamp = UserStore.getProfile(this.props.post.user_id).update_at; + var channel = ChannelStore.get(this.props.post.channel_id); var type = "Post"; if (this.props.post.root_id.length > 0) { @@ -79,6 +80,10 @@ RootPost = React.createClass({ currentUserCss = "current--user"; } + if (channel) { + channelName = (channel.type === 'D') ? "Private Message" : channel.display_name; + } + if (filenames) { var postFiles = []; var images = []; @@ -118,6 +123,7 @@ RootPost = React.createClass({ return (
+
{ channelName }
diff --git a/web/react/components/search_results.jsx b/web/react/components/search_results.jsx index 1fd974642..643ad112b 100644 --- a/web/react/components/search_results.jsx +++ b/web/react/components/search_results.jsx @@ -77,7 +77,7 @@ var SearchItem = React.createClass({ var message = utils.textToJsx(this.props.post.message, {searchTerm: this.props.term, noMentionHighlight: !this.props.isMentionSearch}); var channelName = ""; - var channel = ChannelStore.get(this.props.post.channel_id) + var channel = ChannelStore.get(this.props.post.channel_id); var timestamp = UserStore.getCurrentUser().update_at; if (channel) { diff --git a/web/sass-files/sass/partials/_post_right.scss b/web/sass-files/sass/partials/_post_right.scss index 8816393c8..4cf3e32a1 100644 --- a/web/sass-files/sass/partials/_post_right.scss +++ b/web/sass-files/sass/partials/_post_right.scss @@ -11,7 +11,7 @@ .post { &.post--root { - padding: 1em 1em 0; + padding: 0 1em 0; margin: 1em 0; hr { border-color: #DDD; @@ -62,6 +62,11 @@ } } +.post-right-channel__name { + font-weight: 600; + margin: 0 0 10px 0; +} + .post-right-root-container li { display: inline; list-style-type: none; -- cgit v1.2.3-1-g7c22