Custom UI- CreateChat

Add your component within Root with this line:

<Delivered.CreateChat render={props => <YourCustomComponent {...props} />} />

Functionalities

  • create new group chat
  • create new 1-on-1 chat with a contact

Provided props

  • chatCreateOpen (boolean) indicates that the UI should display a buttons to start a 1-on-1 conversation or open the public group creation form.
  • toggleOpenState(property) (function) toggles the value of the argument. Can be used to toggle both ‘chatCreateOpen’ and ‘publicChatCreateOpen’.
  • contacts (array) contains all of the user’s contacts’ IDs.
  • users (object) contains all users and their profiles.
  • chatCreate(e, contactID) (function) creates a public chat if e is provided (where e is the form) or a 1-on-1 chat if a contactID is provided. Only one of these should be passed as argument; the other should be null.
  • publicChatCreateOpen (boolean) indicates that the public chat creation form should be displayed.
  • existingChatUsers (object) contains key value pairs of existing 1-on-1 chat user IDs and chat IDs. Enables the creation of a UI that opens an existing private chat or the creation of a new one if one does not exist yet.
  • openExistingChat(chat) (function) takes the chat ID as argument. Updates the current chat and changes the chatCreateOpen value to false.
  • removeContact(id) removes the user from the contacts by user ID.

Next: Debug