优化主页,提供通用页面模板组件

This commit is contained in:
2025-12-15 14:09:17 +08:00
parent fd2afe5e01
commit c16bd76821
10 changed files with 509 additions and 475 deletions

View File

@@ -1,22 +1,19 @@
import BreadCrumb from '@/components/bread-crumb'
import Wrap from '@/components/wrap'
import {Children} from '@/lib/utils'
import Sidebar from './sidebar'
import HomePage from '@/components/home/page'
export default function DocsLayout(props: Children) {
return (
<main className="mt-20 flex flex-col gap-4">
<Wrap className="flex flex-col py-8 gap-8">
<BreadCrumb items={[
{label: '帮助中心', href: '/help'},
]}/>
<div className="flex gap-6">
<Sidebar/>
<div className="flex-1 bg-white rounded-lg p-6 min-h-[420px]">
{props.children}
</div>
<HomePage path={[
{label: '帮助中心', href: '/docs'},
]}>
<Wrap className="flex gap-3">
<Sidebar/>
<div className="flex-1 bg-white rounded-lg p-6 min-h-[420px]">
{props.children}
</div>
</Wrap>
</main>
</HomePage>
)
}

View File

@@ -0,0 +1,9 @@
import Link from 'next/link'
import {Card, CardContent, CardDescription, CardHeader, CardTitle} from '@/components/ui/card'
import {BookOpen, Lightbulb, Smartphone, Zap, HelpCircle, FileText, Settings, TrendingUp} from 'lucide-react'
export default function DocsIndexPage() {
return (
<div></div>
)
}

View File

@@ -29,7 +29,7 @@ const MENU_ITEMS = [
{
group: '操作指南',
items: [
{key: 'windows7-proxy', label: 'Windows7电脑设置代理教程'},
{key: 'win7-proxy', label: 'Windows7电脑设置代理教程'},
{key: 'mac-proxy', label: 'MAC设置代理教程'},
{key: 'firefox-proxy', label: '火狐浏览器设置代理'},
{key: 'socks5-usage', label: 'Socks5代理使用教程'},
@@ -110,7 +110,7 @@ export default function Sidebar({collapsed = false}: Props) {
return (
<aside
className={`bg-white rounded-lg p-3 transition-all duration-200 shrink-0 ${
collapsed ? 'w-20' : 'w-72'
collapsed ? 'w-20' : 'w-68'
}`}
>
<nav className="space-y-2">
@@ -129,7 +129,7 @@ export default function Sidebar({collapsed = false}: Props) {
finalExpandedGroups[section.group] ? 'rotate-90' : ''
}`}
>
<ChevronRight size={16} />
<ChevronRight size={16}/>
</div>
{!collapsed && (
@@ -141,7 +141,7 @@ export default function Sidebar({collapsed = false}: Props) {
{finalExpandedGroups[section.group] && (
<ul className={`mt-1 text-base ${collapsed ? 'hidden' : 'block'}`}>
{section.items.map(item => {
{section.items.map((item) => {
const isActive = currentKey === item.key
const href = getItemHref(item.key)