From 186ab11c5769a10cc04dc24469616291cefa7dbf Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Fri, 6 Nov 2015 21:17:47 +0500 Subject: Updating UI for search autocomplete --- web/react/components/search_autocomplete.jsx | 4 ++-- web/react/utils/utils.jsx | 5 +++-- web/sass-files/sass/partials/_popover.scss | 28 +++++++++++++++++++++++++++- 3 files changed, 32 insertions(+), 5 deletions(-) (limited to 'web') diff --git a/web/react/components/search_autocomplete.jsx b/web/react/components/search_autocomplete.jsx index 736919697..3ff33fe57 100644 --- a/web/react/components/search_autocomplete.jsx +++ b/web/react/components/search_autocomplete.jsx @@ -289,7 +289,7 @@ export default class SearchAutocomplete extends React.Component { key='public-channel-divider' className='search-autocomplete__divider' > - {'Public ' + Utils.getChannelTerm(Constants.OPEN_CHANNEL) + 's'} + {'Public ' + Utils.getChannelTerm(Constants.OPEN_CHANNEL) + 's'} ); suggestions = suggestions.concat(publicChannels.map(this.renderChannelSuggestion)); @@ -302,7 +302,7 @@ export default class SearchAutocomplete extends React.Component { key='private-channel-divider' className='search-autocomplete__divider' > - {'Private ' + Utils.getChannelTerm(Constants.PRIVATE_CHANNEL) + 's'} + {'Private ' + Utils.getChannelTerm(Constants.PRIVATE_CHANNEL) + 's'} ); suggestions = suggestions.concat(privateChannels.map(this.renderChannelSuggestion)); diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 8052c000c..38f91b35f 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -513,7 +513,7 @@ export function applyTheme(theme) { changeCss('#post-list .post-list-holder-by-time', 'background:' + theme.centerChannelBg, 1); changeCss('#post-create', 'background:' + theme.centerChannelBg, 1); changeCss('.date-separator .separator__text, .new-separator .separator__text', 'background:' + theme.centerChannelBg, 1); - changeCss('.post-image__column .post-image__details', 'background:' + theme.centerChannelBg, 1); + changeCss('.post-image__column .post-image__details, .search-help-popover .search-autocomplete__divider span', 'background:' + theme.centerChannelBg, 1); changeCss('.sidebar--right, .dropdown-menu, .popover, .tip-overlay', 'background:' + theme.centerChannelBg, 1); changeCss('.popover.bottom>.arrow:after', 'border-bottom-color:' + theme.centerChannelBg, 1); changeCss('.popover.right>.arrow:after, .tip-overlay.tip-overlay--sidebar .arrow, .tip-overlay.tip-overlay--header .arrow', 'border-right-color:' + theme.centerChannelBg, 1); @@ -541,11 +541,12 @@ export function applyTheme(theme) { changeCss('.channel-header #member_popover', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1); changeCss('.custom-textarea, .custom-textarea:focus, .preview-container .preview-div, .post-image__column .post-image__details, .sidebar--right .sidebar-right__body, .markdown__table th, .markdown__table td, .command-box, .modal .modal-content, .settings-modal .settings-table .settings-content .divider-light, .webhooks__container, .dropdown-menu, .modal .modal-header, .popover, .mentions--top .mentions-box', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1); changeCss('.popover.bottom>.arrow', 'border-bottom-color:' + changeOpacity(theme.centerChannelColor, 0.25), 1); + changeCss('.search-help-popover .search-autocomplete__divider span', 'color:' + changeOpacity(theme.centerChannelColor, 0.7), 1); changeCss('.popover.right>.arrow', 'border-right-color:' + changeOpacity(theme.centerChannelColor, 0.25), 1); changeCss('.popover.left>.arrow', 'border-left-color:' + changeOpacity(theme.centerChannelColor, 0.25), 1); changeCss('.popover.top>.arrow', 'border-top-color:' + changeOpacity(theme.centerChannelColor, 0.25), 1); changeCss('.command-name, .popover .popover-title', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1); - changeCss('.dropdown-menu .divider', 'background:' + theme.centerChannelColor, 1); + changeCss('.dropdown-menu .divider, .search-help-popover .search-autocomplete__divider:before', 'background:' + theme.centerChannelColor, 1); changeCss('.custom-textarea', 'color:' + theme.centerChannelColor, 1); changeCss('.post-image__column', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 2); changeCss('.post-image__column .post-image__details', 'color:' + theme.centerChannelColor, 2); diff --git a/web/sass-files/sass/partials/_popover.scss b/web/sass-files/sass/partials/_popover.scss index 430813e63..7d98935d5 100644 --- a/web/sass-files/sass/partials/_popover.scss +++ b/web/sass-files/sass/partials/_popover.scss @@ -36,10 +36,36 @@ } } + .search-autocomplete__divider { + margin: 10px 0 5px; + line-height: 21px; + position: relative; + &:first-child { + margin-top: 5px; + } + span { + display: inline-block; + padding-right: 10px; + background: #fff; + z-index: 5; + position: relative; + } + &:before { + content: ""; + position: absolute; + width: 100%; + height: 1px; + background: #ddd; + top: 10px; + left: 0; + @include opacity(0.2); + } + } + .search-autocomplete__item { cursor: pointer; padding: 6px 8px; - margin: 3px 0; + margin: 3px 0 0 5px; @include border-radius(2px); white-space: nowrap; overflow: hidden; -- cgit v1.2.3-1-g7c22