- Features
- Built With
- Pending Items
- Screenshot (iOS)
- Screenshot (Android)
- Getting Started
- Props
- Building & Publishing
- Changelog
- âś… iOS/Android
- âś… Dark Mode
- âś… Built with TypeScript
- âś… Built with React Hooks
- TypeScript - Programming Language
- React Hooks - Functional Component State/Lifecycle Methods
- React Native - Mobile (iOS/Android) Framework
- React Native Modal - Modal
- React Native Vector Icons - Icons
- [ ]
Note: Maximum of 6 Phone Numbers and/or Emails allowed.
1. Install Package:
npm i react-native-contact-action-sheet
2. Install additional dependencies:
Note: This NPM Package uses the Native Module react-native-vector-icons
, so it must be installed in your project.
npm i react-native-vector-icons
3. Install Cocoapods:
cd ios
pod install
4. Add Example Code:
// Imports: Dependencies
import React, { useState } from 'react';
import { Button, SafeAreaView } from 'react-native';
import { ContactActionSheet, ContactItem } from 'react-native-contact-action-sheet';
// App
const App: React.FC = (): JSX.Element => {
// React Hooks: State
const [ visible, setVisible ] = useState<boolean>(false);
// Contacts
const contacts: Array<ContactItem> = [
{
title: 'Company Headquarters',
type: 'Phone Number',
contact: '(555) 555-5555',
},
{
title: 'Retail Store',
type: 'Phone Number',
contact: '(777) 777-7777',
},
{
title: 'Retail Store',
type: 'Message',
contact: '(777) 777-7777',
},
{
title: 'Retail Store',
type: 'Email',
contact: 'hq@company.com',
},
{
title: 'Website',
type: 'Website',
contact: 'https://company.com',
},
];
return (
<SafeAreaView>
<Button
title="Show Modal"
onPress={() => setVisible(!visible)}
/>
<ContactActionSheet
toggle={() => setVisible(!visible)}
contactsList={contacts}
modalVisible={visible}
darkMode={false}
/>
</SafeAreaView>
);
};
// Exports
export default App;
4. Run Project:
Android
react-native run-android
iOS
react-native run-ios
Default:
Property | Type | Default | Description |
---|---|---|---|
toggle |
() => void |
undefined |
Toggle modal (Show/Hide) |
modalVisible |
boolean |
false |
Modal visible |
contactsList |
Array<ContactItem> |
[] |
Contact data (Phone number, Email Address, Website) |
Optional:
Property | Type | Default | Description |
---|---|---|---|
darkMode |
boolean |
false |
Dark mode |
Build
npm run build
Publish
npm publish
Added
- Added
LICENSE
.
Added
- Added styling to
ContactActionSheet
.
Added
- Added
react-native-vector-icons
frompeerDependency
.
Removed
- Fixed
<View>
issue.
Removed
- Removed
react-native-vector-icons
frompeerDependency
.
Changed
- Changed
react-native-vector-icons
fromdependency
todevDependency
andpeerDependency
. - Updated Getting Started in
README
. - Fixed missing
react
peerDependency
. - Fixed missing
react-native
peerDependency
.
Removed
- Removed
RNVectorIcons.podspec
fromsrc
.
- Updated example code in
README
.
Added
- Added
RNVectorIcons.podspec
tosrc
.
Changed
- Updated example code in
README
. - Changed main path from
dist/index.js
to./dist/index.js
inpackage.json
. - Changed types path from
dist/index.d.ts
to./dist/index.d.ts
inpackage.json
.
Removed
- Removed
react-native-typescript-transformer
as dependency.
Changed
- Fixed
npm run build
andnpm publish
issue.
Changed
- Changing
import Icon from 'react-native-vector-icons/Ionicons'
toimport Ionicons from 'react-native-vector-icons/Ionicons'
.
Changed
- Updating Getting Started in
README
.
Changed
- Updating Getting Started in
README
.
Changed
- Changed
react-native-iphone-x-helper
,react-native-modal
, andreact-native-vector-icons
frompeerDependencies
todependencies
.
Added
- Added Props section to
README
. - Added Example App section to
README
.
Changed
- Changed file structure.
- Changed
index.js
toindex.tsx
. - Changed
package.json
build script tocd src && tsc && cp ../package.json && Echo Build completed!
.
Removed
- Removed
dependencies
.
Changed
- Updated
dependencies
inpackage.json
. - Changed
visible
tomodalVisible
.
Removed
- Removed
react-native-vector-icons
inindex.js
. - Removed
react-native-vector-icons
as a dependency.
Changed
- Importing
react-native-vector-icons
inindex.js
.
Changed
- Adding
react-native-vector-icons
as a dependency.
Changed
- Exported
ContactItem
TypeScript Type. - Updated example code.
Changed
- Fixed
package.json
missingfiles
issue.
Changed
- Fixed missing
README
issue.
Added
- Added
darkMode
prop.
Changed
- Changed
react-native-iphone-x-helper
topeerDependency
. - Changed
react-native-modal
topeerDependency
. - Changed
react-native-vector-icons
topeerDependency
. - Updated
README
Getting Started foriOS
pods. - Updated
README
Getting Started forAndroid
dependencies.
Removed
- Removed
Appearance
react-native
prop for better dark mode support.
Added
- Added TypeScript
types
folder.
Added
- Added Dark Mode support. Please upgrade to
React Native 0.62
for this to work.
Changed
- Updated
react
dependency. - Updated
react-native
dependency. - Updated
react-native-vector-icons
dependency. - Updated
react-native-modal
dependency.
Removed
- Removed
react-native-dark-mode
dependency (Deprecated).
Added
- Added Website.
Added
- Added
formatPhoneNumber
to convert phone number to15555555555
format.
Changed
- Fixed
react-native-vector-icons
link issue.
Changed
- Fixed
react-native-vector-icons
podfile
issue.
Changed
- Fixed maximum contacts issue.
- Fixed
outDir/dist
issue.
Changed
- Fixed
README
example code.
Added
- Added support for Message.
Changed
- Fixed
toggle
issue.
Added
- Added
Android
Support. - Added iPhone X/11 Support.
- Added screenshots.
Changed
- Styling changes.