1.2.9 • Published 2 years ago
joe_keski_basic_app_bar_1 v1.2.9
joe_keski_basic_app_bar_1
Made with create-react-library
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