joe_keski_basic_app_bar_1

1.2.9 • Public • Published

joe_keski_basic_app_bar_1

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save joe_keski_basic_app_bar_1

Usage

import React from 'react'
import BasicAppBar from 'joe_keski_basic_app_bar_1'

const App = () => {
  // For principal links in appbar
  const navItems = [
    { title: 'Link 1', link: '/link1' },
    { title: 'Link 2', link: '/link2', submenu: true }
  ]
  //For submenu categories
  const categories = [
    {
      id: 1,
      name: 'Categoría Título 1',
      link: '/categoriatitulo1',
      categoriesLinks: [
        { id: 1, name: 'Categoria 1', link: '/categoria1' },
        { id: 2, name: 'Categoria 2', link: '/categoria2' },
        { id: 3, name: 'Categoria 3', link: '/categoria3' }
      ]
    }
  ]

  //For the discount banner
  const [openDiscount, setOpenDiscount] = React.useState(true)
  const [showModal, setShowModal] = React.useState(false)

  const onShowModal = () => setShowModal(true)
  const onCloseModal = () => setShowModal(false)

  return (
    <>
      <BasicAppBar
        navItems={navItems}
        categories={categories}
        openDiscount={openDiscount}
        setOpenDiscount={setOpenDiscount}
        show={showModal}
        onShowModal={onShowModal}
        onCloseModal={onCloseModal}
        //cart products for request cart in API
        cartProducts={cartProducts}
      />
    </>
  )
}

License

MIT © Benjamngarcia

/joe_keski_basic_app_bar_1/

    Package Sidebar

    Install

    npm i joe_keski_basic_app_bar_1

    Weekly Downloads

    3

    Version

    1.2.9

    License

    MIT

    Unpacked Size

    116 kB

    Total Files

    6

    Last publish

    Collaborators

    • benjamngarcia
    • fran-dev