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>
|
||||||
<div>
|
<div>
|
||||||
<CartMessage />
|
<CartMessage />
|
||||||
<CartCheckoutButton />
|
<CartCheckoutButton onClose={onClose}/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DrawerCommon>
|
</DrawerCommon>
|
||||||
|
@@ -4,11 +4,16 @@ import s from './CartCheckoutButton.module.scss';
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { ROUTE } from 'src/utils/constanst.utils';
|
import { ROUTE } from 'src/utils/constanst.utils';
|
||||||
|
|
||||||
const CartCheckoutButton = memo(() => {
|
interface Props {
|
||||||
|
onClose: () => void
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const CartCheckoutButton = memo(({ onClose }: Props) => {
|
||||||
return (
|
return (
|
||||||
<Link href={ROUTE.CHECKOUT}>
|
<Link href={ROUTE.CHECKOUT}>
|
||||||
<a className={s.cartCheckoutButton}>
|
<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>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user