mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-08-12 16:12:23 +00:00
update
This commit is contained in:
parent
c181a657bd
commit
81bb5574e0
@ -1,17 +1,15 @@
|
||||
import type { ReactNode } from "react"
|
||||
import type React from "react"
|
||||
import DocSidebar from "@/components/DocSidebar"
|
||||
import Footer from "@/components/footer"
|
||||
|
||||
interface LayoutProps {
|
||||
children: ReactNode
|
||||
}
|
||||
|
||||
export default function DocsLayout({ children }: LayoutProps) {
|
||||
export default function DocsLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<div className="flex flex-col lg:flex-row min-h-screen bg-white text-gray-900">
|
||||
<DocSidebar />
|
||||
<main className="flex-1 p-4 lg:p-8 pt-24 lg:pt-8 overflow-y-auto">
|
||||
<div className="max-w-3xl mx-auto lg:mx-0 lg:mr-auto">{children}</div>
|
||||
</main>
|
||||
<div className="flex flex-col min-h-screen bg-white text-gray-900">
|
||||
<div className="flex flex-col md:flex-row flex-1 pt-16 md:pt-0">
|
||||
<DocSidebar />
|
||||
<main className="flex-1 p-4 md:p-6">{children}</main>
|
||||
</div>
|
||||
<Footer />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ export default function DocSidebar() {
|
||||
|
||||
useEffect(() => {
|
||||
const handleResize = () => {
|
||||
if (window.innerWidth >= 1024) {
|
||||
if (window.innerWidth >= 768) {
|
||||
setIsMobileMenuOpen(false)
|
||||
}
|
||||
}
|
||||
@ -126,27 +126,30 @@ export default function DocSidebar() {
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="lg:hidden fixed top-16 left-0 right-0 z-40 bg-gray-100 border-b border-gray-200">
|
||||
<button
|
||||
className="w-full p-4 text-left flex items-center justify-between"
|
||||
onClick={toggleMobileMenu}
|
||||
aria-label="Toggle menu"
|
||||
>
|
||||
<span className="font-semibold">Documentation</span>
|
||||
{isMobileMenuOpen ? <X className="h-6 w-6" /> : <Menu className="h-6 w-6" />}
|
||||
</button>
|
||||
</div>
|
||||
<nav
|
||||
className={`fixed lg:sticky lg:top-16 left-0 w-full lg:w-64 h-[calc(100vh-104px)] lg:h-[calc(100vh-64px)] bg-gray-100 p-4 lg:p-6 transform ${
|
||||
isMobileMenuOpen ? "translate-y-0" : "-translate-y-full"
|
||||
} lg:translate-y-0 transition-transform duration-300 ease-in-out overflow-y-auto z-30`}
|
||||
return (
|
||||
<>
|
||||
|
||||
<div className="md:hidden fixed top-16 left-0 right-0 z-40 bg-gray-100 border-b border-gray-200">
|
||||
<button
|
||||
className="w-full p-4 text-left flex items-center justify-between"
|
||||
onClick={toggleMobileMenu}
|
||||
aria-label="Toggle menu"
|
||||
>
|
||||
<h2 className="text-lg font-semibold mb-4 text-gray-900 lg:mt-0 sr-only lg:not-sr-only">Documentation</h2>
|
||||
<ul className="space-y-2">{sidebarItems.map(renderMenuItem)}</ul>
|
||||
</nav>
|
||||
</>
|
||||
)
|
||||
<span className="font-semibold">Documentation</span>
|
||||
{isMobileMenuOpen ? <X className="h-6 w-6" /> : <Menu className="h-6 w-6" />}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<nav
|
||||
className={`fixed md:static top-[104px] left-0 w-full md:min-w-[260px] md:max-w-[260px] h-[calc(100vh-104px)] md:h-auto bg-gray-100 p-4 md:p-6 transform ${
|
||||
isMobileMenuOpen ? "translate-y-0" : "-translate-y-full"
|
||||
} md:translate-y-0 transition-transform duration-300 ease-in-out overflow-y-auto z-30`}
|
||||
>
|
||||
<h2 className="text-lg font-semibold mb-4 text-gray-900 md:mt-0 sr-only md:not-sr-only">Documentation</h2>
|
||||
<ul className="space-y-2">{sidebarItems.map(renderMenuItem)}</ul>
|
||||
</nav>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user