mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-10 06:20:58 +08:00
refactor: restructure project directories for better modularity
- Delete llm/ dead code (3 files, zero references) - Split mcp/ into sub-packages: mcp/provider/ (8 providers) and mcp/payment/ (4 payment clients) with registry pattern - Export Client internal fields and ClientHooks interface for sub-package access - Split api/server.go (3892 lines) into 8 domain-specific handler files - Split trader/auto_trader.go (2296 lines) into 5 focused files - Reorganize web/src/components/ flat files into auth/, charts/, trader/, common/, modals/, backtest/ subdirectories - Update all consumer imports to use registry-based provider creation
This commit is contained in:
40
web/src/components/common/Container.tsx
Normal file
40
web/src/components/common/Container.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import { ReactNode, CSSProperties } from 'react'
|
||||
|
||||
interface ContainerProps {
|
||||
children: ReactNode
|
||||
className?: string
|
||||
as?: 'div' | 'main' | 'header' | 'section'
|
||||
style?: CSSProperties
|
||||
/** 是否充满宽度(取消 max-width) */
|
||||
fluid?: boolean
|
||||
/** 是否取消水平内边距 */
|
||||
noPadding?: boolean
|
||||
/** 自定义最大宽度类(默认 max-w-[1920px]) */
|
||||
maxWidthClass?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一的容器组件,确保所有页面元素使用一致的最大宽度和内边距
|
||||
* - max-width: 1920px
|
||||
* - padding: 24px (mobile) -> 32px (tablet) -> 48px (desktop)
|
||||
*/
|
||||
export function Container({
|
||||
children,
|
||||
className = '',
|
||||
as: Component = 'div',
|
||||
style,
|
||||
fluid = false,
|
||||
noPadding = false,
|
||||
maxWidthClass = 'max-w-[1920px]',
|
||||
}: ContainerProps) {
|
||||
const maxWidth = fluid ? 'w-full' : maxWidthClass
|
||||
const padding = noPadding ? 'px-0' : 'px-6 sm:px-8 lg:px-12'
|
||||
return (
|
||||
<Component
|
||||
className={`${maxWidth} mx-auto ${padding} ${className}`}
|
||||
style={style}
|
||||
>
|
||||
{children}
|
||||
</Component>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user