feat: 在 DynamicNewsCard 头部集成搜索和筛选功能
功能新增:
- 将 UnifiedSearchBox 组件集成到 DynamicNewsCard 的 CardHeader 中
- 实现 DynamicNewsCard 和 EventTimelineCard 共享筛选状态
- 用户可在动态新闻区域直接进行搜索和筛选操作
组件修改:
- DynamicNewsCard.js:
* 导入 UnifiedSearchBox 组件
* 添加 filters, popularKeywords, onSearch, onSearchFocus 等 props
* 在 CardHeader 内部渲染搜索框(标题下方,mt={4})
- Community/index.js:
* 向 DynamicNewsCard 传递筛选状态和回调函数
* filters 和 popularKeywords 数据传递
* updateFilters 和 scrollToTimeline 回调传递
布局结构:
CardHeader
├─ 第一行:标题、徽章、更新时间
└─ 第二行:UnifiedSearchBox(搜索框 + 热门概念 + 筛选器)
状态管理:
- 使用共享的 filters 状态(来自 useEventFilters hook)
- 搜索操作通过 updateFilters 回调同步到父组件
- 两个组件的筛选条件保持一致
用户体验提升:
- 用户无需滚动到页面底部即可进行搜索
- 动态新闻区域功能更完整和独立
- 搜索结果在两个组件间同步显示
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -171,7 +171,11 @@ const Community = () => {
|
||||
events={dynamicNewsEvents}
|
||||
loading={dynamicNewsLoading}
|
||||
pagination={dynamicNewsPagination}
|
||||
filters={filters}
|
||||
popularKeywords={popularKeywords}
|
||||
lastUpdateTime={lastUpdateTime}
|
||||
onSearch={updateFilters}
|
||||
onSearchFocus={scrollToTimeline}
|
||||
onEventClick={handleEventClick}
|
||||
onViewDetail={handleViewDetail}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user