Files
zeekay cde0931f47 chore: migrate from fumadocs to @hanzo/docs
- Update dependencies to @hanzo/docs packages (16.2.9)
- Update imports: fumadocs-ui -> @hanzo/docs/ui
- Update CSS import to @hanzo/docs/ui/css/neutral.css
- Add autoprefixer dependency
- Compatible with Next.js 16.1.1
2026-01-02 23:08:37 -08:00

144 lines
5.8 KiB
TypeScript

import { DocsLayout } from '@hanzo/docs/ui/layouts/docs'
import type { ReactNode } from 'react'
import { ExternalLink, Github } from 'lucide-react'
import { Logo, LogoWithText } from '@/components/logo'
import { source } from '@/lib/source'
// ============================================================================
// CUSTOM ICONS - Discord, X (Twitter), Warpcast
// ============================================================================
function DiscordIcon({ className }: { className?: string }) {
return (
<svg className={className} viewBox="0 0 24 24" fill="currentColor">
<path d="M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"/>
</svg>
)
}
function WarpcastIcon({ className }: { className?: string }) {
return (
<svg className={className} viewBox="0 0 24 24" fill="currentColor">
<path d="M18.24 2.4H5.76A3.36 3.36 0 0 0 2.4 5.76v12.48a3.36 3.36 0 0 0 3.36 3.36h12.48a3.36 3.36 0 0 0 3.36-3.36V5.76a3.36 3.36 0 0 0-3.36-3.36zm-1.44 13.44c0 .528-.432.96-.96.96H8.16a.96.96 0 0 1-.96-.96v-1.92h2.88v.96h3.84v-.96h2.88v1.92zm0-4.32H7.2V9.6h9.6v1.92zm0-3.84H7.2V5.76h9.6v1.92z"/>
</svg>
)
}
function XIcon({ className }: { className?: string }) {
return (
<svg className={className} viewBox="0 0 24 24" fill="currentColor">
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>
</svg>
)
}
// ============================================================================
// CONFIGURE YOUR DOCS SITE HERE
// ============================================================================
const DOCS_CONFIG = {
// Site name shown in sidebar header
name: 'Docs Template',
// GitHub repository URL
github: 'https://github.com/luxfi/docs-template',
// Social links
socials: {
website: 'https://lux.network',
discord: 'https://discord.gg/luxfi',
twitter: 'https://x.com/luxdefi',
warpcast: 'https://warpcast.com/luxfi',
},
// Additional footer links
footerLinks: [
{
text: 'View on GitHub',
url: 'https://github.com/luxfi/docs-template',
icon: 'github',
},
// Add more links here, e.g.:
// {
// text: 'LP-XXXX Specification',
// url: 'https://lps.lux.network/docs/lp-xxxx',
// icon: 'external',
// },
],
}
export default function Layout({ children }: { children: ReactNode }) {
return (
<DocsLayout
tree={source.pageTree}
nav={{
title: <LogoWithText size={24} name={DOCS_CONFIG.name} />,
}}
sidebar={{
defaultOpenLevel: 1,
footer: (
<div className="flex flex-col gap-3 text-xs">
{/* Social icons row */}
<div className="flex items-center gap-3">
<a
href={DOCS_CONFIG.socials.website}
target="_blank"
rel="noopener noreferrer"
className="text-fd-muted-foreground hover:text-fd-foreground transition-colors"
title="Lux Network"
>
<Logo size={20} />
</a>
<a
href={DOCS_CONFIG.socials.discord}
target="_blank"
rel="noopener noreferrer"
className="text-fd-muted-foreground hover:text-fd-foreground transition-colors"
title="Discord"
>
<DiscordIcon className="size-5" />
</a>
<a
href={DOCS_CONFIG.socials.twitter}
target="_blank"
rel="noopener noreferrer"
className="text-fd-muted-foreground hover:text-fd-foreground transition-colors"
title="X"
>
<XIcon className="size-5" />
</a>
<a
href={DOCS_CONFIG.socials.warpcast}
target="_blank"
rel="noopener noreferrer"
className="text-fd-muted-foreground hover:text-fd-foreground transition-colors"
title="Warpcast"
>
<WarpcastIcon className="size-5" />
</a>
</div>
{/* Footer links */}
{DOCS_CONFIG.footerLinks.map((link, index) => (
<a
key={index}
href={link.url}
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-2 text-fd-muted-foreground hover:text-fd-foreground transition-colors"
>
{link.icon === 'github' ? (
<Github className="size-4" />
) : (
<ExternalLink className="size-4" />
)}
{link.text}
</a>
))}
</div>
),
}}
>
{children}
</DocsLayout>
)
}