feat(settings): 插件二级页顶部改面包屑导航(shadcn Breadcrumb 语义)
This commit is contained in:
@@ -2,8 +2,8 @@ import { memo, useEffect, useMemo, useRef, useState, useTransition, type ReactNo
|
||||
import type { JSX, RefObject } from 'react'
|
||||
import { useVirtualizer } from '@tanstack/react-virtual'
|
||||
import {
|
||||
LuArrowLeft,
|
||||
LuCheck,
|
||||
LuChevronRight,
|
||||
LuCpu,
|
||||
LuDatabase,
|
||||
LuFolderOpen,
|
||||
@@ -1542,20 +1542,27 @@ export function SettingsModal({
|
||||
{/* 右侧:内容页 */}
|
||||
<div className="flex min-w-0 flex-1 flex-col">
|
||||
<div className="flex items-start gap-3 px-6 pb-3 pt-5">
|
||||
{tab.startsWith('plugin:') && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setTab('plugins')}
|
||||
className="mt-0.5 flex shrink-0 items-center gap-1 rounded-control px-1.5 py-1 text-[11.5px] text-ink-3 transition-colors hover:bg-hover hover:text-ink"
|
||||
>
|
||||
<LuArrowLeft size={13} />
|
||||
返回
|
||||
</button>
|
||||
{tab.startsWith('plugin:') ? (
|
||||
// 二级页顶部:面包屑导航(shadcn Breadcrumb 语义——上级可点、ChevronRight 分隔、当前页前景色不可点)
|
||||
<nav aria-label="面包屑" className="mt-1 flex min-w-0 flex-1 items-center gap-1.5 text-[12.5px]">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setTab('plugins')}
|
||||
className="shrink-0 rounded-control px-1 py-0.5 text-ink-3 transition-colors hover:bg-hover hover:text-ink"
|
||||
>
|
||||
插件
|
||||
</button>
|
||||
<LuChevronRight size={13} aria-hidden="true" className="shrink-0 text-ink-3" />
|
||||
<span aria-current="page" className="min-w-0 truncate font-medium text-ink">
|
||||
{plugins.find((p) => `plugin:${p.manifest.id}` === tab)?.manifest.name ?? '插件'}
|
||||
</span>
|
||||
</nav>
|
||||
) : (
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="text-[16px] font-semibold text-ink">{meta.title}</div>
|
||||
{meta.desc && <div className="mt-0.5 text-[12px] leading-5 text-ink-3">{meta.desc}</div>}
|
||||
</div>
|
||||
)}
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="text-[16px] font-semibold text-ink">{meta.title}</div>
|
||||
{meta.desc && <div className="mt-0.5 text-[12px] leading-5 text-ink-3">{meta.desc}</div>}
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClose}
|
||||
|
||||
Reference in New Issue
Block a user