Skip to content

Latest commit

 

History

History
55 lines (46 loc) · 1.12 KB

useCases.md

File metadata and controls

55 lines (46 loc) · 1.12 KB

Ethora chat component:

##To test it locally

  1. npm i
  2. npm start

##Variants of usage:

  1. If You just start the app as it is it will show up as full page 1 room.
  2. 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