menu: fix footer icons
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { Badge, Button } from "antd";
|
||||
import CartIcon from "components/Icons/cart/CartIcon";
|
||||
import { selectCartItems } from "features/order/orderSlice";
|
||||
import useBreakPoint from "hooks/useBreakPoint";
|
||||
import { useCallback } from "react";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
import { useAppSelector } from "redux/hooks";
|
||||
@@ -11,7 +10,6 @@ import styles from "./CartButton.module.css";
|
||||
export function CartButton() {
|
||||
const { isRTL } = useAppSelector((state) => state.locale);
|
||||
const { themeName } = useAppSelector((state) => state.theme);
|
||||
const { isMobile, isTablet } = useBreakPoint();
|
||||
const { id } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const items = useAppSelector(selectCartItems);
|
||||
@@ -23,34 +21,33 @@ export function CartButton() {
|
||||
const totalItems = items.reduce((sum, item) => sum + item.quantity, 0);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
shape="circle"
|
||||
size={"large"}
|
||||
icon={<CartIcon />}
|
||||
onClick={onCartClick}
|
||||
className={`${styles.scrollToTopButton}`}
|
||||
style={{
|
||||
position: "fixed",
|
||||
bottom: isMobile ? "100px" : isTablet ? "120px" : "20px",
|
||||
right: !isRTL ? "auto" : "20px",
|
||||
left: !isRTL ? "20px" : "auto",
|
||||
zIndex: 1000,
|
||||
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
|
||||
backgroundColor:
|
||||
themeName === "dark" ? colors.primary : colors.primary,
|
||||
borderColor: themeName === "dark" ? colors.primary : colors.primary,
|
||||
width: isMobile ? 48 : 56,
|
||||
height: isMobile ? 48 : 56,
|
||||
}}
|
||||
>
|
||||
<Badge
|
||||
count={totalItems}
|
||||
size="default"
|
||||
style={{ position: "absolute", top: -35, right: -18 }}
|
||||
<div
|
||||
style={{
|
||||
position: "fixed",
|
||||
bottom: "20px",
|
||||
right: !isRTL ? "auto" : "20px",
|
||||
left: !isRTL ? "20px" : "auto",
|
||||
}}
|
||||
>
|
||||
<Badge count={totalItems} size="default">
|
||||
<Button
|
||||
type="primary"
|
||||
shape="circle"
|
||||
size={"large"}
|
||||
icon={<CartIcon />}
|
||||
onClick={onCartClick}
|
||||
className={`${styles.scrollToTopButton}`}
|
||||
style={{
|
||||
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
|
||||
backgroundColor:
|
||||
themeName === "dark" ? colors.primary : colors.primary,
|
||||
borderColor: themeName === "dark" ? colors.primary : colors.primary,
|
||||
width: 56,
|
||||
height: 56,
|
||||
gap: "0", // this overrides antd's gap that is preventing centering icon
|
||||
}}
|
||||
/>
|
||||
</Button>
|
||||
</>
|
||||
</Badge>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ export function MenuFooter() {
|
||||
<span
|
||||
style={{
|
||||
position: "relative",
|
||||
top: 2,
|
||||
top: 4,
|
||||
}}
|
||||
>
|
||||
<CartIcon />
|
||||
|
||||
Reference in New Issue
Block a user