Hide navigation badge text in moible bottom bar
This commit is contained in:
@@ -60,6 +60,7 @@ export const MobileBottomBar = ({ navBarItems }: { navBarItems: NavbarItem[] })
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
forceCollapsed
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -29,17 +29,21 @@ export const NavigationBarItem = ({
|
|||||||
SelectedIconComponent,
|
SelectedIconComponent,
|
||||||
useBadge,
|
useBadge,
|
||||||
slots,
|
slots,
|
||||||
|
forceCollapsed,
|
||||||
}: NavbarItem & {
|
}: NavbarItem & {
|
||||||
slots?: {
|
slots?: {
|
||||||
listItemLink?: Partial<ComponentProps<typeof ListItemLink>>;
|
listItemLink?: Partial<ComponentProps<typeof ListItemLink>>;
|
||||||
};
|
};
|
||||||
|
forceCollapsed?: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useLingui();
|
const { t } = useLingui();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const { isCollapsed } = useNavBarContext();
|
const { isCollapsed: isCollapsedContext } = useNavBarContext();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const badgeInfo = useBadge?.();
|
const badgeInfo = useBadge?.();
|
||||||
|
|
||||||
|
const isCollapsed = forceCollapsed ?? isCollapsedContext;
|
||||||
|
|
||||||
const isActive = location.pathname.startsWith(path);
|
const isActive = location.pathname.startsWith(path);
|
||||||
const Icon = isActive ? SelectedIconComponent : IconComponent;
|
const Icon = isActive ? SelectedIconComponent : IconComponent;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user