Last active
February 6, 2018 15:07
-
-
Save mcallegari10/45743cb70ed4fe6f54ee64436d259177 to your computer and use it in GitHub Desktop.
React Chat Widget 3
This file contains 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, { Component } from 'react'; | |
import { Widget, addResponseMessage, addLinkSnippet, addUserMessage } from 'react-chat-widget'; | |
import logo from './logo.svg'; | |
class App extends Component { | |
componentDidMount() { | |
addResponseMessage("Welcome to this awesome chat!"); | |
} | |
handleNewUserMessage = (newMessage) => { | |
console.log(`New message incomig! ${newMessage}`); | |
// Now send the message throught the backend API | |
} | |
render() { | |
return ( | |
<div className="App"> | |
<Widget | |
handleNewUserMessage={this.handleNewUserMessage} | |
profileAvatar={logo} | |
title="My new awesome title" | |
subtitle="And my cool subtitle" | |
/> | |
</div> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! Can you please give me the steps to include this widget in my html page?