Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,16 @@ export const MobileNavigation: React.FC<MobileNavigationProps> = ({ isOpen, onCl
.filter((s) => !s.hide)
.map((menu) => (
<MenuItem isMainPath={isMainPath} key={menu.id}>
<MenuLink isMainPath={isMainPath} to={menu.route_code} onClick={handleClose}>
{menu.name}
</MenuLink>
{!R.isEmpty(menu.children) && (
{!R.isEmpty(menu.children) && Object.values(menu.children).some((child) => !child.hide) ? (
<MenuButton isMainPath={isMainPath} onClick={() => navigateToDepth2(menu)}>
{menu.name}
</MenuButton>
) : (
<MenuLink isMainPath={isMainPath} to={menu.route_code} onClick={handleClose}>
{menu.name}
</MenuLink>
)}
{!R.isEmpty(menu.children) && Object.values(menu.children).some((child) => !child.hide) && (
<MenuArrowButton isMainPath={isMainPath} onClick={() => navigateToDepth2(menu)}>
<ArrowForward fontSize="small" />
</MenuArrowButton>
Expand Down Expand Up @@ -123,7 +129,7 @@ export const MobileNavigation: React.FC<MobileNavigationProps> = ({ isOpen, onCl
<Link to={`${navState.depth1!.route_code}/${menu.route_code}`} onClick={handleClose} style={{ textDecoration: "none" }}>
<MenuChip isMainPath={isMainPath} label={menu.name} clickable />
</Link>
{!R.isEmpty(menu.children) && (
{!R.isEmpty(menu.children) && Object.values(menu.children).some((child) => !child.hide) && (
<MenuArrowButton isMainPath={isMainPath} onClick={() => navigateToDepth3(menu)}>
<ArrowForward fontSize="small" />
</MenuArrowButton>
Expand Down Expand Up @@ -250,6 +256,17 @@ const MenuLink = styled(Link)<{ isMainPath?: boolean }>(({ theme, isMainPath = t
fontWeight: 600,
}));

const MenuButton = styled(Button)<{ isMainPath?: boolean }>(({ theme, isMainPath = true }) => ({
color: isMainPath ? theme.palette.mobileNavigation.main.text : theme.palette.mobileNavigation.sub.text,
textTransform: "none",
fontSize: "20px",
fontWeight: 600,
padding: 0,
minWidth: "auto",
minHeight: "auto",
justifyContent: "flex-start",
}));

const MenuArrowButton = styled(IconButton)<{ isMainPath?: boolean }>(({ theme, isMainPath = true }) => ({
color: isMainPath ? theme.palette.mobileNavigation.main.text : theme.palette.mobileNavigation.sub.text,
padding: 8,
Expand Down