Skip to content

Instantly share code, notes, and snippets.

@FredrikOseberg
Created April 19, 2020 20:37
Show Gist options
  • Save FredrikOseberg/af04e2e30407671412af08fa3c429409 to your computer and use it in GitHub Desktop.
Save FredrikOseberg/af04e2e30407671412af08fa3c429409 to your computer and use it in GitHub Desktop.
import React from "react";
import { createChatBotMessage } from "react-chatbot-kit";
import Overview from "../components/widgets/Overview/Overview";
import MessageParser from "../components/widgets/MessageParser/MessageParser";
import ActionProviderDocs from "../components/widgets/ActionProvider/ActionProviderDocs";
const botName = "DocsBot";
const config = {
botName: botName,
lang: "no",
customStyles: {
botMessageBox: {
backgroundColor: "#376B7E",
},
chatButton: {
backgroundColor: "#5ccc9d",
},
},
initialMessages: [
createChatBotMessage(
`Hi I'm ${botName}. I’m here to help you explain how I work.`
),
createChatBotMessage(
"Here's a quick overview over what I need to function. ask me about the different parts to dive deeper.",
{
withAvatar: false,
delay: 500,
widget: "overview",
}
),
],
state: {
gist: "",
},
customComponents: {},
widgets: [
{
widgetName: "overview",
widgetFunc: (props) => <Overview {...props} />,
mapStateToProps: ["gist"],
},
{
widgetName: "messageParser",
widgetFunc: (props) => <MessageParser {...props} />,
mapStateToProps: ["gist"],
},
{
widgetName: "actionProviderDocs",
widgetFunc: (props) => <ActionProviderDocs {...props} />,
mapStateToProps: ["gist"],
},
],
};
export default config;
@Ilyes98
Copy link

Ilyes98 commented Jan 6, 2022

Hello, thank you for the work.

My question is How can I plz use the header of the customComponents in another component in my app.

I want to use it for a component unmount (So when i click on the header the chatbot is reduced ) .

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment