refactor: 重组 components/ 和 pages/ 文件结构,按职责分层
components/ 拆为三层:
- providers/ — 状态管理(App/Theme/SettingsProvider)
- shell/ — 应用外壳(Layout/NavBar/PageDispatcher)
- ui/ — 通用 UI 原子(FloatingPanel/LegalTextModal)
pages/ 重命名 + 重组:
- headers/ → panels/ NavBar 触发的面板页
- login/ → auth/ 认证模块(含注册/忘记密码)
- settings/blocks/ → sections/
- home/components/ → panels/ features/ controls/ hooks/
按职责分:panels(布局壳) + features(功能面板) + controls(表单控件) + hooks
其他清理:
- 删除空占位 Test3.tsx
- HomeContext 从 HomeContent 拆出独立文件
- uploadValidation 内联到 ImageInput
- 修复过时注释(useUI → controls)
This commit is contained in:
21
src/pages/home/controls/LineInput.tsx
Normal file
21
src/pages/home/controls/LineInput.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
// ============================================================
|
||||
// LineInput — lineEdit → Input
|
||||
// 用于单行文本输入(如 custom_voice_id)
|
||||
// 同时作为未知 widget 类型的兜底控件
|
||||
// ============================================================
|
||||
|
||||
import { Input } from 'antd';
|
||||
import type { WidgetProps } from './types';
|
||||
|
||||
export function LineInput({ value, onChange, disabled, config }: WidgetProps) {
|
||||
return (
|
||||
<Input
|
||||
value={value as string}
|
||||
onChange={(e) => onChange?.(e.target.value)}
|
||||
disabled={disabled}
|
||||
placeholder={(config.placeholder as string) || '请输入'}
|
||||
maxLength={config.maxLength as number | undefined}
|
||||
allowClear
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user