45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
/**
|
|
* 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, {memo} from 'react';
|
|
import {
|
|
useVisibleBlogSidebarItems,
|
|
BlogSidebarItemList,
|
|
} from '@docusaurus/plugin-content-blog/client';
|
|
import {NavbarSecondaryMenuFiller} from '@docusaurus/theme-common';
|
|
import BlogSidebarContent from '@theme/BlogSidebar/Content';
|
|
import styles from './styles.module.css';
|
|
const ListComponent = ({items}) => {
|
|
return (
|
|
<BlogSidebarItemList
|
|
items={items}
|
|
ulClassName="menu__list"
|
|
liClassName="menu__list-item"
|
|
linkClassName="menu__link"
|
|
linkActiveClassName="menu__link--active"
|
|
/>
|
|
);
|
|
};
|
|
function BlogSidebarMobileSecondaryMenu({sidebar}) {
|
|
const items = useVisibleBlogSidebarItems(sidebar.items);
|
|
return (
|
|
<BlogSidebarContent
|
|
items={items}
|
|
ListComponent={ListComponent}
|
|
yearGroupHeadingClassName={styles.yearGroupHeading}
|
|
/>
|
|
);
|
|
}
|
|
function BlogSidebarMobile(props) {
|
|
return (
|
|
<NavbarSecondaryMenuFiller
|
|
component={BlogSidebarMobileSecondaryMenu}
|
|
props={props}
|
|
/>
|
|
);
|
|
}
|
|
export default memo(BlogSidebarMobile);
|