diff --git a/package.json b/package.json index 4f75a0f3..3a5489b7 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "serve": "docusaurus serve", "format": "biome format --write ./src", "lint": "biome check ./src", - "lint:fix": "biome check --apply-unsafe ./src", + "lint:fix": "biome check --write --unsafe ./src", "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", "index": "docker run -it --env-file=.env -e \"CONFIG=$(cat docsearch.json | jq -r tostring)\" algolia/docsearch-scraper" @@ -68,5 +68,5 @@ "engines": { "node": ">=20.0" }, - "packageManager": "pnpm@9.4.0" + "packageManager": "pnpm@9.8.0" } diff --git a/src/theme/BlogSidebar/Content/index.tsx b/src/theme/BlogSidebar/Content/index.tsx index 7f88034a..d5295eed 100644 --- a/src/theme/BlogSidebar/Content/index.tsx +++ b/src/theme/BlogSidebar/Content/index.tsx @@ -1,17 +1,17 @@ -import React, {memo, type ReactNode} from 'react'; -import {useThemeConfig} from '@docusaurus/theme-common'; -import {groupBlogSidebarItemsByYear} from '@docusaurus/plugin-content-blog/client'; -import Heading from '@theme/Heading'; -import type {Props} from '@theme/BlogSidebar/Content'; +import { groupBlogSidebarItemsByYear } from '@docusaurus/plugin-content-blog/client' +import { useThemeConfig } from '@docusaurus/theme-common' +import type { Props } from '@theme/BlogSidebar/Content' +import Heading from '@theme/Heading' +import React, { memo, type ReactNode } from 'react' function BlogSidebarYearGroup({ year, yearGroupHeadingClassName, children, }: { - year: string; - yearGroupHeadingClassName?: string; - children: ReactNode; + year: string + yearGroupHeadingClassName?: string + children: ReactNode }) { return (
@@ -20,32 +20,25 @@ function BlogSidebarYearGroup({ {children}
- ); + ) } -function BlogSidebarContent({ - items, - yearGroupHeadingClassName, - ListComponent, -}: Props): ReactNode { - const themeConfig = useThemeConfig(); +function BlogSidebarContent({ items, yearGroupHeadingClassName, ListComponent }: Props): ReactNode { + const themeConfig = useThemeConfig() if (themeConfig.blog.sidebar.groupByYear) { - const itemsByYear = groupBlogSidebarItemsByYear(items); + const itemsByYear = groupBlogSidebarItemsByYear(items) return ( <> {itemsByYear.map(([year, yearItems]) => ( - + ))} - ); + ) } else { - return ; + return } } -export default memo(BlogSidebarContent); +export default memo(BlogSidebarContent) diff --git a/src/theme/BlogSidebar/Mobile/index.tsx b/src/theme/BlogSidebar/Mobile/index.tsx index 735eb364..27ed8e78 100644 --- a/src/theme/BlogSidebar/Mobile/index.tsx +++ b/src/theme/BlogSidebar/Mobile/index.tsx @@ -1,16 +1,13 @@ -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 type {Props} from '@theme/BlogSidebar/Mobile'; -import type {Props as BlogSidebarContentProps} from '@theme/BlogSidebar/Content'; +import { BlogSidebarItemList, useVisibleBlogSidebarItems } from '@docusaurus/plugin-content-blog/client' +import { NavbarSecondaryMenuFiller } from '@docusaurus/theme-common' +import BlogSidebarContent from '@theme/BlogSidebar/Content' +import type { Props as BlogSidebarContentProps } from '@theme/BlogSidebar/Content' +import type { Props } from '@theme/BlogSidebar/Mobile' +import React, { memo } from 'react' -import styles from './styles.module.css'; +import styles from './styles.module.css' -const ListComponent: BlogSidebarContentProps['ListComponent'] = ({items}) => { +const ListComponent: BlogSidebarContentProps['ListComponent'] = ({ items }) => { return ( { linkClassName="menu__link" linkActiveClassName="menu__link--active" /> - ); -}; + ) +} -function BlogSidebarMobileSecondaryMenu({sidebar}: Props): JSX.Element { - const items = useVisibleBlogSidebarItems(sidebar.items); +function BlogSidebarMobileSecondaryMenu({ sidebar }: Props): JSX.Element { + const items = useVisibleBlogSidebarItems(sidebar.items) return ( - ); + ) } function BlogSidebarMobile(props: Props): JSX.Element { - return ( - - ); + return } -export default memo(BlogSidebarMobile); +export default memo(BlogSidebarMobile)