Skip to content

Commit

Permalink
chore: change style of cart count badge
Browse files Browse the repository at this point in the history
  • Loading branch information
pooriaset committed May 22, 2024
1 parent f8e7866 commit e2ebb5d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/components/Footer/components/MobileFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
HomeOutlined,
ShoppingBasketOutlined,
} from '@mui/icons-material';
import { Badge } from '@mui/material';
import { Badge, BadgeProps, styled } from '@mui/material';
import MuiBottomNavigation from '@mui/material/BottomNavigation';
import BottomNavigationAction from '@mui/material/BottomNavigationAction';
import Box from '@mui/material/Box';
Expand All @@ -22,6 +22,13 @@ interface Page {
icon: ReactNode;
}

const StyledBadge = styled(Badge)<BadgeProps>(() => ({
'& .MuiBadge-badge': {
right: -3,
top: 12,
},
}));

const MobileFooter = () => {
const pathname = usePathname();
const t = useTranslations();
Expand All @@ -42,9 +49,9 @@ const MobileFooter = () => {
label: t('footer.navigation.cart'),
href: '/cart',
icon: (
<Badge badgeContent={cart?.productsCount} color="error">
<StyledBadge badgeContent={cart?.productsCount} color="error">
<ShoppingBasketOutlined />
</Badge>
</StyledBadge>
),
},
{
Expand Down

0 comments on commit e2ebb5d

Please sign in to comment.