summaryrefslogtreecommitdiffstats
path: root/webapp/components/sidebar_right.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-08-04 11:38:09 -0400
committerenahum <nahumhbl@gmail.com>2016-08-04 10:38:09 -0500
commit0184d6059bb1943fb74bf33d1d200a423c5bf5e6 (patch)
tree4b8480d65d5ec181b372a09f946bb7649809a467 /webapp/components/sidebar_right.jsx
parent9b50b5028391ee29922ad5549b785ac2312be368 (diff)
downloadchat-0184d6059bb1943fb74bf33d1d200a423c5bf5e6.tar.gz
chat-0184d6059bb1943fb74bf33d1d200a423c5bf5e6.tar.bz2
chat-0184d6059bb1943fb74bf33d1d200a423c5bf5e6.zip
PLT-3506 Added flagged posts functionality (#3679)
* Added flagged posts functionality * UI Improvements to flags (#3697) * Added flag functionality for mobile * Updating flagged text (#3699) * Add back button to RHS thread when coming from flagged posts * Updating position of flags (#3708) * Plt 3506 - Reverting flag position (#3724) * Revert "Updating position of flags (#3708)" This reverts commit aaa05632c5d9eda35a048300a5bd7e99584c5b58. * Fixing the icon in search * Help text and white space improvements (#3730) * Updatng help text and some white spacing. * Updating help text
Diffstat (limited to 'webapp/components/sidebar_right.jsx')
-rw-r--r--webapp/components/sidebar_right.jsx20
1 files changed, 16 insertions, 4 deletions
diff --git a/webapp/components/sidebar_right.jsx b/webapp/components/sidebar_right.jsx
index 7cdb894cc..6d1184799 100644
--- a/webapp/components/sidebar_right.jsx
+++ b/webapp/components/sidebar_right.jsx
@@ -5,12 +5,16 @@ import $ from 'jquery';
import SearchResults from './search_results.jsx';
import RhsThread from './rhs_thread.jsx';
+
import SearchStore from 'stores/search_store.jsx';
import PostStore from 'stores/post_store.jsx';
import UserStore from 'stores/user_store.jsx';
import PreferenceStore from 'stores/preference_store.jsx';
-import Constants from 'utils/constants.jsx';
+
+import {getFlaggedPosts} from 'actions/post_actions.jsx';
+
import * as Utils from 'utils/utils.jsx';
+import Constants from 'utils/constants.jsx';
import React from 'react';
@@ -101,15 +105,20 @@ export default class SidebarRight extends React.Component {
}
onPreferenceChange() {
+ if (this.state.isFlaggedPosts) {
+ getFlaggedPosts();
+ }
+
this.setState({
useMilitaryTime: PreferenceStore.getBool(Constants.Preferences.CATEGORY_DISPLAY_SETTINGS, Constants.Preferences.USE_MILITARY_TIME, false)
});
}
- onSelectedChange(fromSearch) {
+ onSelectedChange(fromSearch, fromFlaggedPosts) {
this.setState({
postRightVisible: !!PostStore.getSelectedPost(),
- fromSearch
+ fromSearch,
+ fromFlaggedPosts
});
}
@@ -120,7 +129,8 @@ export default class SidebarRight extends React.Component {
onSearchChange() {
this.setState({
searchVisible: SearchStore.getSearchResults() !== null,
- isMentionSearch: SearchStore.getIsMentionSearch()
+ isMentionSearch: SearchStore.getIsMentionSearch(),
+ isFlaggedPosts: SearchStore.getIsFlaggedPosts()
});
}
@@ -154,6 +164,7 @@ export default class SidebarRight extends React.Component {
content = (
<SearchResults
isMentionSearch={this.state.isMentionSearch}
+ isFlaggedPosts={this.state.isFlaggedPosts}
useMilitaryTime={this.state.useMilitaryTime}
toggleSize={this.toggleSize}
shrink={this.onShrink}
@@ -162,6 +173,7 @@ export default class SidebarRight extends React.Component {
} else if (this.state.postRightVisible) {
content = (
<RhsThread
+ fromFlaggedPosts={this.state.fromFlaggedPosts}
fromSearch={this.state.fromSearch}
isMentionSearch={this.state.isMentionSearch}
currentUser={this.state.currentUser}