# react-native-btaskee-mini-app

> test

Latest version **1.0.2** (published 2023-06-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-btaskee-mini-app
pnpm add react-native-btaskee-mini-app
yarn add react-native-btaskee-mini-app
bun add react-native-btaskee-mini-app
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-06-19 |
| First published | 2023-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 14.0.0 |
| Dependencies | 12 |
| Unpacked size | 142.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | bTaskee |
| Maintainers | quochaiduong |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-btaskee-mini-app
- Repository: https://gitlab.com/btaskee/btaskee-sdk
- Homepage: https://gitlab.com/btaskee/btaskee-sdk#readme
- Issues: https://gitlab.com/btaskee/btaskee-sdk/issues
- npm.io page: https://npm.io/package/react-native-btaskee-mini-app

## Dependencies (12)

- [axios](https://npm.io/package/axios.md) *
- [lodash](https://npm.io/package/lodash.md) *
- [moment](https://npm.io/package/moment.md) *
- [i18n-js](https://npm.io/package/i18n-js.md) *
- [react-native-modal](https://npm.io/package/react-native-modal.md) *
- [react-native-localize](https://npm.io/package/react-native-localize.md) *
- [react-native-device-info](https://npm.io/package/react-native-device-info.md) *
- [react-native-render-html](https://npm.io/package/react-native-render-html.md) *
- [@react-navigation/bottom-tabs](https://npm.io/package/@react-navigation/bottom-tabs.md) *
- [@react-navigation/native-stack](https://npm.io/package/@react-navigation/native-stack.md) *
- [@welldone-software/why-did-you-render](https://npm.io/package/@welldone-software/why-did-you-render.md) *
- [react-native-keyboard-aware-scroll-view](https://npm.io/package/react-native-keyboard-aware-scroll-view.md) *

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2023-06-19
- 1.0.1 — 2023-06-15
- 1.0.0 — 2023-06-07
- 0.1.36 — 2023-06-05
- 0.1.35 — 2023-05-31
- 0.1.34 — 2023-05-31
- 0.1.33 — 2023-05-31
- 0.1.32 — 2023-05-31

## README

# react-native-btaskee-mini-app

[ ![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-brightgreen.svg)](https://gitlab.com/btaskee/btaskee-sdk/-/merge_requests)
[![License MIT](http://img.shields.io/badge/license-MIT-orange.svg?style=flat)](https://gitlab.com/btaskee/btaskee-sdk/-/blob/main/LICENSE)


## Setup

```sh
npm install --save react-native-btaskee-mini-app
```
### --- or ---
```sh
yarn add react-native-btaskee-mini-app
```
_Don't forget to run `pod install` after that !_

### **Require**: Please setup
+ react native navigation (https://reactnavigation.org/docs/getting-started/)
+ react-native-device-info (https://github.com/react-native-device-info/react-native-device-info#installation)
+ react-native-localize DOCS (https://github.com/zoontek/react-native-localize)

## Example usage

```jsx
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 BtaskeeMiniApp, { BTASKEE_HOME_TYPE, BTASKEE_ENV } from 'react-native-btaskee-mini-app';

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 (
     <BtaskeeMiniApp
      userInfo={{
        name: 'test',
        phone: '0834567133',
        email: 'test@gmail.com',
        address:{
          homeType: BTASKEE_HOME_TYPE.APARTMENT,
          fullAddress:'bTaskee Thailand, Phaya Thai Road, Thung Phaya Thai, Ratchathewi, Bangkok, Thailand',
          shortAddress:'Phaya Thai Road Khwaeng Thung Phaya Thai',
          description: 'Floor 1, room 105, block A',
          lat: 13.753812456259901,
          lng: 100.5316611541049,
          city: 'Bangkok',
          district: 'Ratchathewi',
        }
      }}
      config={{
        env: BTASKEE_ENV.DEV,
        locale: 'en',
        partnerCode: 'TEST',
        apiKey: '',
        apiKeyGoogleMap: ''
      }}
    />
  );
};

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

export default App;
```
## Run Example
```sh
cd example
yarn
cd ios && pod install && cd ..
yarn ios
```
## Preview
|                            Cleaning service                             |                                  Air-conditioner service                                  |
| :---------------------------------------------------------------: | :------------------------------------------------------------------------: |
| <img src="src/assets/gif/cleaning.gif" alt="btaskee-mini-app" width="325"> | <img src="src/assets/gif/ac-cleaning.gif" alt="btaskee-mini-app" width="325"> |
|                            Cleaning service                             |                                  Air-conditioner service                                  |
| <img src="src/assets/gif/deep-cleaning.gif" alt="btaskee-mini-app" width="325"> | <img src="src/assets/gif/sofa-cleaning.gif" alt="btaskee-mini-app" width="325"> |





**Props:**

| `userInfo: object`     |       |   |                                                                                     |
| -------- | -------- | -------- | --------------------------------------------------------------------------------------------- |
| name | string   | require      |                                 |
| phone   | string   | require      |  |
| email   | string   | optional      |We need the user's email to send their booking status notification via |
| address   | object   | optional      |<p>`homeType` used to determine the type of house. Can be `BTASKEE_HOME_TYPE.APARTMENT` for apartment,` BTASKEE_HOME_TYPE.HOME` for normal house or `TASKEE_HOME_TYPE.VILLA` for villa</p><p>`fullAddress` full address </p><p>`shortAddress` short address </p><p>`description` used to describe the exact location </p><p>`lat` latitude</p><p>`lng` longitude</p><p>`city` ex: "Bangkok" or "Krung Thep Maha Nakhon" or "Krung Thep" or "กรุงเทพมหานคร"</p><p>`district` ex: "Ratchathewi" or "เขตราชเทวี" or "ราชเทวี"</p>  |
</br>
</br>

| `config: object`     |       |   |                                                                                     |
| -------- | -------- | -------- | --------------------------------------------------------------------------------------------- |
| `env` | BTASKEE_ENV   | require      | `BTASKEE_ENV.DEV` for development or `BTASKEE_ENV.PRODUCTION` for production                                   |
| `locale`   | string   | require      | Used to display mini app language. Can be `vi` for Vietnamese, `en` for English, `th` for Thai |
| `partnerCode`   | string   | require      | Contact [bTaskee](https://www.btaskee.com/doi-tac-doanh-nghiep/) for information |
| `apiKey`   | string   | require      |Contact [bTaskee](https://www.btaskee.com/doi-tac-doanh-nghiep/) for information |
| `apiKeyGoogleMap`   | string   | optional      |Used to get the location from Google Map|

**NOTE:** We need the user's address to determine the appointment location, so you need to pass either `userInfo.address` or `config.apiKeyGoogleMap` or both.

## License

MIT

---
_Source: https://npm.io/package/react-native-btaskee-mini-app · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
