Created
April 19, 2020 20:37
-
-
Save FredrikOseberg/af04e2e30407671412af08fa3c429409 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
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
Here i'm trying to put the response data in to state, But first it showing an empty array after the array of data is showing
i want to show that question data in messageParser file, what im doing wrong here please help me
this is messageParser file
this.state
is getting empty data