npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

riz-shoppingcart-v7

v1.1.1

Published

A prototype of shopping cart using typescript and redux

Downloads

292

Readme

Shopping Cart With TS and Redux

A prototype of shopping cart using typescript and redux

Installation

npm i riz-shoppingcart-v7

Documentation

items = array of products to display

storeName = show custom store name

customBtnShow = show custom button below added cart items

customBtnFunc = add function for custom button

customBtnText = custom button text

Props

items = array

customBtnShow = bolean

customBtnFunc = function

customBtnText = string

Items Data Model

name : string

price : number

id : number

quantity : number

img : any

Screenshots

App Screenshot

Usage/Examples

import React, { useState } from 'react';
import CartComponent from 'riz-shoppingcart-v7';
import './App.css';

function App() {

  const [products, setCart] = useState([
    { id: 1, name: "Beer", price: 1.00, quantity: 0, img: "https://qa-centralmain.s3.ap-southeast-1.amazonaws.com/market/57089256%20-%2001.jpg" },
    { id: 2, name: "Vinegar", price: 21.00, quantity: 0, img: "https://qa-centralmain.s3.ap-southeast-1.amazonaws.com/market/4806515630291-1.jpg" },
    { id: 3, name: "Pork & Beans", price: 20.00, quantity: 0, img: "https://qa-centralmain.s3.ap-southeast-1.amazonaws.com/market/119593-01.jpg" },
    { id: 4, name: "Blanca Mix", price: 10.00, quantity: 0, img: "https://qa-centralmain.s3.ap-southeast-1.amazonaws.com/market/4800552169066-01.jpg" },
    { id: 5, name: "Cookies", price: 12.00, quantity: 0, img: "https://qa-centralmain.s3.ap-southeast-1.amazonaws.com/market/4809014286044-01.jpg" },
    { id: 6, name: "Chocolate", price: 20.00, quantity: 0, img: "https://qa-centralmain.s3.ap-southeast-1.amazonaws.com/market/5902768865677-01.jpg" },
  ]);

  const [total, setTotal] = useState(0)


  const getCartCount = () => {
    let count = products.map(x => x.quantity).reduce((a: number, b: number) => a + b, 0)
    return setTotal(count)
  }


  return (
    <div className="App">
      <CartComponent
        items={products}
        storeName={"Jerriz Store"}
        customBtnShow={true}
        customBtnFunc={getCartCount}
        customBtnText={"Get total cart items"}
      />
      <span>Total Cart Items: {total}</span>
    </div>
  );
}

export default App

riz-shoppingcart-v7 changelogs

v1.0.1 - rebuild and added cart mode feature

v1.0.2 - removed cart mode, added custom button , redesign cart component

v1.0.3 - fix custom button function and UI

v1.0.4 - fix naming convention, added node version in package.json(engine)

v1.1.0

-Redesign shopping cart
-removed product section
-Changed remove button from removing quantity to removing item
-fix naming convention
-recreate redux, removed dummy data
-updated readme

v1.1.1 - updated readme

Node Version

node - v14.15.4