Updating documentation for customization of SidebarSearchModal children

Signed-off-by: Joshua Jung <joshua.p.jung@gmail.com>
This commit is contained in:
Joshua Jung
2024-08-16 11:16:42 -05:00
parent eca03bdae9
commit 950534e5b5
4 changed files with 58 additions and 22 deletions
+1
View File
@@ -43,6 +43,7 @@ export type {
export { SidebarSearch } from './components/SidebarSearch';
export type { SidebarSearchProps } from './components/SidebarSearch';
export type { SidebarSearchModalProps } from './components/SidebarSearchModal';
export type { SearchResultChildrenProvider } from './plugin';
export {
HomePageSearchBar,
+3 -9
View File
@@ -27,16 +27,10 @@ import {
} from '@backstage/core-plugin-api';
import { ReactNode } from 'react';
import { SearchResultSet } from '@backstage/plugin-search-common';
import { SidebarSearchModalProps } from './components/SidebarSearchModal';
/**
* This type allows us to pass children to the <SearchResult> component via the <SideBarSearchModal />.
*
* This allows us to customize the search result items displayed in the SidebarSearchModal, like so:
*
* <SidebarSearchModal searchResultChildren={[
* <MyCustomSearchResultListItem />,
* <TechDocsSearchResultListItem icon={<DocsIcon />} />
* ]} />
* @public
*/
export type SearchResultChildrenProvider = {
searchResultChildren?:
@@ -82,7 +76,7 @@ export const SearchPage = searchPlugin.provide(
* @public
*/
export const SidebarSearchModal = searchPlugin.provide<
(props: SearchResultChildrenProvider) => JSX.Element | null
(props: SidebarSearchModalProps) => JSX.Element | null
>(
createComponentExtension({
name: 'SidebarSearchModal',