From c9eb23a3d44c96042522bf7cdefc65903eb1d0a3 Mon Sep 17 00:00:00 2001 From: khawerrind Date: Thu, 22 Dec 2016 22:21:16 +0500 Subject: PLT-3782 Do not move the "@" sign and flag icon to the left of search bar when opening the right hand sidebar (#4850) * do not move the mention & flag button to the left of the search box when in search mode * fixed the margin & padding issues of the search box * fixed the member icon positioning issue and the expanded sidebar toggle issue * fixed remaining bugs when sidebar is in expanded mode * changed propTypes from func to bool --- webapp/components/channel_header.jsx | 8 +-- webapp/components/search_bar.jsx | 107 ++++++++++++++++++++++++++++++++++- webapp/components/sidebar_right.jsx | 10 ++++ webapp/sass/components/_search.scss | 5 +- webapp/sass/components/_webrtc.scss | 4 ++ webapp/sass/layout/_content.scss | 16 ++++++ webapp/sass/layout/_headers.scss | 3 + webapp/sass/responsive/_mobile.scss | 7 +++ webapp/sass/responsive/_tablet.scss | 6 ++ 9 files changed, 159 insertions(+), 7 deletions(-) diff --git a/webapp/components/channel_header.jsx b/webapp/components/channel_header.jsx index 96cfa1557..52bed85cd 100644 --- a/webapp/components/channel_header.jsx +++ b/webapp/components/channel_header.jsx @@ -728,12 +728,12 @@ export default class ChannelHeader extends React.Component { - + {popoverListMembers} - + -
+
-
+
; @@ -159,6 +184,73 @@ export default class SearchBar extends React.Component { helpClass += ' visible'; } + const recentMentionsTooltip = ( + + + + ); + + const flaggedTooltip = ( + + + + ); + + let mentionBtn; + let flagBtn; + if (this.props.showMentionFlagBtns) { + mentionBtn = ( +
+ + + {'@'} + + +
+ ); + + flagBtn = ( +
+ + + + + +
+ ); + } + return (
+ + {mentionBtn} + {flagBtn}
); } } + +SearchBar.defaultProps = { + showMentionFlagBtns: true +}; + +SearchBar.propTypes = { + showMentionFlagBtns: React.PropTypes.bool +}; \ No newline at end of file diff --git a/webapp/components/sidebar_right.jsx b/webapp/components/sidebar_right.jsx index 1be2a3287..da7ff818d 100644 --- a/webapp/components/sidebar_right.jsx +++ b/webapp/components/sidebar_right.jsx @@ -74,6 +74,12 @@ export default class SidebarRight extends React.Component { if (isOpen !== willOpen) { PostStore.jumpPostsViewSidebarOpen(); } + + if (!isOpen && willOpen) { + this.setState({ + expanded: false + }); + } } doStrangeThings() { @@ -191,6 +197,10 @@ export default class SidebarRight extends React.Component { ); } + if (!content) { + expandedClass = ''; + } + return (