rn-try-n-buy-virgio

1.0.0 • Public • Published

rn-try-n-buy-virgio

npm version

Trial room plugin by Tryndbuy. Supports Android & iOS integration.

Installation

  1. Install:

    • Using npm: npm install rn-try-n-buy-virgio
    • Using Yarn: yarn add rn-try-n-buy-virgio
  2. Import it in your JS:

    import {Main} from 'rn-try-n-buy-virgio';

How it works

            <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

        closeVTR = () => {
            // console.log('closeVTR')
        }
        
        addToBag =(obj) =>{
            // console.log('addToBag: ', obj)
        }

        goToBag =() =>{
            // console.log('goToBag')
        }

Package Sidebar

Install

npm i rn-try-n-buy-virgio

Weekly Downloads

2

Version

1.0.0

License

ISC

Unpacked Size

882 kB

Total Files

35

Last publish

Collaborators

  • tnb-repo