0.1.2 • Published 3 years ago

@carakan-react-native/my-cart v0.1.2

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

@carakan-react-native/my-cart

Cart view component

Installation

npm install @carakan-react-native/my-cart

Installing dependencies

npm install @react-native-community/checkbox

Usage

import MyCart from '@carakan-react-native/my-cart';

All parameters for components are optional except data it must exist and follow the specified format

Basic parameters

<MyCart
  data={[
    {
      id:"",
      quantity:{
        product:{
          id:"",
          name:"",
          price:0,
          // if you don't have image property you can use thumbnail property
          images:"",
          thumbnail:"",
          stock:0,
          // if the enablestore prop is equal to true you must provide a data store
          store:{
            id:"",
            name:""
          }
        }
      }
    }
    ...
  ]}
  style={{}}
  // while enable store is true will display items based on store.Default is false
  enableStore={true}
  // if you want custom items that have been provided you can use contentStyle prop
  contentStyle={{root:{},content:{},textContent:{},image:{}}}
  // if you want to do a custom component but still want to use the provided checkbox you can use the enableCheckbox prop.Default false
  enableCheckbox={true}
  // Specify how item should be rendered
  ItemComponent={(item)=><View/>}
  // Specify how checkout button component should look like
  CheckoutComponent={({items,totalPrice})=><View/>}
  // Callback that gets called on checkout press
  onCheckout={(item)=>console.log('press')}
  // Specify how header component should look like.Default render text All Product
  ListHeaaderComponent={()=><View/>}
  //  Specify how section header component should look like
  SectionHeaderComponent={(section)=><View/>}
/>