From dd480029ecfcf0ad08b7949ed735f0e70842da7a Mon Sep 17 00:00:00 2001 From: Dede Hamzah Date: Fri, 10 Dec 2021 17:55:18 +0700 Subject: [PATCH] Export icon props for SidebarSearchModal Component Signed-off-by: Dede Hamzah --- plugins/search/api-report.md | 5 ++++- .../SidebarSearchModal/SidebarSearchModal.tsx | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/search/api-report.md b/plugins/search/api-report.md index 4141465766..151b160367 100644 --- a/plugins/search/api-report.md +++ b/plugins/search/api-report.md @@ -217,10 +217,13 @@ export const SearchType: ({ // @public (undocumented) export const SidebarSearch: (props: SidebarSearchProps) => JSX.Element; +// Warning: (ae-forgotten-export) The symbol "SidebarSearchModalProps" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "SidebarSearchModal" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const SidebarSearchModal: () => JSX.Element; +export const SidebarSearchModal: ( + props: SidebarSearchModalProps, +) => JSX.Element; // Warning: (ae-forgotten-export) The symbol "SearchContextValue" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "useSearch" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) diff --git a/plugins/search/src/components/SidebarSearchModal/SidebarSearchModal.tsx b/plugins/search/src/components/SidebarSearchModal/SidebarSearchModal.tsx index ae38526c9d..b8f20de67d 100644 --- a/plugins/search/src/components/SidebarSearchModal/SidebarSearchModal.tsx +++ b/plugins/search/src/components/SidebarSearchModal/SidebarSearchModal.tsx @@ -16,17 +16,23 @@ import React from 'react'; import SearchIcon from '@material-ui/icons/Search'; import { SidebarItem } from '@backstage/core-components'; +import { IconComponent } from '@backstage/core-plugin-api'; import { SearchModal } from '../SearchModal'; import { useSearch } from '../SearchContext'; -export const SidebarSearchModal = () => { +export type SidebarSearchModalProps = { + icon?: IconComponent; +}; + +export const SidebarSearchModal = (props: SidebarSearchModalProps) => { const { open, toggleModal } = useSearch(); + const Icon = props.icon ? props.icon : SearchIcon; return ( <>