mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
♻️ enhan: close cart drawer when checkout
:%s
This commit is contained in:
@@ -25,7 +25,7 @@ const CartDrawer = ({ visible, onClose }: Props) => {
|
||||
</div>
|
||||
<div>
|
||||
<CartMessage />
|
||||
<CartCheckoutButton />
|
||||
<CartCheckoutButton onClose={onClose}/>
|
||||
</div>
|
||||
</div>
|
||||
</DrawerCommon>
|
||||
|
@@ -4,11 +4,16 @@ import s from './CartCheckoutButton.module.scss';
|
||||
import Link from 'next/link'
|
||||
import { ROUTE } from 'src/utils/constanst.utils';
|
||||
|
||||
const CartCheckoutButton = memo(() => {
|
||||
interface Props {
|
||||
onClose: () => void
|
||||
}
|
||||
|
||||
|
||||
const CartCheckoutButton = memo(({ onClose }: Props) => {
|
||||
return (
|
||||
<Link href={ROUTE.CHECKOUT}>
|
||||
<a className={s.cartCheckoutButton}>
|
||||
<ButtonCommon size='large'>Check out - Rp 120.500</ButtonCommon>
|
||||
<ButtonCommon size='large' onClick={onClose}>Check out - Rp 120.500</ButtonCommon>
|
||||
</a>
|
||||
</Link>
|
||||
)
|
||||
|
Reference in New Issue
Block a user