Updating documentation for customization of SidebarSearchModal children
Signed-off-by: Joshua Jung <joshua.p.jung@gmail.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user