Custom UI- SearchUsers

Add your component within Root with this line:

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

Functionalities

  • search for contacts
  • add contact from the search results

Provided props

  • addContact(id, name, location, images) (function) adds the user to the contacts. The name, location and images can be inferred from the new contact’s profile in users.
  • searchResults (array) list of user IDs that correspond to the search terms the user input.
  • searchUser (boolean) indicates whether or not the user search UI should be rendered.
  • searchForUser() (function) searches for users by name/gender/location. If these values are null (not changed via handleChange), this will return all the searchable users.
  • toggleBoolState (function) can be used to change the value of searchUser to decide when to open/close the user search UI.
  • users (object) contains all users and their profiles.
  • handleChange(e, property) (function) onChange listener for name, gender and location inputs. Modifies the values used in searchForUser.
  • changeRadius(e) (function) onChange listener for the nearby user search radius input, which triggers a new search with the given argument’s value.

Next: SearchChats