mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
Merge branch 'fixbug-13/9/2021-datnguyen' of github.com:KieIO/grocery-vercel-commerce into fixbug-13/9/2021-datnguyen
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useCartDrawer } from 'src/components/contexts';
|
import { useCartDrawer } from 'src/components/contexts';
|
||||||
|
import useGetActiveOrder from 'src/components/hooks/useGetActiveOrder';
|
||||||
import { PRODUCT_CART_DATA_TEST } from 'src/utils/demo-data';
|
import { PRODUCT_CART_DATA_TEST } from 'src/utils/demo-data';
|
||||||
import { DrawerCommon } from '..';
|
import { DrawerCommon } from '..';
|
||||||
import s from './CartDrawer.module.scss';
|
import s from './CartDrawer.module.scss';
|
||||||
@@ -14,9 +15,10 @@ interface Props {
|
|||||||
|
|
||||||
const CartDrawer = ({ }: Props) => {
|
const CartDrawer = ({ }: Props) => {
|
||||||
const { cartVisible, closeCartDrawer } = useCartDrawer()
|
const { cartVisible, closeCartDrawer } = useCartDrawer()
|
||||||
|
const {order} = useGetActiveOrder()
|
||||||
return (
|
return (
|
||||||
<DrawerCommon
|
<DrawerCommon
|
||||||
title={`Your cart (${PRODUCT_CART_DATA_TEST.length})`}
|
title={`Your cart (${order?.totalQuantity})`}
|
||||||
visible={cartVisible}
|
visible={cartVisible}
|
||||||
onClose={closeCartDrawer}>
|
onClose={closeCartDrawer}>
|
||||||
<div className={s.cartDrawer}>
|
<div className={s.cartDrawer}>
|
||||||
|
Reference in New Issue
Block a user