Skip to content

Commit

Permalink
Make ChatMessage accept react node as children (#1413)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinchi2013 committed Nov 13, 2023
1 parent acd674e commit a61ce6e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "pcln-design-system",
"comment": "update ChatMessage accepts react node as child",
"type": "patch"
}
],
"packageName": "pcln-design-system"
}
4 changes: 4 additions & 0 deletions packages/core/src/ChatMessage/ChatMessage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export const InitialMessage: ChatMessageStory = {
render: (args) => <ChatMessage {...args} variation='initial' />,
}

export const WithReactNodeMessage: ChatMessageStory = {
render: (args) => <ChatMessage {...args} variation='initial' message={<div>How can I help you?</div>} />,
}

export const IncomingMessage: ChatMessageStory = {
render: (args) => <ChatMessage {...args} variation='incoming' />,
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/ChatMessage/ChatMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export interface IChatMessage extends IFlexProps {
footer?: React.ReactNode
header?: React.ReactNode
Icon?: React.FC<{ color?: string; size?: string }>
message: string
message: React.ReactNode
variation: (typeof variationNames)[number]
}

Expand Down

0 comments on commit a61ce6e

Please sign in to comment.