##To test it locally
- npm i
- npm start
##Variants of usage:
- If You just start the app as it is it will show up as full page 1 room.
- if You want to add it to Your existent app:
a. Install all dependencies
b. Import store from roomStore
c. Import ChatRoom from MainComponents
Default user and default room:
const defaultUser = {
_id: string,
walletAddress: string,
xmppPassword: string,
firstName: string,
lastName: string,
};
const defRoom = {
name: string,
users_cnt: string,
room_background: string,
room_thumbnail: string,
jid: string,
id: string,
title: string,
usersCnt: number,
messages: array[],
};
Code should look like:
<Provider store={store}>
<ChatRoom
key={currentRoom.jid}
defaultRoom={currentRoom}
isLoading={isLoading}
defaultUser={{ ...props, _id: props.walletAddress }}
/>
</Provider>
d. Add defaultUser, defaultRoom. Update logic to change user and room on your side c. Enjoy