0.1.32 • Published 2 years ago

rn-btaskee-booking-sdk v0.1.32

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
2 years ago

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:

NameTypeRequiredDescription
servicesstring[]Yes'CLEANING', 'AIR-CONDITIONER'
userInfoobjectYes{name: string, phone: string (required), email: string}
configobjectyes{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

0.1.31

2 years ago

0.1.32

2 years ago

0.1.30

2 years ago

0.1.29

2 years ago

0.1.28

2 years ago

0.1.27

2 years ago

0.1.26

2 years ago

0.1.25

2 years ago

0.1.23

2 years ago

0.1.22

2 years ago

0.1.21

2 years ago

0.1.20

2 years ago

0.1.19

2 years ago

0.1.18

2 years ago

0.1.17

2 years ago

0.1.16

2 years ago

0.1.15

2 years ago

0.1.14

2 years ago

0.1.13

2 years ago

0.1.12

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago