fixes
- clean coupon on success order - in menu on clicking on the sticky categories make scroll jump to the category title postion exactly
This commit is contained in:
@@ -158,107 +158,102 @@ export function AddToCartButton({ item }: { item: Product }) {
|
||||
}
|
||||
};
|
||||
|
||||
return isInCart && !hasOptions ? (
|
||||
<>
|
||||
<div
|
||||
className={styles.cartItemActions}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault;
|
||||
}}
|
||||
>
|
||||
<div className={styles.quantityControls}>
|
||||
<div className={styles.quantityInputContainer}>
|
||||
<Button
|
||||
shape="circle"
|
||||
iconPlacement="start"
|
||||
icon={<MinusOutlined title="minus" style={{ color: "black" }} />}
|
||||
size="small"
|
||||
onClick={handleMinusClick}
|
||||
className={styles.addButton}
|
||||
style={{
|
||||
backgroundColor: "white",
|
||||
width: 28,
|
||||
height: 28,
|
||||
border: "none",
|
||||
}}
|
||||
/>
|
||||
<InputNumber
|
||||
min={1}
|
||||
max={99}
|
||||
value={totalQuantity}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault;
|
||||
}}
|
||||
onChange={(value: number | null) =>
|
||||
dispatch(
|
||||
updateQuantity({
|
||||
id: item.id,
|
||||
uniqueId: basicCartItem?.uniqueId || "",
|
||||
quantity: value || 1,
|
||||
}),
|
||||
)
|
||||
}
|
||||
size="small"
|
||||
controls={false}
|
||||
className={styles.quantityInput}
|
||||
name="id"
|
||||
/>
|
||||
<Button
|
||||
shape="circle"
|
||||
iconPlacement="start"
|
||||
icon={<PlusIcon color="#FFF" />}
|
||||
size="small"
|
||||
onClick={handlePlusClick}
|
||||
disabled={totalQuantity >= 99}
|
||||
className={styles.addButton}
|
||||
style={{
|
||||
backgroundColor: "#FFC600",
|
||||
width: 28,
|
||||
height: 28,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
position: "absolute",
|
||||
bottom: -11,
|
||||
[isRTL ? "left" : "right"]: -2,
|
||||
borderRadius: "50%",
|
||||
className={styles.cartItemActions}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault;
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
shape="circle"
|
||||
iconPlacement="start"
|
||||
size="small"
|
||||
icon={
|
||||
hasOptions ? (
|
||||
<NextIcon iconColor="#302E3E" iconSize={16} />
|
||||
) : (
|
||||
<PlusOutlined title="add" />
|
||||
)
|
||||
}
|
||||
onClick={handleClick}
|
||||
disabled={!hasOptions && totalQuantity >= 99}
|
||||
className={styles.addButton}
|
||||
style={{
|
||||
color: "#302E3E",
|
||||
backgroundColor: "white",
|
||||
width: 28,
|
||||
height: 28,
|
||||
position: "absolute",
|
||||
bottom: 16,
|
||||
[isRTL ? "left" : "right"]: 7,
|
||||
minWidth: 28,
|
||||
boxShadow:
|
||||
"0px 1px 2px 0px #8585851A, 0px 3px 3px 0px #85858517, -1px 7px 4px 0px #8585850D, -1px 13px 5px 0px #85858503, -2px 20px 6px 0px #85858500",
|
||||
}}
|
||||
/>
|
||||
{isInCart && !hasOptions ? (
|
||||
<>
|
||||
<div className={styles.quantityControls}>
|
||||
<div className={styles.quantityInputContainer}>
|
||||
<Button
|
||||
shape="circle"
|
||||
iconPlacement="start"
|
||||
icon={
|
||||
<MinusOutlined title="minus" style={{ color: "black" }} />
|
||||
}
|
||||
size="small"
|
||||
onClick={handleMinusClick}
|
||||
className={styles.addButton}
|
||||
style={{
|
||||
backgroundColor: "white",
|
||||
width: 28,
|
||||
height: 28,
|
||||
border: "none",
|
||||
}}
|
||||
/>
|
||||
<InputNumber
|
||||
min={1}
|
||||
max={99}
|
||||
value={totalQuantity}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault;
|
||||
}}
|
||||
onChange={(value: number | null) =>
|
||||
dispatch(
|
||||
updateQuantity({
|
||||
id: item.id,
|
||||
uniqueId: basicCartItem?.uniqueId || "",
|
||||
quantity: value || 1,
|
||||
}),
|
||||
)
|
||||
}
|
||||
size="small"
|
||||
controls={false}
|
||||
className={styles.quantityInput}
|
||||
name="id"
|
||||
/>
|
||||
<Button
|
||||
shape="circle"
|
||||
iconPlacement="start"
|
||||
icon={<PlusIcon color="#FFF" />}
|
||||
size="small"
|
||||
onClick={handlePlusClick}
|
||||
disabled={totalQuantity >= 99}
|
||||
className={styles.addButton}
|
||||
style={{
|
||||
backgroundColor: "#FFC600",
|
||||
width: 28,
|
||||
height: 28,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<Button
|
||||
shape="circle"
|
||||
iconPlacement="start"
|
||||
size="small"
|
||||
icon={
|
||||
hasOptions ? (
|
||||
<NextIcon iconColor="#302E3E" iconSize={16} />
|
||||
) : (
|
||||
<PlusOutlined title="add" />
|
||||
)
|
||||
}
|
||||
onClick={handleClick}
|
||||
disabled={!hasOptions && totalQuantity >= 99}
|
||||
className={styles.addButton}
|
||||
style={{
|
||||
color: "#302E3E",
|
||||
backgroundColor: "white",
|
||||
width: 28,
|
||||
height: 28,
|
||||
position: "absolute",
|
||||
[isRTL ? "left" : "right"]: -87,
|
||||
bottom: 3,
|
||||
minWidth: 28,
|
||||
boxShadow:
|
||||
"0px 1px 2px 0px #8585851A, 0px 3px 3px 0px #85858517, -1px 7px 4px 0px #8585850D, -1px 13px 5px 0px #85858503, -2px 20px 6px 0px #85858500",
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user