Files
stash/stash-web/src/components/content/AppGrid.tsx
T
stash 1bdcca025b fix(web): 恢复与旧版一致的布局与组件参数
- 布局:Layout 使用 contained(1380)+gutter20+siderWidth240+gap20、solid 60px 页头、整屏内部滚动
- 搜索框恢复悬浮居中;侧栏与内容恢复 52/88px 顶部偏移
- 新增并使用 @stash/ui 的 Cover(海报 2:3 / 图文 4:3 / 宽图)替换手写封面
- 头像恢复 64px 品牌底色;正文恢复 14/1.9;详情标题、标签、引用、统计、跳转按原版还原
- 分区卡 padding 20、分区标题 16、网格间距 12/16 对齐原值
2026-10-28 18:12:14 +08:00

28 lines
742 B
TypeScript

import { Grid } from '@stash/ui'
import type { AppItem } from '../../data/types'
import { AppCard } from './AppCard'
/** 应用网格:桌面 4 列,平板 / 手机 2 列(断点由组件库 Grid 负责) */
type AppGridProps = {
items: AppItem[]
/** 明细页使用更宽松的间距 */
variant?: 'home' | 'detail'
/** 点击卡片打开条目详情 */
onOpen?: (itemId: string) => void
}
export function AppGrid({ items, variant = 'home', onOpen }: AppGridProps) {
return (
<Grid
columns={4}
tabletColumns={2}
mobileColumns={2}
gap={variant === 'detail' ? 'lg' : 'md'}
>
{items.map((item) => (
<AppCard key={item.id} item={item} onOpen={onOpen} />
))}
</Grid>
)
}