rn-btaskee-booking-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.32 • Public • Published

rn-btaskee-booking-sdk

PRs Welcome License MIT

npm install rn-btaskee-booking-sdk

or

yarn add rn-btaskee-booking-sdk

add some lib in package.json

"dependencies": {
    ...
    "@react-native-async-storage/async-storage": "1.18.1",
    "@react-navigation/bottom-tabs": "6.5.7",
    "axios": "1.3.4",
    "lodash": "4.17.21",
    "moment": "2.29.4",
    "react-native-config": "1.5.0",
    "react-native-datepicker": "1.7.2",
    "react-native-device-info": "10.6.0",
    "react-native-i18n": "2.0.15",
    "react-native-keyboard-aware-scroll-view": "0.9.5",
    "react-native-localize": "2.2.6",
    "react-native-modal": "13.0.1",
    "react-redux": "7.2.4",
    "redux": "4.1.0"
  },
run: yarn && cd ios && pod install

Usage

IMPORT;
import { BtaskeeSDKBooking } from 'rn-btaskee-booking-sdk';

<BtaskeeSDKBooking
  services={<service>}
  userInfo={<user info>}
  config={<config>}
/>;

Props:

Name Type Required Description
services string[] Yes 'CLEANING', 'AIR-CONDITIONER'
userInfo object Yes {name: string, phone: string (required), email: string}
config object yes {countryCode: '+84' or '+66,locale: 'vi' or 'th',env: 'DEV' or 'PRODUCTION',apiKey: string}

Example

import { NavigationContainer, useNavigation } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import React from 'react';
import { Text, TouchableOpacity, View } from 'react-native';
import { BtaskeeSDKBooking } from 'rn-btaskee-booking-sdk';

const Stack = createStackNavigator();
const HomeScreen = () => {
  const navigation = useNavigation();
  return (
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <TouchableOpacity
        style={{ borderWidth: 1, backgroundColor: 'orange', padding: 10 }}
        onPress={() => {
          navigation.navigate('BTaskeeScreen');
        }}
      >
        <Text>bTaskee</Text>
      </TouchableOpacity>
    </View>
  );
};

const BtaskeeScreen = () => {
  return (
    <BtaskeeSDKBooking
      services={['CLEANING', 'AIR-CONDITIONER']}
      userInfo={{
        name: 'test',
        phone: '0834567898',
        email: 'test@gmail.com',
      }}
      config={{
        countryCode: '+66',
        locale: 'th',
        env: 'DEV',
        apiKey: '',
      }}
    />
  );
};

const App = () => {
  return (
    <NavigationContainer>
      <Stack.Navigator
        screenOptions={{
          headerShown: false,
        }}
      >
        <Stack.Screen name="HomeScreen" component={HomeScreen} />
        <Stack.Screen name="BTaskeeScreen" component={BtaskeeScreen} />
      </Stack.Navigator>
    </NavigationContainer>
  );
};

export default App;

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Package Sidebar

Install

npm i rn-btaskee-booking-sdk

Weekly Downloads

1

Version

0.1.32

License

MIT

Unpacked Size

5.93 MB

Total Files

523

Last publish

Collaborators

  • quochaiduong