remove layoutProvider references

Signed-off-by: Juan Pablo Garcia Ripa <sarabadu@gmail.com>
This commit is contained in:
Juan Pablo Garcia Ripa
2022-01-11 18:13:09 +01:00
parent 14b882a696
commit ec67d27cb2
5 changed files with 10 additions and 20 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
'@backstage/core-components': patch
---
Add `LayoutProvider` component and `useLayoutContent` hook to have a reference to current main content element
Add `useContent` hook to have a reference to the current main content element
+5 -8
View File
@@ -30,7 +30,6 @@ import { createApp } from '@backstage/app-defaults';
import { FlatRoutes } from '@backstage/core-app-api';
import {
AlertDisplay,
LayoutProvider,
OAuthRequestDialog,
SignInPage,
} from '@backstage/core-components';
@@ -226,13 +225,11 @@ const routes = (
const App = () => (
<AppProvider>
<LayoutProvider>
<AlertDisplay />
<OAuthRequestDialog />
<AppRouter>
<Root>{routes}</Root>
</AppRouter>
</LayoutProvider>
<AlertDisplay />
<OAuthRequestDialog />
<AppRouter>
<Root>{routes}</Root>
</AppRouter>
</AppProvider>
);
+2 -7
View File
@@ -571,11 +571,6 @@ enum LabelPosition {
RIGHT = 'r',
}
// Warning: (ae-missing-release-tag) "LayoutProvider" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function LayoutProvider(props: PropsWithChildren<{}>): JSX.Element;
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "Lifecycle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -2406,10 +2401,10 @@ export function TrendLine(
},
): JSX.Element | null;
// Warning: (ae-missing-release-tag) "useLayoutContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
// Warning: (ae-missing-release-tag) "useContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function useLayoutContent(): {
export function useContent(): {
focusContent: () => void;
contentRef: React_2.MutableRefObject<HTMLDivElement | null> | undefined;
};
@@ -23,11 +23,10 @@ import Button from '@material-ui/core/Button';
import { sidebarConfig, SidebarContext } from './config';
import { BackstageTheme } from '@backstage/theme';
import { SidebarPinStateContext } from './Page';
import { SidebarPinStateContext, useContent } from './Page';
import { MobileSidebar } from './MobileSidebar';
import DoubleArrowRight from './icons/DoubleArrowRight';
import DoubleArrowLeft from './icons/DoubleArrowLeft';
import { useLayoutContent } from '../LayoutProvider/LayoutProvider';
/** @public */
export type SidebarClassKey = 'drawer' | 'drawerOpen';
@@ -230,7 +229,7 @@ export const Sidebar = (props: SidebarProps) => {
};
function A11ySkipSidebar() {
const { focusContent, contentRef } = useLayoutContent();
const { focusContent, contentRef } = useContent();
const classes = useStyles();
if (!contentRef?.current) {
@@ -31,4 +31,3 @@ export * from './Sidebar';
export * from './SignInPage';
export * from './TabbedCard';
export * from './Breadcrumbs';
export * from './LayoutProvider';