@arcteryx/components-click-and-collect
TypeScript icon, indicating that this package has built-in type declarations

3.2.1 • Public • Published

@arcteryx/components-click-and-collect

Components for click and collect; StoreAddress, StoreBlock, StoreBlockFullDetails, StoreFinder, StoreFinderSearch, StoreInventory, StoreName.

Install

npm install --save @arcteryx/components-click-and-collect

Translations

  • See root README file for translation workflow details

Usage

import { StoreFinder } from "@arcteryx/components-click-and-collect";
import { useLocation } from "@arcteryx/js-geolocation";

const Page = () => {
  const { country, market } = useSiteContext();
  const [location, setLocation] = useState(useLocation);
  const [storeInventoryList, setStoreInventoryList] = useState(null);
  const [selectedStore, setSelectedStore] = useState(getMyLocalStore());
  const [store, setStore] = useState(null);
  const [storeList, setStoreList] = useState(null);
  const [searchResultText, setSearchResultText] = useState(null);


  const handleSearchForm = () => { ... }
  const handleStoreSelected = () => { ... }

  const handleSearchForm = async (searchQuery) => {
    handleForm(searchQuery);
    const stores = await mockSearchStores();
    setStoreList(stores);
    setSearchResultText(getResultText(country));
    const inventory = await mockGetStoreInventory();
    setStoreInventoryList(inventory);
  }

  const handleStoreSelected = (store) => {
    setSelectedStore(store);
    saveMyLocalStore(market, store);
  }

  useEffect(() => {
    const getStoreInventory = async () => {
      setStoreInventoryList = await (location) => { .... }
    }

    getStoreInventory();
  }, [location]);

  return (
    <StoreFinderSearch
    country={country}
    sku={product.sku}
    onSearchForm={handleSearchForm}
    onStoreSelected={handleStoreSelected}
    selectedStore={selectedStore}
    storeInventoryList={storeInventoryList}
    storeList={storeList}
    searchResultText={searchResultText}
   />
  );
};

Readme

Keywords

none

Package Sidebar

Install

npm i @arcteryx/components-click-and-collect

Weekly Downloads

6

Version

3.2.1

License

ISC

Unpacked Size

397 kB

Total Files

96

Last publish

Collaborators

  • justinohalloran
  • ronvs
  • jamiearc