diff --git a/packages/techdocs-cli-embedded-app/src/components/Root/Root.tsx b/packages/techdocs-cli-embedded-app/src/components/Root/Root.tsx
index 249394fdc4..6613e7c0ea 100644
--- a/packages/techdocs-cli-embedded-app/src/components/Root/Root.tsx
+++ b/packages/techdocs-cli-embedded-app/src/components/Root/Root.tsx
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import React, { PropsWithChildren, useContext } from 'react';
+import React, { PropsWithChildren } from 'react';
import { Link, makeStyles } from '@material-ui/core';
import LibraryBooks from '@material-ui/icons/LibraryBooks';
@@ -27,7 +27,7 @@ import {
SidebarPage,
sidebarConfig,
SidebarDivider,
- SidebarContext,
+ useSidebar,
} from '@backstage/core-components';
import { NavLink } from 'react-router-dom';
@@ -48,7 +48,7 @@ const useSidebarLogoStyles = makeStyles({
const SidebarLogo = () => {
const classes = useSidebarLogoStyles();
- const { isOpen } = useContext(SidebarContext);
+ const { isOpen } = useSidebar();
return (
diff --git a/plugins/shortcuts/src/ShortcutItem.test.tsx b/plugins/shortcuts/src/ShortcutItem.test.tsx
index 90b8ff06e5..d1a1018513 100644
--- a/plugins/shortcuts/src/ShortcutItem.test.tsx
+++ b/plugins/shortcuts/src/ShortcutItem.test.tsx
@@ -20,7 +20,7 @@ import { ShortcutItem } from './ShortcutItem';
import { Shortcut } from './types';
import { LocalStoredShortcuts } from './api';
import { MockStorageApi, renderInTestApp } from '@backstage/test-utils';
-import { SidebarContext } from '@backstage/core-components';
+import { SidebarContextProvider } from '@backstage/core-components';
describe('ShortcutItem', () => {
const shortcut: Shortcut = {
@@ -32,9 +32,9 @@ describe('ShortcutItem', () => {
it('displays the shortcut', async () => {
await renderInTestApp(
- {} }}>
+ {} }}>
- ,
+ ,
);
expect(screen.getByText('ST')).toBeInTheDocument();
expect(screen.getByText('some title')).toBeInTheDocument();
diff --git a/plugins/shortcuts/src/Shortcuts.test.tsx b/plugins/shortcuts/src/Shortcuts.test.tsx
index 8cee9a6622..813dbb8def 100644
--- a/plugins/shortcuts/src/Shortcuts.test.tsx
+++ b/plugins/shortcuts/src/Shortcuts.test.tsx
@@ -24,12 +24,12 @@ import { screen, waitFor } from '@testing-library/react';
import { Shortcuts } from './Shortcuts';
import { LocalStoredShortcuts, shortcutsApiRef } from './api';
-import { SidebarContext } from '@backstage/core-components';
+import { SidebarContextProvider } from '@backstage/core-components';
describe('Shortcuts', () => {
it('displays an add button', async () => {
await renderInTestApp(
- {} }}>
+ {} }}>
{
>
- ,
+ ,
);
await waitFor(() => !screen.queryByTestId('progress'));
expect(screen.getByText('Add Shortcuts')).toBeInTheDocument();