cart: add confirmation popup for clear btn
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Card, Divider, Space, Layout, Button } from "antd";
|
||||
import { Card, Divider, Space, Layout, Button, Popconfirm } from "antd";
|
||||
import ArabicPrice from "components/ArabicPrice";
|
||||
import CartActionsButtons from "components/CartActionsButtons/CartActionsButtons.tsx";
|
||||
import ImageWithFallback from "components/ImageWithFallback";
|
||||
@@ -101,27 +101,36 @@ export default function CartMobileTabletLayout({
|
||||
</ProTitle>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
shape="circle"
|
||||
iconPlacement="start"
|
||||
icon={
|
||||
<DeleteIcon
|
||||
className={styles.deleteIcon}
|
||||
color={"#C0BFC4"}
|
||||
dimension={16}
|
||||
/>
|
||||
}
|
||||
size="small"
|
||||
className={styles.addButton}
|
||||
style={{
|
||||
width: 32,
|
||||
height: 32,
|
||||
border: "1px solid #DEDEE0",
|
||||
}}
|
||||
onClick={() => {
|
||||
<Popconfirm
|
||||
title={t("cart.clearCartConfirmation.title")}
|
||||
description={t("cart.clearCartConfirmation.content")}
|
||||
onConfirm={() => {
|
||||
dispatch(clearCart());
|
||||
}}
|
||||
/>
|
||||
okText={t("cart.clearCartConfirmation.confirm")}
|
||||
cancelText={t("cart.clearCartConfirmation.cancel")}
|
||||
okButtonProps={{ danger: true }}
|
||||
placement={isRTL ? "left" : "right"}
|
||||
>
|
||||
<Button
|
||||
shape="circle"
|
||||
iconPlacement="start"
|
||||
icon={
|
||||
<DeleteIcon
|
||||
className={styles.deleteIcon}
|
||||
color={"#C0BFC4"}
|
||||
dimension={16}
|
||||
/>
|
||||
}
|
||||
size="small"
|
||||
className={styles.addButton}
|
||||
style={{
|
||||
width: 32,
|
||||
height: 32,
|
||||
border: "1px solid #DEDEE0",
|
||||
}}
|
||||
/>
|
||||
</Popconfirm>
|
||||
</div>
|
||||
|
||||
{items.length >= 1 && (
|
||||
|
||||
Reference in New Issue
Block a user