-
Notifications
You must be signed in to change notification settings - Fork 1
Add an option for a footer and a custom header in the ChatPopUp #41
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: main
Are you sure you want to change the base?
Changes from all commits
2f0bf1a
dd01b40
b2f1c13
b84632f
2a2ecdd
39376da
4fadb57
78a4296
0541d29
9d1977d
fd6eb23
5f01935
2b5f31b
70e82a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [@yext/chat-ui-react](./chat-ui-react.md) > [ChatPanelProps](./chat-ui-react.chatpanelprops.md) > [footer](./chat-ui-react.chatpanelprops.footer.md) | ||
|
|
||
| ## ChatPanelProps.footer property | ||
|
|
||
| A footer component to render at the bottom of the panel | ||
|
|
||
| **Signature:** | ||
|
|
||
| ```typescript | ||
| footer?: React.ReactNode; | ||
| ``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,7 +64,7 @@ const builtInCssClasses: ChatPopUpCssClasses = withStylelessCssClasses( | |
| */ | ||
| export interface ChatPopUpProps | ||
| extends Omit<ChatHeaderProps, "showCloseButton" | "customCssClasses">, | ||
| Omit<ChatPanelProps, "header" | "customCssClasses"> { | ||
| Omit<ChatPanelProps, "customCssClasses"> { | ||
| /** Custom icon for the popup button to open the panel. */ | ||
| openPanelButtonIcon?: JSX.Element; | ||
| /** | ||
|
|
@@ -88,6 +88,8 @@ export function ChatPopUp(props: ChatPopUpProps) { | |
| showRestartButton = true, | ||
| onClose: customOnClose, | ||
| title, | ||
| footer, | ||
| header, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thinking about it more, this wouldn't work because the header component needs to take in the |
||
| } = props; | ||
| const reportAnalyticsEvent = useReportAnalyticsEvent(); | ||
|
|
||
|
|
@@ -125,14 +127,19 @@ export function ChatPopUp(props: ChatPopUpProps) { | |
| {...props} | ||
| customCssClasses={cssClasses.panelCssClasses} | ||
| header={ | ||
| <ChatHeader | ||
| title={title} | ||
| showRestartButton={showRestartButton} | ||
| showCloseButton={true} | ||
| onClose={onClose} | ||
| customCssClasses={cssClasses.headerCssClasses} | ||
| /> | ||
| header ? ( | ||
| header | ||
| ) : ( | ||
| <ChatHeader | ||
| title={title} | ||
| showRestartButton={showRestartButton} | ||
| showCloseButton={true} | ||
| onClose={onClose} | ||
| customCssClasses={cssClasses.headerCssClasses} | ||
| /> | ||
| ) | ||
| } | ||
| footer={footer} | ||
| /> | ||
| </div> | ||
| <button | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.