Getting Started
You can use it with nodeJS.
Installation
npm
npm install react-monkey-ui --save
Usage
Prerequisites
- react
How to use
{ superprops; thisstate = userSession: null conversationId: '2' conversations: '2': conv2 // * conversation Object '3': conv3 // * conversation Object thishandleUserSession = thishandleUserSession; thishandleMessage = thishandleMessage; } { return <MonkeyUI userSession=thisstateuserSession onUserSession=thishandleUserSession conversations=thisstateconversations conversation=thisconversationsthisstateconversationId onMessage=thishandleMessage onMessagesLoad=thishandleMessagesLoad onMessageGetUsername=thishandleMessageGetUsername /> } /* User */ { // user = {name: 'name'} userid = '1'; userurlAvatar = 'http://cdn.criptext.com/MonkeyUI/images/userdefault.png'; this; } /* Message */ { // message = {senderId: '', recipientId: '', status: 0} // TODO: save message to respective conversation } { // TODO: to load more messages and save in the respective conversation }
These props and methods defined are the basic to start to use it like a simple chat.
To understand how the data is structured, check here: http://docs.messaging.criptext.com/structure_data.html
To review the props and method that expose the component, check here: http://docs.messaging.criptext.com/props.html