diff --git a/src/components/Link.tsx b/src/components/Link.tsx index 9dd5f46ce..4e85a9455 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -4,11 +4,16 @@ import { Link as I18nLink } from "gatsby-plugin-react-i18next"; import Typography from "@mui/material/Typography"; export default function LinkComponent(props: { - to: string; + to?: string; style?: { [key: string]: any }; isI18n?: boolean; + onClick?: React.MouseEventHandler; [key: string]: any; }) { + if (!props.to) { + return props.children; + } + const { to, style, isI18n, ...rest } = props; const isExternal = props.to.startsWith("http"); if (isExternal) { diff --git a/src/components/Navigation/LeftNavTree.tsx b/src/components/Navigation/LeftNavTree.tsx index ba0e07747..42b9b1618 100644 --- a/src/components/Navigation/LeftNavTree.tsx +++ b/src/components/Navigation/LeftNavTree.tsx @@ -171,16 +171,7 @@ export default function ControlledTreeView(props: { paddingBottom: "0.25rem", }} > - {item.link ? ( - - {generateItemLabel(item.content)} - - ) : ( - generateItemLabel(item.content) - )} + {generateItemLabel(item.content)} {hasChildren ? ( } - // onClick={() => { - // console.log(item.id); - // }} - ContentProps={{ - style: { width: "inherit" }, - }} + e.stopPropagation()} > - {hasChildren - ? renderTreeItems(item.children as DocLeftNavItem[], deepth + 1) - : null} - + } + // onClick={() => { + // console.log(item.id); + // }} + ContentProps={{ + style: { width: "inherit" }, + }} + > + {hasChildren + ? renderTreeItems(item.children as DocLeftNavItem[], deepth + 1) + : null} + + ); }); };