diff options
author | Saturnino Abril <saturnino.abril@gmail.com> | 2017-03-24 18:05:43 +0900 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-03-24 09:05:43 +0000 |
commit | 1167b391854957a5d58ed569c1dc2f80e9ccc599 (patch) | |
tree | 071e2e2217dee77fee5b310620aa946d4f68a69d /webapp/components/sidebar_right.jsx | |
parent | 98baf1536eb1b47d8258e188e1c80393182c6525 (diff) | |
download | chat-1167b391854957a5d58ed569c1dc2f80e9ccc599.tar.gz chat-1167b391854957a5d58ed569c1dc2f80e9ccc599.tar.bz2 chat-1167b391854957a5d58ed569c1dc2f80e9ccc599.zip |
Fixed mobile search focus - keyboard collapse/focus (#5766)
Diffstat (limited to 'webapp/components/sidebar_right.jsx')
-rw-r--r-- | webapp/components/sidebar_right.jsx | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/webapp/components/sidebar_right.jsx b/webapp/components/sidebar_right.jsx index 42b7381f4..6a0716ce1 100644 --- a/webapp/components/sidebar_right.jsx +++ b/webapp/components/sidebar_right.jsx @@ -5,6 +5,8 @@ import $ from 'jquery'; import SearchResults from './search_results.jsx'; import RhsThread from './rhs_thread.jsx'; +import SearchBox from './search_bar.jsx'; +import FileUploadOverlay from './file_upload_overlay.jsx'; import SearchStore from 'stores/search_store.jsx'; import PostStore from 'stores/post_store.jsx'; import UserStore from 'stores/user_store.jsx'; @@ -188,30 +190,43 @@ export default class SidebarRight extends React.Component { expandedClass = 'sidebar--right--expanded'; } + var currentId = UserStore.getCurrentId(); + var searchForm = null; + if (currentId) { + searchForm = <SearchBox isFocus={this.state.searchVisible && Utils.isMobile()}/>; + } + if (this.state.searchVisible) { content = ( - <SearchResults - isMentionSearch={this.state.isMentionSearch} - isFlaggedPosts={this.state.isFlaggedPosts} - isPinnedPosts={this.state.isPinnedPosts} - useMilitaryTime={this.state.useMilitaryTime} - toggleSize={this.toggleSize} - shrink={this.onShrink} - channelDisplayName={this.props.channel ? this.props.channel.display_name : ''} - /> + <div className='sidebar--right__content'> + <div className='search-bar__container sidebar--right__search-header'>{searchForm}</div> + <SearchResults + isMentionSearch={this.state.isMentionSearch} + isFlaggedPosts={this.state.isFlaggedPosts} + isPinnedPosts={this.state.isPinnedPosts} + useMilitaryTime={this.state.useMilitaryTime} + toggleSize={this.toggleSize} + shrink={this.onShrink} + channelDisplayName={this.props.channel ? this.props.channel.display_name : ''} + /> + </div> ); } else if (this.state.postRightVisible) { content = ( - <RhsThread - fromFlaggedPosts={this.state.fromFlaggedPosts} - fromSearch={this.state.fromSearch} - isWebrtc={WebrtcStore.isBusy()} - isMentionSearch={this.state.isMentionSearch} - currentUser={this.state.currentUser} - useMilitaryTime={this.state.useMilitaryTime} - toggleSize={this.toggleSize} - shrink={this.onShrink} - /> + <div className='post-right__container'> + <FileUploadOverlay overlayType='right'/> + <div className='search-bar__container sidebar--right__search-header'>{searchForm}</div> + <RhsThread + fromFlaggedPosts={this.state.fromFlaggedPosts} + fromSearch={this.state.fromSearch} + isWebrtc={WebrtcStore.isBusy()} + isMentionSearch={this.state.isMentionSearch} + currentUser={this.state.currentUser} + useMilitaryTime={this.state.useMilitaryTime} + toggleSize={this.toggleSize} + shrink={this.onShrink} + /> + </div> ); } |