-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add an option for a footer and a custom header in the ChatPopUp #41
base: main
Are you sure you want to change the base?
Conversation
What do you think about making the |
Or actually sorry, I didn't realize the footer accepted markdown. Might still be nice to accept a React Node though. Curious what others think. |
@@ -88,6 +88,8 @@ export function ChatPopUp(props: ChatPopUpProps) { | |||
showRestartButton = true, | |||
onClose: customOnClose, | |||
title, | |||
footer, | |||
header, |
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.
thinking about it more, this wouldn't work because the header component needs to take in the onClose
function below in order to control the display behavior of the chat popup/panel. We would need to take in a header component type and construct it inside.
I have added support for the footer in this PR and added an item in the backlog for custom header support |
We wanted to add a footer to the
ChatPopUp
, but we noticed that the component is not very flexible. There was no way to add the footer outside the component and style it in the correct position as the pop up chat hasposition: fixed
styling.So, I wanted to propose a small feature - adding an option for a footer text. This would be helpful for displaying a link to the Privacy Policy for example.
I added the footer inside the
ChatPanel
component, so it can be displayed in theChatPopUp
component as well and be in the correct position.This PR is just a quick example, the footer can be converted into a separate component of course, for now, I just added it as a div inside the
ChatPanel
component.The only thing I couldn't add is the styling for links inside the footer. In the example below I'm using
react-markdown
to render rich text and display a link. Ideally, the link should be styled in a different color.