Move layout context to SidabarPage
Signed-off-by: Juan Pablo Garcia Ripa <sarabadu@gmail.com>
This commit is contained in:
@@ -34,7 +34,7 @@ import { SearchResult } from '../SearchResult';
|
||||
import { SearchContextProvider, useSearch } from '../SearchContext';
|
||||
import { SearchResultPager } from '../SearchResultPager';
|
||||
import { useRouteRef } from '@backstage/core-plugin-api';
|
||||
import { Link, useLayoutContent } from '@backstage/core-components';
|
||||
import { Link, useContent } from '@backstage/core-components';
|
||||
import { rootRouteRef } from '../../plugin';
|
||||
|
||||
export interface SearchModalProps {
|
||||
@@ -62,7 +62,7 @@ export const Modal = ({ open = true, toggleModal }: SearchModalProps) => {
|
||||
const classes = useStyles();
|
||||
|
||||
const { term } = useSearch();
|
||||
const { focusContent } = useLayoutContent();
|
||||
const { focusContent } = useContent();
|
||||
const { transitions } = useTheme();
|
||||
|
||||
const handleResultClick = () => {
|
||||
|
||||
@@ -19,10 +19,7 @@ import { useNavigate } from 'react-router-dom';
|
||||
import { rootRouteRef } from '../../plugin';
|
||||
|
||||
import { useRouteRef, IconComponent } from '@backstage/core-plugin-api';
|
||||
import {
|
||||
SidebarSearchField,
|
||||
useLayoutContent,
|
||||
} from '@backstage/core-components';
|
||||
import { SidebarSearchField, useContent } from '@backstage/core-components';
|
||||
|
||||
export type SidebarSearchProps = {
|
||||
icon?: IconComponent;
|
||||
@@ -30,7 +27,7 @@ export type SidebarSearchProps = {
|
||||
|
||||
export const SidebarSearch = (props: SidebarSearchProps) => {
|
||||
const searchRoute = useRouteRef(rootRouteRef);
|
||||
const { focusContent } = useLayoutContent();
|
||||
const { focusContent } = useContent();
|
||||
const navigate = useNavigate();
|
||||
const handleSearch = useCallback(
|
||||
(query: string): void => {
|
||||
|
||||
Reference in New Issue
Block a user