NavMobile to use Nav interfaces and add SiteToc to sidebar

This commit is contained in:
luzmediach 2024-01-21 12:48:10 +01:00
parent 4355efe0c4
commit 1a8e7ac06e

View File

@ -4,20 +4,16 @@ import { useRouter } from "next/router.js";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { SearchContext, SearchField } from "../Search"; import { SearchContext, SearchField } from "../Search";
import { MenuIcon, CloseIcon } from "../Icons"; import { MenuIcon, CloseIcon } from "../Icons";
import { NavLink, SearchProviderConfig } from "../types"; import type { NavConfig, ThemeConfig } from "./Nav";
interface Props extends React.PropsWithChildren { interface Props extends NavConfig, ThemeConfig, React.PropsWithChildren {}
author?: string;
links?: Array<NavLink>;
search?: SearchProviderConfig;
}
// 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<Props> = ({ export const NavMobile: React.FC<Props> = ({
children, children,
title,
links, links,
search, search,
author,
}) => { }) => {
const router = useRouter(); const router = useRouter();
const [isOpen, setIsOpen] = useState(false); const [isOpen, setIsOpen] = useState(false);
@ -77,8 +73,8 @@ export const NavMobile: React.FC<Props> = ({
legacyBehavior legacyBehavior
> >
{/* <Logomark className="h-9 w-9" /> */} {/* <Logomark className="h-9 w-9" /> */}
<div className="font-extrabold text-primary dark:text-primary-dark text-2xl ml-6"> <div className="font-extrabold text-primary dark:text-primary-dark text-lg ml-6">
{author} {title}
</div> </div>
</Link> </Link>
</div> </div>
@ -106,9 +102,7 @@ export const NavMobile: React.FC<Props> = ({
))} ))}
</ul> </ul>
)} )}
{/* <div className="pt-6 border border-t-2"> <div className="pt-6">{children}</div>
{children}
</div> */}
</Dialog.Panel> </Dialog.Panel>
</Dialog> </Dialog>
</> </>