import s from './ProductSidebar.module.css' import { useAddItem } from '@framework/cart' import { FC, useState } from 'react' import { ProductOptions } from '@components/product' import { Button, Text, Rating, Collapse, useUI } from '@components/ui' import { useProduct } from '../product-context' interface ProductSidebarProps { className?: string } const ProductSidebar: FC = ({ className }) => { const addItem = useAddItem() const { product, variant } = useProduct() const { openSidebar, setSidebarView } = useUI() const [loading, setLoading] = useState(false) const addToCart = async () => { setLoading(true) try { await addItem({ productId: String(product.id), variantId: String(variant ? variant.id : product.variants[0]?.id), }) setSidebarView('CART_VIEW') openSidebar() setLoading(false) } catch (err) { setLoading(false) } } return (
36 reviews
{process.env.COMMERCE_CART_ENABLED && ( )}
This is a limited edition production run. Printing starts when the drop ends. This is a limited edition production run. Printing starts when the drop ends. Reminder: Bad Boys For Life. Shipping may take 10+ days due to COVID-19.
) } export default ProductSidebar