Skip to content

Commit

Permalink
removing sidenav back button and updating files
Browse files Browse the repository at this point in the history
  • Loading branch information
mayaraman19 committed Apr 22, 2024
1 parent 61ff525 commit 8a33f02
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 127 deletions.
15 changes: 3 additions & 12 deletions src/components/OpenAPI/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Global, css } from '@emotion/react';
import styled from '@emotion/styled';
import { palette } from '@leafygreen-ui/palette';
import ComponentFactory from '../ComponentFactory';
import { SidenavBackButton } from '../Sidenav';
import Spinner from '../Spinner';
import { useSiteMetadata } from '../../hooks/use-site-metadata';
import useStickyTopValues from '../../hooks/useStickyTopValues';
Expand Down Expand Up @@ -91,13 +90,6 @@ const getGlobalCss = ({ topLarge, topMedium }) => css`
}
`;

const Border = styled('hr')`
border: unset;
border-bottom: 1px solid ${palette.gray.light2};
margin: ${theme.size.default} 0;
width: 100%;
`;

const LoadingContainer = styled('div')`
align-items: center;
display: flex;
Expand Down Expand Up @@ -132,12 +124,9 @@ const LoadingWidget = ({ className }) => (
);

const MenuTitleContainer = ({ siteTitle, pageTitle }) => {
const docsTitle = siteTitle ? `${siteTitle} Docs` : 'Docs';
return (
<>
{/* Disable LG left arrow glyph due to bug where additional copies of the LG icon would be rendered
at the bottom of the page. */}
<SidenavBackButton border={<Border />} enableGlyph={false} target="/" titleOverride={docsTitle} />
{/* TODO: Add DocsHomeButton here - see comment below */}
<MenuTitle>{pageTitle}</MenuTitle>
</>
);
Expand Down Expand Up @@ -213,6 +202,8 @@ const OpenAPI = ({ metadata, nodeData: { argument, children, options = {} }, pag
sidebarEl.insertBefore(menuTitleContainerEl, searchEl);
const pageTitle = page?.options?.title || '';
const siteTitle = metadata?.title;
/* TODO: The below function is deprecated with React 18, need to replace it (potentially with
createRoot() and .render() (see React documentation) */
render(<MenuTitleContainer siteTitle={siteTitle} pageTitle={pageTitle} />, menuTitleContainerEl);
}
}
Expand Down
106 changes: 0 additions & 106 deletions src/components/Sidenav/SidenavBackButton.js

This file was deleted.

10 changes: 1 addition & 9 deletions src/components/Sidenav/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import Sidenav from './Sidenav';
import SidenavBackButton from './SidenavBackButton';
import SidenavMobileMenuButton from './SidenavMobileMenuButton';
import SidenavMobileMenuDropdown from './SidenavMobileMenuDropdown';
import { SidenavContext, SidenavContextProvider } from './sidenav-context';

export {
Sidenav,
SidenavBackButton,
SidenavContext,
SidenavContextProvider,
SidenavMobileMenuButton,
SidenavMobileMenuDropdown,
};
export { Sidenav, SidenavContext, SidenavContextProvider, SidenavMobileMenuButton, SidenavMobileMenuDropdown };

0 comments on commit 8a33f02

Please sign in to comment.