# rn-try-n-buy-virgio

> Trial room solution for Virgio

Latest version **1.0.0** (published 2023-09-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install rn-try-n-buy-virgio
pnpm add rn-try-n-buy-virgio
yarn add rn-try-n-buy-virgio
bun add rn-try-n-buy-virgio
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-09-20 |
| First published | 2023-09-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 861.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tryndbuy |
| Maintainers | tnb-repo |
| Keywords | Virgio, Tryndbuy, Apparel, Try-on, Trail-room |

## Links

- npm: https://www.npmjs.com/package/rn-try-n-buy-virgio
- Repository: https://github.com/tnb-github/tnb-virgio
- Homepage: https://github.com/tnb-github/tnb-virgio#readme
- Issues: https://github.com/tnb-github/tnb-virgio/issues
- npm.io page: https://npm.io/package/rn-try-n-buy-virgio

## Dependencies (10)

- [axios](https://npm.io/package/axios.md) ^1.5.0
- [react](https://npm.io/package/react.md) ^18.2.0
- [react-native](https://npm.io/package/react-native.md) ^0.72.4
- [react-navigation](https://npm.io/package/react-navigation.md) ^4.4.4
- [react-native-screens](https://npm.io/package/react-native-screens.md) ^3.25.0
- [react-navigation-stack](https://npm.io/package/react-navigation-stack.md) ^2.10.4
- [react-native-image-picker](https://npm.io/package/react-native-image-picker.md) ^7.0.0
- [react-native-gesture-handler](https://npm.io/package/react-native-gesture-handler.md) ^2.12.1
- [react-native-safe-area-context](https://npm.io/package/react-native-safe-area-context.md) ^4.7.2
- [@react-native-async-storage/async-storage](https://npm.io/package/@react-native-async-storage/async-storage.md) ^1.19.3

## Recent versions

- 1.0.0 (latest) — 2023-09-20

## README

# rn-try-n-buy-virgio

[![npm version](https://img.shields.io/npm/v/rn-try-n-buy-virgio.svg)](https://www.npmjs.com/package/rn-try-n-buy-virgio)

Trial room plugin by Tryndbuy.
Supports Android & iOS integration.

## Installation

1. Install:
    - Using [npm](https://www.npmjs.com/#getting-started): `npm install rn-try-n-buy-virgio`
    - Using [Yarn](https://yarnpkg.com/): `yarn add rn-try-n-buy-virgio`

2. Import it in your JS:

    ```js
    import {Main} from 'rn-try-n-buy-virgio';
    ```

## How it works

```js
            <Main
                uuid ={`${Math.random()}`}
                styleid ={'114378901'}
                closePopup={()=> this.closeVTR()}
                addToBag={(obj: any)=> this.addToBag(obj)}
                addToBagCallback={false}
                goToBag={()=> this.goToBag()}
                available_in_bag={false}
            />
```
## Parameters

Below are the list of different parameters to be sent while implementing Scene component:

| Key | Data type | Default value? | Description |
|-----|-----------|----------------|-------------|
| `uuid` | `string` | Required. | Unique id of user. |
| `styleid` | `string` | Required. | Style id of the apparel. |
| `closePopup` | `method` | obj = `{tightFit: 'S', recommendedFit: 'M', looseFit: 'L'}`\ (parameters passed) | Implement callback when user click on close button in VTR. Button is placed on top left of VTR landing page. This will exit VTR and send a callback `'closePopup'` to implement any funcitonality on client side. It also sends the recommended sizes as object. |
| `addToBag` | `method` | obj = `{ skuid: this.state.skuid, recommendedSizes: {tightFit: 'S', recommendedFit: 'M', looseFit: 'L'}, selectedItem: 'M'}`\ (parameters passed) | This callback method will be called when user click on add to bag on VTR page. This callback enables to add to bag functionality on client side. |
| `addToBagCallback` | `boolean` | `false` | To be sent from client side to inform VTR whether the apparel is already added in cart or not. If `'true'` it means item is already added and VTR will show `'go to bag'` instead.|
| `goToBag` | `method` |  | This callback method will be called when user click on go to bag on VTR page. This callback enables to go to bag functionality on client side. |
| `available_in_bag` | `boolean` | Optional. | To show/hide add to bag functionality in VTR |

## Implementation Samples

```js
        closeVTR = () => {
            // console.log('closeVTR')
        }
        
        addToBag =(obj) =>{
            // console.log('addToBag: ', obj)
        }

        goToBag =() =>{
            // console.log('goToBag')
        }
```

---
_Source: https://npm.io/package/rn-try-n-buy-virgio · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
