Merge pull request #11629 from backstage/cc/version-sidebar-contexts

This commit is contained in:
Eric Peterson
2022-05-30 21:01:04 +02:00
committed by GitHub
31 changed files with 643 additions and 129 deletions
+3 -3
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { useContext, PropsWithChildren } from 'react';
import React, { PropsWithChildren } from 'react';
import { Link, makeStyles } from '@material-ui/core';
import HomeIcon from '@material-ui/icons/Home';
import ExtensionIcon from '@material-ui/icons/Extension';
@@ -39,13 +39,13 @@ import { Shortcuts } from '@backstage/plugin-shortcuts';
import {
Sidebar,
sidebarConfig,
SidebarContext,
SidebarDivider,
SidebarGroup,
SidebarItem,
SidebarPage,
SidebarScrollWrapper,
SidebarSpace,
useSidebarOpenState,
} from '@backstage/core-components';
import { MyGroupsSidebarItem } from '@backstage/plugin-org';
import GroupIcon from '@material-ui/icons/People';
@@ -68,7 +68,7 @@ const useSidebarLogoStyles = makeStyles({
const SidebarLogo = () => {
const classes = useSidebarLogoStyles();
const { isOpen } = useContext(SidebarContext);
const { isOpen } = useSidebarOpenState();
return (
<div className={classes.root}>
@@ -21,7 +21,7 @@ import {
Header,
Lifecycle,
Page,
SidebarPinStateContext,
useSidebarPinState,
} from '@backstage/core-components';
import { useApi } from '@backstage/core-plugin-api';
import { CatalogSearchResultListItem } from '@backstage/plugin-catalog';
@@ -40,7 +40,7 @@ import {
import { useSearch } from '@backstage/plugin-search-react';
import { TechDocsSearchResultListItem } from '@backstage/plugin-techdocs';
import { Grid, List, makeStyles, Paper, Theme } from '@material-ui/core';
import React, { useContext } from 'react';
import React from 'react';
const useStyles = makeStyles((theme: Theme) => ({
bar: {
@@ -59,7 +59,7 @@ const useStyles = makeStyles((theme: Theme) => ({
const SearchPage = () => {
const classes = useStyles();
const { isMobile } = useContext(SidebarPinStateContext);
const { isMobile } = useSidebarPinState();
const { types } = useSearch();
const catalogApi = useApi(catalogApiRef);