From 1a8e7ac06ef15f27e4cb78363dface2af8a42da3 Mon Sep 17 00:00:00 2001 From: luzmediach Date: Sun, 21 Jan 2024 12:48:10 +0100 Subject: [PATCH] NavMobile to use Nav interfaces and add SiteToc to sidebar --- packages/core/src/ui/Nav/NavMobile.tsx | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/packages/core/src/ui/Nav/NavMobile.tsx b/packages/core/src/ui/Nav/NavMobile.tsx index a975c073..980f5e6f 100644 --- a/packages/core/src/ui/Nav/NavMobile.tsx +++ b/packages/core/src/ui/Nav/NavMobile.tsx @@ -4,20 +4,16 @@ import { useRouter } from "next/router.js"; import { useEffect, useState } from "react"; import { SearchContext, SearchField } from "../Search"; import { MenuIcon, CloseIcon } from "../Icons"; -import { NavLink, SearchProviderConfig } from "../types"; +import type { NavConfig, ThemeConfig } from "./Nav"; -interface Props extends React.PropsWithChildren { - author?: string; - links?: Array; - search?: SearchProviderConfig; -} +interface Props extends NavConfig, ThemeConfig, React.PropsWithChildren {} -// TODO why mobile navigation only accepts author and regular nav accepts different things like title, logo, version +// TODO: Search doesn't appear export const NavMobile: React.FC = ({ children, + title, links, search, - author, }) => { const router = useRouter(); const [isOpen, setIsOpen] = useState(false); @@ -77,8 +73,8 @@ export const NavMobile: React.FC = ({ legacyBehavior > {/* */} -
- {author} +
+ {title}
@@ -106,9 +102,7 @@ export const NavMobile: React.FC = ({ ))} )} - {/*
- {children} -
*/} +
{children}