Skip to content
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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

petia182
Copy link

@petia182 petia182 commented Sep 21, 2023

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 has position: 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 the ChatPopUp 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.

Screenshot 2023-09-21 at 11 15 45

@petia182 petia182 requested a review from a team as a code owner September 21, 2023 10:16
@petia182 petia182 changed the title Feature Proposal - Add option for a footer in the chat panel Feature Proposal - Add an option for a footer in the chat panel Sep 21, 2023
@mdavish
Copy link

mdavish commented Sep 21, 2023

What do you think about making the footer prop accept string | ReactNode so that you can write your own JSX if need be? I imagine it'll be common to want <a/> tags in your footer.

@mdavish
Copy link

mdavish commented Sep 21, 2023

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.

@petia182 petia182 changed the title Feature Proposal - Add an option for a footer in the chat panel Feature Proposal - Add an option for a footer and a custom header in the chat panel Sep 21, 2023
@petia182 petia182 requested a review from yen-tt September 21, 2023 22:24
@petia182 petia182 changed the title Feature Proposal - Add an option for a footer and a custom header in the chat panel Add an option for a footer and a custom header in the ChatPopUp Sep 22, 2023
@@ -88,6 +88,8 @@ export function ChatPopUp(props: ChatPopUpProps) {
showRestartButton = true,
onClose: customOnClose,
title,
footer,
header,
Copy link
Collaborator

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.

@anguyen-yext2
Copy link
Contributor

I have added support for the footer in this PR and added an item in the backlog for custom header support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants