diff --git a/x-pack/plugins/code/public/components/search_page/search.scss b/x-pack/plugins/code/public/components/search_page/search.scss index 15f8c2509bb419..194eeeda894cad 100644 --- a/x-pack/plugins/code/public/components/search_page/search.scss +++ b/x-pack/plugins/code/public/components/search_page/search.scss @@ -4,4 +4,10 @@ flex-grow: 1; flex-shrink: 1; overflow: auto; -} \ No newline at end of file +} + +.codeSearchbar__container { + height: 3.5rem; + padding: $euiSizeS; + border-bottom: $euiBorderWidthThin solid $euiBorderColor; +} diff --git a/x-pack/plugins/code/public/components/search_page/search.tsx b/x-pack/plugins/code/public/components/search_page/search.tsx index fffc18aa1393e2..ec4374845f669d 100644 --- a/x-pack/plugins/code/public/components/search_page/search.tsx +++ b/x-pack/plugins/code/public/components/search_page/search.tsx @@ -167,7 +167,7 @@ class SearchPage extends React.PureComponent { const statsComp = (

- Showing {from + 1} - {to} of {total} results. + Showing {total > 0 ? from : 0} - {to} of {total} results.

); @@ -181,17 +181,16 @@ class SearchPage extends React.PureComponent { } else if ( scope === SearchScope.DEFAULT && documentSearchResults && - documentSearchResults.total > 0 + (documentSearchResults.total > 0 || languages!.size > 0 || repositories!.size > 0) ) { const { stats, results } = documentSearchResults!; const { total, from, to, page, totalPage } = stats!; languageStats = stats!.languageStats; repoStats = stats!.repoStats; - const statsComp = (

- Showing {from} - {to} of {total} results. + Showing {total > 0 ? from : 0} - {to} of {total} results.

); diff --git a/x-pack/plugins/code/public/components/search_page/search_bar.tsx b/x-pack/plugins/code/public/components/search_page/search_bar.tsx index d9e391f1a3dfa3..cf7471f6b2f09a 100644 --- a/x-pack/plugins/code/public/components/search_page/search_bar.tsx +++ b/x-pack/plugins/code/public/components/search_page/search_bar.tsx @@ -4,10 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import theme from '@elastic/eui/dist/eui_theme_light.json'; import querystring from 'querystring'; import React from 'react'; -import styled from 'styled-components'; import Url from 'url'; import { SearchScope } from '../../../model'; @@ -23,12 +21,6 @@ import { SymbolSuggestionsProvider, } from '../query_bar'; -const SearchBarContainer = styled.div` - height: 4rem; - padding: ${theme.paddingSizes.s}; - border-bottom: ${theme.euiBorderWidthThin} solid ${theme.euiBorderColor}; -`; - interface Props { query: string; onSearchScopeChanged: (s: SearchScope) => void; @@ -67,7 +59,7 @@ export class SearchBar extends React.PureComponent { ]; return ( - +
{ suggestionProviders={suggestionProviders} onSearchScopeChanged={this.props.onSearchScopeChanged} /> - +
); } }