Giter VIP home page Giter VIP logo

pickup-points-selector's Introduction

Pickup Points Modal

A React component that renders VTEX's pickup points modal

Setup

Through NPM:

$ npm install @vtex/pickup-points-modal
import PickupPointsModal from '@vtex/pickup-points-modal/PickupPointsModal'

Through vtex.io:

Add vtex.pickup-points-modal to your manifest.json dependencies

import { PickupPointsModal } from 'vtex.pickup-points-modal'

API

Base Component


Base Component

PickupPointsModal

This component renders the modal with a list of pickup points and a map with markers

Props

  • closePickupPointsModal: Callback function to be called when PickupPointsModal is closed
  • changeActiveSLAOption: Callback function to be called when a pickup is selected
  • changeActivePickupDetails: Callback function to be called when PickupPointDetails state is changed
  • googleMapsKey: The Google Maps API Key
  • items: Items array from orderForm to get the products information
  • isPickupDetailsActive: (default: false) If the PickupPointDetails is active and should be rendered
  • logisticsInfo: LogisticsInfo array from orderForm to get sla information
  • onAddressChange: Callback function to be called when a the search field has changed
  • pickupOptions: Array of pickup points (SLAs of type pickup-in-point)
  • searchAddress: The current address used for the search input in the shape of AddressShapeWithValidation
  • selectedPickupPoint: Current selected SLA of type pickup-in-point
  • rules: The selected country rules from AddressForm
  • sellerId: The Id of the seller when the list of pickups is filtered by seller
  • storePreferencesData: Object from orderForm to get currency preferences from store
PickupPointsModal.propTypes = {
  closePickupPointsModal: PropTypes.func.isRequired,
  changeActivePickupDetails: PropTypes.func.isRequired,
  changeActiveSLAOption: PropTypes.func.isRequired,
  googleMapsKey: PropTypes.string.isRequired,
  items: PropTypes.array.isRequired,
  isPickupDetailsActive: PropTypes.bool,
  logisticsInfo: PropTypes.array.isRequired
  onAddressChange: PropTypes.func.isRequired,
  pickupOptions: PropTypes.array.isRequired,
  searchAddress: AddressShapeWithValidation,
  selectedPickupPoint: PropTypes.object,
  rules: PropTypes.object,
  sellerId: PropTypes.string,
  storePreferencesData: PropTypes.object.isRequired,
};

Example

<PickupPointsModal
  closePickupPointsModal={this.closePickupModal}
  changeActivePickupDetails={this.changeActivePickupDetails}
  changeActiveSLAOption={this.changeActiveSLAOption}
  googleMapsKey={googleMapsKey}
  intl={intl}
  items={items}
  isPickupDetailsActive={isPickupDetailsActive}
  logisticsInfo={logisticsInfo}
  onAddressChange={this.handleAddressChange}
  pickupOptions={pickupOptions}
  searchAddress={searchAddress}
  selectedPickupPoint={selectedPickupPoint}
  selectedRules={selectedRules}
  sellerId={sellerId}
  storePreferencesData={storePreferencesData}
/>

pickup-points-selector's People

Contributors

omninando avatar lbebber avatar klzns avatar caio-batista avatar gabrielgodoy-zz avatar kevinch avatar guilhermebruzzi avatar amandaespinosa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.