foree-business-onboarding
v1.6.6
Published
npm i foree-business-onboarding
Downloads
33
Readme
Installation
use npm package manager to install foree-business-onboarding
npm i foree-business-onboarding
add the following dependencies in your dependencies object in package.json file
"@react-native-community/masked-view": "^0.1.10",
"@react-native-picker/picker": "^1.15.0",
"@react-navigation/native": "^5.9.4",
"@react-navigation/stack": "^5.14.4",
"axios": "^0.21.1",
"react-native-countdown-component": "^2.7.1",
"react-native-document-picker": "^5.0.3",
"react-native-gesture-handler": "^1.10.3",
"react-native-image-picker": "^3.3.2",
"react-native-permissions": "^3.0.2",
"react-native-reanimated": "^2.1.0",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^3.1.1",
"react-native-vector-icons": "^8.1.0",
"react-redux": "^7.2.3",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0"
after adding these dependencies
npm install
npx react-native link
Usage
import the installed package in to your project
import Onboarding from 'foree-business-onboarding';
Call Onboarding component and pass two props apiKey(string) and isTesting(boolean) where true means Test environment or false means Live environment.
<Onboarding
apiKey={this.state.apiKey}
isTesting={this.state.isTesting}
data=<optional>
colors=<optional>
fonts=<optional>
/>
Example
import React, { Component } from 'react';
import { View, Button } from 'react-native';
import Onboarding from 'foree-business-onboarding';
export default class App extends Component {
constructor() {
super();
this.state = {
apiKey: <APIKEY>,
isTesting: <true/false>,
}
}
fonts = {
subheading: 14,
heading: 16,
title: 18,
}
colors = {
background: '#ffffff',
text: '#000',
}
initialData = {
"form_submitted": false,
"business_id": '',
"name": 'abc',
"description": 'about your business',
"email_address": '[email protected]',
"phone_number": '03XXXXXXXXX',
"business_owner_name": 'abc',
"business_owner_cnic_number": '4211111111111',
"website_url": 'abc.com',
"expected_monthly_turnover": "0",
"area": 'abc',
"ntn": '000',
"address": 'abc',
}
render() {
return (
<View style={{ flex: 1 }}>
<Onboarding
apiKey={this.state.apiKey}
isTesting={this.state.isTesting}
data={this.initialData} //optional if you want to pass
colors={this.colors} //optional if you want to pass
fonts={this.fonts} //optional if you want to pass
/>
</View>
)
}
}