Skip to content

Commit

Permalink
fixing broken menu links for prefixed sites
Browse files Browse the repository at this point in the history
  • Loading branch information
MattReimer committed Jan 3, 2025
1 parent e1e227e commit ee74be6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion theme/src/components/menus/TreeItemLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { TreeItem, TreeItemProps } from '@mui/x-tree-view/TreeItem'
import { Button, useTheme } from '@mui/material'
import { Place } from '@mui/icons-material'
import { withPathAttributes } from '../../hooks/withPathAttributes'
import { ContentLink } from '../ContentLink'

interface TreeItemLinkProps extends TreeItemProps {
to: string
Expand Down Expand Up @@ -66,6 +67,7 @@ const TreeItemLink: React.FC<TreeItemLinkProps> = ({ to, label, children, ...res
label={
<Button
endIcon={isCurrent ? <Place /> : null}
component={ContentLink}
sx={{
textAlign: 'left',
color: isLink ? theme.palette.text.primary : theme.palette.text.secondary,
Expand All @@ -76,7 +78,7 @@ const TreeItemLink: React.FC<TreeItemLinkProps> = ({ to, label, children, ...res
textDecoration: !isCurrent ? 'underline' : undefined,
},
}}
href={isLeaf || isCurrent ? undefined : to}
to={isLeaf || isCurrent ? undefined : to}
>
{label}
</Button>
Expand Down

0 comments on commit ee74be6

Please sign in to comment.