diff --git a/components/cart/CartItem/CartItem.tsx b/components/cart/CartItem/CartItem.tsx new file mode 100644 index 000000000..d668c31bf --- /dev/null +++ b/components/cart/CartItem/CartItem.tsx @@ -0,0 +1,28 @@ +import { Trash } from '@components/icon' + +const CartItem = () => { + return ( +
  • +
    +
    + T-Shirt +
    + - + + + +
    +
    +
    + $50.00 + + + +
    +
  • + ) +} + +export default CartItem diff --git a/components/cart/CartItem/index.ts b/components/cart/CartItem/index.ts new file mode 100644 index 000000000..b5f6dc52f --- /dev/null +++ b/components/cart/CartItem/index.ts @@ -0,0 +1 @@ +export { default } from './CartItem' diff --git a/components/cart/CartSidebarView/CartSidebarView.tsx b/components/cart/CartSidebarView/CartSidebarView.tsx index f18144fa9..c918cf67a 100644 --- a/components/cart/CartSidebarView/CartSidebarView.tsx +++ b/components/cart/CartSidebarView/CartSidebarView.tsx @@ -4,10 +4,12 @@ import { Button } from '@components/ui' import { Trash, Cross } from '@components/icon' import { useUI } from '@components/ui/context' import { useCart } from '@lib/bigcommerce/cart' +import CartItem from '../CartItem' const CartSidebarView: FC = () => { const { data, isEmpty } = useCart() const { closeSidebar } = useUI() + const items = data?.line_items.physical_items ?? [] console.log('CART', data, isEmpty) @@ -28,39 +30,35 @@ const CartSidebarView: FC = () => { -

    - My Cart -

    + {isEmpty ? ( +

    + Your cart is currently empty +

    + ) : ( +

    + My Cart +

    + )} -
    - -
    - -
    - -
    + {isEmpty ? ( +
    + +
    + ) : ( + <> +
    + +
    +
    + +
    + + )} ) } diff --git a/components/ui/Sidebar/Sidebar.tsx b/components/ui/Sidebar/Sidebar.tsx index ddeaac56e..35b1e3700 100644 --- a/components/ui/Sidebar/Sidebar.tsx +++ b/components/ui/Sidebar/Sidebar.tsx @@ -15,7 +15,7 @@ const Sidebar: FC = ({ className, children }) => {
    -
    +
    {children}
    diff --git a/lib/bigcommerce/api/cart.ts b/lib/bigcommerce/api/cart.ts index d6666369c..739f90f22 100644 --- a/lib/bigcommerce/api/cart.ts +++ b/lib/bigcommerce/api/cart.ts @@ -35,7 +35,7 @@ export type Cart = { custom_items: any[] digital_items: any[] gift_certificates: any[] - psysical_items: any[] + physical_items: any[] } // TODO: add missing fields }