Skip to content

Commit

Permalink
update header from JSX.Element to ReactNode for flexibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Yen Truong committed Sep 21, 2023
1 parent 38947e2 commit daede69
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/chat-ui-react.chatpanelprops.header.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ A header to render at the top of the panel.
**Signature:**

```typescript
header?: JSX.Element;
header?: ReactNode;
```
2 changes: 1 addition & 1 deletion docs/chat-ui-react.chatpanelprops.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export interface ChatPanelProps extends Omit<MessageBubbleProps, "customCssClass
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [customCssClasses?](./chat-ui-react.chatpanelprops.customcssclasses.md) | | [ChatPanelCssClasses](./chat-ui-react.chatpanelcssclasses.md) | _(Optional)_ CSS classes for customizing the component styling. |
| [header?](./chat-ui-react.chatpanelprops.header.md) | | JSX.Element | _(Optional)_ A header to render at the top of the panel. |
| [header?](./chat-ui-react.chatpanelprops.header.md) | | ReactNode | _(Optional)_ A header to render at the top of the panel. |
3 changes: 2 additions & 1 deletion etc/chat-ui-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import { Message } from '@yext/chat-headless-react';
import { default as React_2 } from 'react';
import { ReactNode } from 'react';

// @public
export function ChatHeader({ title, showRestartButton, restartButtonIcon, showCloseButton, closeButtonIcon, onClose, customCssClasses, }: ChatHeaderProps): React_2.JSX.Element;
Expand Down Expand Up @@ -82,7 +83,7 @@ export interface ChatPanelCssClasses {
// @public
export interface ChatPanelProps extends Omit<MessageBubbleProps, "customCssClasses" | "message">, Omit<ChatInputProps, "customCssClasses"> {
customCssClasses?: ChatPanelCssClasses;
header?: JSX.Element;
header?: ReactNode;
}

// @public
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/components/ChatPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useEffect, useRef } from "react";
import React, { ReactNode, useCallback, useEffect, useRef } from "react";
import { useChatState, useChatActions } from "@yext/chat-headless-react";
import {
MessageBubble,
Expand Down Expand Up @@ -48,7 +48,7 @@ export interface ChatPanelProps
extends Omit<MessageBubbleProps, "customCssClasses" | "message">,
Omit<ChatInputProps, "customCssClasses"> {
/** A header to render at the top of the panel. */
header?: JSX.Element;
header?: ReactNode;
/**
* CSS classes for customizing the component styling.
*/
Expand Down

0 comments on commit daede69

Please sign in to comment.