-
-
Notifications
You must be signed in to change notification settings - Fork 565
feat: 调整Bubble foot,header参数,支持头部获取上下文 #683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Walkthrough此PR调整了Bubble组件的header和footer参数,允许头部和底部内容获取上下文信息。通过引入 Changes
|
#678 延续至提交 |
@@ -173,7 +182,7 @@ const Bubble: React.ForwardRefRenderFunction<BubbleRef, BubbleProps> = (props, r | |||
...styles.footer, | |||
}} | |||
> | |||
{typeof footer === 'function' ? footer(mergedContent) : footer} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
别动参数格式,保持一致。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
别动参数格式,保持一致。
如果还没有发布建议为对象
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还有哪些参数可传,目前看只有一个 content?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还有哪些参数可传,目前看只有一个 content?
为了后续的扩展
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
后续扩展可以放第二个参数 info: object,第一个参数用 content: string 大多数场景的实现会简单很多
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
赞同
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
别动参数格式,保持一致。
现在的 messageRender
是专门给 typedContent
渲染用的。header
和 footer
是非特定渲染,我给的推荐是 info 带上 content 的形式,否则如果未来有个 avatarRender
给的是 role
作为参数。这个 header
or footer
也不可能是 RenderFunc = (typedContent: string, role: string, ...) => ReactNode;
Bundle ReportChanges will increase total bundle size by 13 bytes (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: antdx-array-pushAssets Changed:
|
fix: 调整用例
|
这用例报错看起来跟我这没啥关系 |
| avatar | Avatar component | React.ReactNode | - | | | ||
| classNames | Semantic DOM class | [Record<SemanticDOM, string>](#semantic-dom) | - | | | ||
| content | Content of bubble | string | - | | | ||
| footer | Footer content | React.ReactNode \| (content: [BubbleContentType](https://github.com/ant-design/x/blob/d3232c925a0dc61ad763c6664e16f07323ebca4a/components/bubble/interface.ts#L21)) => React.ReactNode | - | | | ||
| header | Header content | React.ReactNode | - | | | ||
| header | Header content | React.ReactNode \| (content: [BubbleContentType](https://github.com/ant-design/x/blob/d3232c925a0dc61ad763c6664e16f07323ebca4a/components/bubble/interface.ts#L21)) => React.ReactNode | - | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node: React.ReactNode | ((content: BubbleContentType) => React.ReactNode), | ||
) => { | ||
if (typeof node === 'function') { | ||
return node(typedContent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中文版模板 / Chinese template
🤔 This is a ...
🔗 Related Issues
💡 Background and Solution
📝 Change Log