menu: fix footer icons

This commit is contained in:
2025-10-09 17:22:10 +03:00
parent 0b0b80d0d5
commit 905367899e
4 changed files with 31 additions and 35 deletions

View File

@@ -13,7 +13,6 @@
:global(.darkApp) .scrollToTopButton {
background-color: var(--primary) !important;
border-color: var(--primary) !important;
color: #000000 !important;
}
:global(.darkApp) .scrollToTopButton:hover {

View File

@@ -6,9 +6,9 @@ interface CartType {
const CartIcon = ({ className, onClick }: CartType) => {
return (
<svg
width="17"
height="16"
viewBox="0 0 17 16"
width="22px"
height="22px"
viewBox="0 0 16 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className={className}

View File

@@ -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>
);
}

View File

@@ -73,7 +73,7 @@ export function MenuFooter() {
<span
style={{
position: "relative",
top: 2,
top: 4,
}}
>
<CartIcon />