fix: 插件设置页加返回按钮;修复 string/number 输入框 w-full 覆盖定宽导致 label 被挤成竖排
This commit is contained in:
@@ -2,6 +2,7 @@ import { memo, useEffect, useMemo, useRef, useState, useTransition, type ReactNo
|
|||||||
import type { JSX, RefObject } from 'react'
|
import type { JSX, RefObject } from 'react'
|
||||||
import { useVirtualizer } from '@tanstack/react-virtual'
|
import { useVirtualizer } from '@tanstack/react-virtual'
|
||||||
import {
|
import {
|
||||||
|
LuArrowLeft,
|
||||||
LuCheck,
|
LuCheck,
|
||||||
LuCpu,
|
LuCpu,
|
||||||
LuFolderOpen,
|
LuFolderOpen,
|
||||||
@@ -878,8 +879,9 @@ function PluginSettingsForm({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 注意不要写 w-full:string/number 控件要定宽(w-56/w-28)跟 label 同行,w-full 会把 label 挤成竖排
|
||||||
const inputCls =
|
const inputCls =
|
||||||
'w-full rounded-control border border-line-strong bg-surface px-2.5 py-1.5 text-[12px] text-ink outline-none placeholder:text-ink-3 focus:border-ink-3'
|
'rounded-control border border-line-strong bg-surface px-2.5 py-1.5 text-[12px] text-ink outline-none placeholder:text-ink-3 focus:border-ink-3'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
@@ -953,7 +955,7 @@ function PluginSettingsForm({
|
|||||||
value={typeof value === 'string' ? value : ''}
|
value={typeof value === 'string' ? value : ''}
|
||||||
placeholder={item.placeholder}
|
placeholder={item.placeholder}
|
||||||
onChange={(e) => onChange(item.key, e.target.value)}
|
onChange={(e) => onChange(item.key, e.target.value)}
|
||||||
className={`${inputCls} mt-2 resize-y font-mono`}
|
className={`${inputCls} mt-2 w-full resize-y font-mono`}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -1389,6 +1391,16 @@ export function SettingsModal({
|
|||||||
{/* 右侧:内容页 */}
|
{/* 右侧:内容页 */}
|
||||||
<div className="flex min-w-0 flex-1 flex-col">
|
<div className="flex min-w-0 flex-1 flex-col">
|
||||||
<div className="flex items-start gap-3 px-6 pb-3 pt-5">
|
<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 border border-line-strong px-2 py-1 text-[11.5px] text-ink transition-colors hover:bg-hover"
|
||||||
|
>
|
||||||
|
<LuArrowLeft size={13} />
|
||||||
|
返回
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
<div className="min-w-0 flex-1">
|
<div className="min-w-0 flex-1">
|
||||||
<div className="text-[16px] font-semibold text-ink">{meta.title}</div>
|
<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>}
|
{meta.desc && <div className="mt-0.5 text-[12px] leading-5 text-ink-3">{meta.desc}</div>}
|
||||||
|
|||||||
Reference in New Issue
Block a user