Skip to content

feat(message): support theme-aware icon callbacks in message config#4288

Open
Malusnow wants to merge 1 commit into
Tencent:developfrom
Malusnow:feat/message-icon-theme-callback
Open

feat(message): support theme-aware icon callbacks in message config#4288
Malusnow wants to merge 1 commit into
Tencent:developfrom
Malusnow:feat/message-icon-theme-callback

Conversation

@Malusnow

Copy link
Copy Markdown

Allow message.config to accept icon callbacks that receive the current message theme, so global message icons can be customized dynamically per theme.

re #3804

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

#3804

💡 需求背景和解决方案

Issue #3804 希望 message.config 的全局 icon 配置能够根据当前消息的 theme 动态切换,而不是只能使用单一静态图标。
本次改动在 Message 渲染 icon 时改为通过 parseTNode 解析,并向函数型 icon 传入当前 { theme }。这样既兼容原有用法,也支持按消息类型动态返回图标。

📝 更新日志

  • 本条 PR 不需要纳入 Changelog

tdesign-react

feat(message): support theme-aware icon callbacks in message config

@tdesign-react/chat

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

Allow `message.config` to accept icon callbacks that receive the current message theme, so global
message icons can be customized dynamically per theme.

re Tencent#3804
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant