0.1.32 • Published 12 months ago

rn-btaskee-booking-sdk v0.1.32

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
12 months 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

12 months ago

0.1.32

12 months ago

0.1.30

12 months ago

0.1.29

12 months ago

0.1.28

12 months ago

0.1.27

12 months ago

0.1.26

12 months ago

0.1.25

12 months ago

0.1.23

12 months ago

0.1.22

12 months ago

0.1.21

12 months ago

0.1.20

12 months ago

0.1.19

12 months ago

0.1.18

12 months ago

0.1.17

12 months ago

0.1.16

12 months ago

0.1.15

12 months ago

0.1.14

12 months ago

0.1.13

12 months ago

0.1.12

12 months ago

0.1.11

12 months ago

0.1.10

12 months ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago