feat(mobile): mobile toc menu (#9582)

Close [BS-1787](https://linear.app/affine-design/issue/BS-1787/toc-移动端适配)
This commit is contained in:
L-Sun
2025-01-08 08:03:11 +00:00
parent fe727412be
commit a0cba55a5b
10 changed files with 259 additions and 28 deletions

View File

@@ -11,6 +11,7 @@ import type { ReactNode } from 'react';
export interface MenuProps {
children: ReactNode;
items: ReactNode;
title?: string;
portalOptions?: Omit<DropdownMenuPortalProps, 'children'>;
rootOptions?: Omit<DropdownMenuProps, 'children'>;
contentOptions?: Omit<DropdownMenuContentProps, 'children'>;

View File

@@ -20,6 +20,7 @@ import { MobileMenuSubRaw } from './sub';
export const MobileMenu = ({
children,
items,
title,
contentOptions: {
className,
onPointerDownOutside,
@@ -108,7 +109,7 @@ export const MobileMenu = ({
*/
if (pSetOpen) {
return (
<MobileMenuSubRaw items={items} subOptions={rootOptions}>
<MobileMenuSubRaw title={title} items={items} subOptions={rootOptions}>
{children}
</MobileMenuSubRaw>
);