Export icon props for SidebarSearchModal Component
Signed-off-by: Dede Hamzah <dehamzah@gmail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
<SidebarItem
|
||||
className="search-icon"
|
||||
icon={SearchIcon}
|
||||
icon={Icon}
|
||||
text="Search"
|
||||
onClick={toggleModal}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user