/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import React, {version, type ReactNode} from 'react'; import clsx from 'clsx'; import {useNavbarSecondaryMenu} from '@docusaurus/theme-common/internal'; import {ThemeClassNames} from '@docusaurus/theme-common'; import type {Props} from '@theme/Navbar/MobileSidebar/Layout'; // TODO Docusaurus v4: remove temporary inert workaround // See https://github.com/facebook/react/issues/17157 // See https://github.com/radix-ui/themes/pull/509 function inertProps(inert: boolean) { const isBeforeReact19 = parseInt(version!.split('.')[0]!, 10) < 19; if (isBeforeReact19) { // TODO Docusaurus v4: remove temporary inert workaround return {inert: inert ? '' : undefined} as unknown as {inert: boolean}; } return {inert}; } function NavbarMobileSidebarPanel({ children, inert, }: { children: ReactNode; inert: boolean; }) { return (
{children}
); } export default function NavbarMobileSidebarLayout({ header, primaryMenu, secondaryMenu, }: Props): ReactNode { const {shown: secondaryMenuShown} = useNavbarSecondaryMenu(); return (
{header}
{primaryMenu} {secondaryMenu}
); }