Fix mobile bottom navigation

This commit is contained in:
schroda
2026-03-16 22:41:31 +01:00
parent 54086f1c30
commit e8a64c613a

View File

@@ -7,6 +7,7 @@
*/ */
import BottomNavigation from '@mui/material/BottomNavigation'; import BottomNavigation from '@mui/material/BottomNavigation';
import type { BottomNavigationActionProps } from '@mui/material/BottomNavigationAction';
import BottomNavigationAction from '@mui/material/BottomNavigationAction'; import BottomNavigationAction from '@mui/material/BottomNavigationAction';
import Paper from '@mui/material/Paper'; import Paper from '@mui/material/Paper';
import type { CSSProperties } from 'react'; import type { CSSProperties } from 'react';
@@ -27,17 +28,20 @@ const BottomNavigationItem = ({
SelectedIconComponent, SelectedIconComponent,
IconComponent, IconComponent,
isActive, isActive,
}: NavbarItem & { isActive: boolean }) => { ...bottomNavigationActionProps
}: NavbarItem & {
isActive: boolean;
} & Omit<BottomNavigationActionProps, 'value' | 'label' | 'icon' | 'title'>) => {
const { t } = useLingui(); const { t } = useLingui();
const count = useBadge?.()?.count; const count = useBadge?.()?.count;
return ( return (
<BottomNavigationAction <BottomNavigationAction
key={path} {...bottomNavigationActionProps}
value={path} value={path}
label={t(title)} label={t(title)}
icon={ icon={
<Badge key={path} badgeContent={count} color="primary"> <Badge badgeContent={count} color="primary">
{isActive ? <SelectedIconComponent /> : <IconComponent />} {isActive ? <SelectedIconComponent /> : <IconComponent />}
</Badge> </Badge>
} }