Force adopters to include the search result pager on their own

Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
This commit is contained in:
Oliver Sand
2021-09-02 10:19:08 +02:00
parent 66be814579
commit f8546dadbf
5 changed files with 21 additions and 22 deletions
@@ -22,7 +22,6 @@ import {
import { SearchResult } from '@backstage/search-common';
import React from 'react';
import { useSearch } from '../SearchContext';
import { SearchResultPager } from '../SearchResultPager';
type Props = {
children: (results: { results: SearchResult[] }) => JSX.Element;
@@ -49,12 +48,7 @@ export const SearchResultComponent = ({ children }: Props) => {
return <EmptyState missing="data" title="Sorry, no results were found" />;
}
return (
<>
{children({ results: value.results })}
<SearchResultPager />
</>
);
return <>{children({ results: value.results })}</>;
};
export { SearchResultComponent as SearchResult };
@@ -23,10 +23,9 @@ import { useSearch } from '../SearchContext';
const useStyles = makeStyles(theme => ({
root: {
display: 'flex',
justifyContent: 'center',
justifyContent: 'space-between',
gap: theme.spacing(2),
marginTop: theme.spacing(1),
marginBottom: theme.spacing(1),
margin: theme.spacing(4),
},
}));
+13 -12
View File
@@ -15,25 +15,26 @@
*/
export { searchApiRef } from './apis';
export {
searchPlugin,
searchPlugin as plugin,
SearchPage,
SearchPageNext,
SearchBarNext,
SearchResult,
DefaultResultListItem,
} from './plugin';
export {
Filters,
FiltersButton,
SearchBar,
SearchContextProvider,
useSearch,
SearchPage as Router,
SearchFilter,
SearchType,
SearchFilterNext,
SearchPage as Router,
SearchResultPager,
SearchType,
SidebarSearch,
useSearch,
} from './components';
export type { FiltersState } from './components';
export {
DefaultResultListItem,
SearchBarNext,
SearchPage,
SearchPageNext,
searchPlugin as plugin,
searchPlugin,
SearchResult,
} from './plugin';