0.0.3 • Published 4 years ago

expo-contacts-wrapper v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

A UI wrapper for expo's native Contacts API. Renders contacts in a list.

Installation

# yarn
yarn add expo-contacts-wrapper

# npm
npm install expo-contacts-wrapper --save

Usage

import { ContactsListWrapper } from "expo-contacts-wrapper";

export default function App() {
  const finishSelectingContacts = (selectedContacts) => {
    console.log("Selected Contacts", selectedContacts);
  };

  return <ContactsListWrapper onFinish={finishSelectingContacts} />;
}

Props

PropRequired?TypeDefaultDescription
onFinishtruefunctionNoneCallback when user is done adding contacts. First argument is array of contacts.
pageSizefalseInteger50How many contacts to load per page.
sortfalseSortTypeContacts.SortTypes.LastNameSort type provided by Expo.
LoadingComponentfalseComponentComponent to show while contacts are loading.
PermissionDeniedComponentfalseComponentComponent to show when permission to the Contacts list is denied.
searchBarTextInputPropsfalseObjectNoneSet of props to pass to InputText search box.
searchBarDebounceMSfalseInteger500Debounce timer on the search bar.
ContactComponentfalseComponentCustom component to render a contact in the list. Is given props contact and isSelected.
GetMoreComponentfalseComponentActivityIndicatorComponent to display at bottom of the list when there are more contacts to load.
contactsListContainerStylefalseObjectStyling for list container.
headerStylefalseObjectStyling for header containing "done" button.
doneButtonStylefalseObjectStyling for done button (TouchableOpacity.
doneButtonTextfalseString"Done"Text content of the done button.