Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Jun 28, 2024
1 parent 3744bc5 commit 0da19fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/docusaurus-theme-classic/src/theme-classic.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ declare module '@theme/BlogSidebar/Content' {
readonly yearGroupHeadingClassName?: string;
}

export default function BlogSidebarYearGroup(props: Props): ReactNode;
export default function BlogSidebarContent(props: Props): ReactNode;
}

declare module '@theme/BlogSidebar/Desktop' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import React, {type ReactNode} from 'react';
import React, {memo, type ReactNode} from 'react';
import {useThemeConfig} from '@docusaurus/theme-common';
import {groupBlogSidebarItemsByYear} from '@docusaurus/theme-common/internal';
import Heading from '@theme/Heading';
Expand All @@ -17,7 +17,6 @@ function BlogSidebarYearGroup({
}: {
year: string;
yearGroupHeadingClassName?: string;

children: ReactNode;
}) {
return (
Expand All @@ -30,7 +29,7 @@ function BlogSidebarYearGroup({
);
}

export default function BlogSidebarContent({
function BlogSidebarContent({
items,
yearGroupHeadingClassName,
ListComponent,
Expand All @@ -54,3 +53,5 @@ export default function BlogSidebarContent({
return <ListComponent items={items} />;
}
}

export default memo(BlogSidebarContent);
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import React from 'react';
import React, {memo} from 'react';
import {
useVisibleBlogSidebarItems,
BlogSidebarItemList,
Expand Down Expand Up @@ -40,11 +40,13 @@ function BlogSidebarMobileSecondaryMenu({sidebar}: Props): JSX.Element {
);
}

export default function BlogSidebarMobile(props: Props): JSX.Element {
function BlogSidebarMobile(props: Props): JSX.Element {
return (
<NavbarSecondaryMenuFiller
component={BlogSidebarMobileSecondaryMenu}
props={props}
/>
);
}

export default memo(BlogSidebarMobile);

0 comments on commit 0da19fd

Please sign in to comment.