react-native-troila-alert

0.2.7 • Public • Published

react-native-troila-alert

Getting started

$ npm install react-native-troila-alert --save

Mostly automatic installation

$ react-native link react-native-troila-alert

Manual installation

iOS

  1. add pod 'RNTroilaAlert', :path => '../node_modules/react-native-troila-alert/ios/RNTroilaAlert.podspec' to your Pod file
  2. run pod install

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.troila.alert.RNTroilaAlertPackage; to the imports at the top of the file
  • Add new RNTroilaAlertPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-troila-alert'
    project(':react-native-troila-alert').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-troila-alert/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-troila-alert')
    
  3. add maven { url 'https://jitpack.io' } to your project level build.gradle

Usage

import CustomAlert from 'react-native-troila-alert';

CustomAlert.toast("test")
CustomAlert.toast("toast with success icon","success")

CustomAlert.showLoading("Loading...")
CustomAlert.hideLoading()

CustomAlert.alert("title","content","warning",[{text:"confirm",onPress:()=>console.log("confirm clicked")}])

Package Sidebar

Install

npm i react-native-troila-alert

Weekly Downloads

21

Version

0.2.7

License

ISC

Unpacked Size

1.35 MB

Total Files

211

Last publish

Collaborators

  • troila_mobile