tdesign-react
tdesign-react copied to clipboard
feat(message): support theme-aware icon callbacks in message config
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 修复
- [x] 新特性提交
- [ ] 文档改进
- [ ] 演示代码改进
- [ ] 组件样式/交互改进
- [ ] CI/CD 改进
- [ ] 重构
- [ ] 代码风格优化
- [ ] 测试用例
- [ ] 分支合并
- [ ] 其他
🔗 相关 Issue
#3804
其他相关PR
https://github.com/TDesignOteam/tdesign-api/pull/909
💡 需求背景和解决方案
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
☑️ 请求合并前的自查清单
⚠️ 请自检并全部勾选全部选项。⚠️
- [x] 文档已补充或无须补充
- [x] 代码演示已提供或无须提供
- [x] TypeScript 定义已补充或无须补充
- [x] Changelog 已提供或无须提供
可以考虑去 API 仓库也提一个 PR:https://github.com/TDesignOteam/tdesign-api
-
npm i https://pkg.pr.new/Tencent/tdesign-react@4288npm i https://pkg.pr.new/Tencent/tdesign-react/@tdesign-react/chat@4288
commit: 8627c4b
