|
|
@@ -1,6 +1,6 @@
|
|
|
import React, { FC } from 'react';
|
|
|
|
|
|
-import { DevidedPagePath } from '@growi/core';
|
|
|
+import { DevidedPagePath, pagePathUtils } from '@growi/core';
|
|
|
import dynamic from 'next/dynamic';
|
|
|
|
|
|
import { useIsNotFound } from '~/stores/context';
|
|
|
@@ -9,6 +9,7 @@ import LinkedPagePath from '../models/linked-page-path';
|
|
|
|
|
|
import PagePathHierarchicalLink from './PagePathHierarchicalLink';
|
|
|
|
|
|
+const { isTrashPage } = pagePathUtils;
|
|
|
|
|
|
type Props = {
|
|
|
pagePath: string,
|
|
|
@@ -27,20 +28,22 @@ const PagePathNav: FC<Props> = (props: Props) => {
|
|
|
|
|
|
const { data: isNotFound } = useIsNotFound();
|
|
|
|
|
|
+ const isInTrash = isTrashPage(pagePath);
|
|
|
+
|
|
|
let formerLink;
|
|
|
let latterLink;
|
|
|
|
|
|
// one line
|
|
|
if (dPagePath.isRoot || dPagePath.isFormerRoot || isSingleLineMode) {
|
|
|
const linkedPagePath = new LinkedPagePath(pagePath);
|
|
|
- latterLink = <PagePathHierarchicalLink linkedPagePath={linkedPagePath} />;
|
|
|
+ latterLink = <PagePathHierarchicalLink linkedPagePath={linkedPagePath} isInTrash={isInTrash} />;
|
|
|
}
|
|
|
// two line
|
|
|
else {
|
|
|
const linkedPagePathFormer = new LinkedPagePath(dPagePath.former);
|
|
|
const linkedPagePathLatter = new LinkedPagePath(dPagePath.latter);
|
|
|
- formerLink = <PagePathHierarchicalLink linkedPagePath={linkedPagePathFormer} />;
|
|
|
- latterLink = <PagePathHierarchicalLink linkedPagePath={linkedPagePathLatter} basePath={dPagePath.former} />;
|
|
|
+ formerLink = <PagePathHierarchicalLink linkedPagePath={linkedPagePathFormer} isInTrash={isInTrash} />;
|
|
|
+ latterLink = <PagePathHierarchicalLink linkedPagePath={linkedPagePathLatter} basePath={dPagePath.former} isInTrash={isInTrash} />;
|
|
|
}
|
|
|
|
|
|
const copyDropdownId = `copydropdown${isCompactMode ? '-subnav-compact' : ''}-${pageId}`;
|