fix: Error opening folded document breadcrumb (from ts migration)

This commit is contained in:
Tom Moor
2021-12-05 22:48:02 -08:00
parent f87ac36d57
commit b16e27a790
3 changed files with 25 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
import * as React from "react";
import Breadcrumb from "~/components/Breadcrumb";
import { NavigationNode } from "~/types";
import { MenuInternalLink, NavigationNode } from "~/types";
type Props = {
documentId: string;
@@ -44,12 +44,12 @@ const PublicBreadcrumb = ({
sharedTree,
children,
}: Props) => {
const items = React.useMemo(
const items: MenuInternalLink[] = React.useMemo(
() =>
pathToDocument(sharedTree, documentId)
.slice(0, -1)
.map((item) => {
return { ...item, to: `/share/${shareId}${item.url}` };
return { ...item, type: "route", to: `/share/${shareId}${item.url}` };
}),
[sharedTree, shareId, documentId]
);