|
@@ -2,16 +2,12 @@ import React from 'react';
|
|
|
import PropTypes from 'prop-types';
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
|
|
|
|
|
-import { DevidedPagePath } from '@growi/core';
|
|
|
|
|
-import PagePathHierarchicalLink from '~/components/PagePathHierarchicalLink';
|
|
|
|
|
-import LinkedPagePath from '~/models/linked-page-path';
|
|
|
|
|
-
|
|
|
|
|
import { withUnstatedContainers } from '../UnstatedUtils';
|
|
import { withUnstatedContainers } from '../UnstatedUtils';
|
|
|
import AppContainer from '~/client/services/AppContainer';
|
|
import AppContainer from '~/client/services/AppContainer';
|
|
|
import NavigationContainer from '~/client/services/NavigationContainer';
|
|
import NavigationContainer from '~/client/services/NavigationContainer';
|
|
|
import PageContainer from '~/client/services/PageContainer';
|
|
import PageContainer from '~/client/services/PageContainer';
|
|
|
|
|
|
|
|
-import CopyDropdown from '../Page/CopyDropdown';
|
|
|
|
|
|
|
+import PagePathNav from './PagePathNav';
|
|
|
import TagLabels from '../Page/TagLabels';
|
|
import TagLabels from '../Page/TagLabels';
|
|
|
import SubnavButtons from './SubNavButtons';
|
|
import SubnavButtons from './SubNavButtons';
|
|
|
import PageEditorModeManager from './PageEditorModeManager';
|
|
import PageEditorModeManager from './PageEditorModeManager';
|
|
@@ -19,52 +15,6 @@ import PageEditorModeManager from './PageEditorModeManager';
|
|
|
import AuthorInfo from './AuthorInfo';
|
|
import AuthorInfo from './AuthorInfo';
|
|
|
import DrawerToggler from './DrawerToggler';
|
|
import DrawerToggler from './DrawerToggler';
|
|
|
|
|
|
|
|
-const PagePathNav = ({
|
|
|
|
|
- // eslint-disable-next-line react/prop-types
|
|
|
|
|
- pageId, pagePath, isEditorMode, isCompactMode,
|
|
|
|
|
-}) => {
|
|
|
|
|
-
|
|
|
|
|
- const dPagePath = new DevidedPagePath(pagePath, false, true);
|
|
|
|
|
-
|
|
|
|
|
- let formerLink;
|
|
|
|
|
- let latterLink;
|
|
|
|
|
-
|
|
|
|
|
- // one line
|
|
|
|
|
- if (dPagePath.isRoot || dPagePath.isFormerRoot || isEditorMode) {
|
|
|
|
|
- const linkedPagePath = new LinkedPagePath(pagePath);
|
|
|
|
|
- latterLink = <PagePathHierarchicalLink linkedPagePath={linkedPagePath} />;
|
|
|
|
|
- }
|
|
|
|
|
- // 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} />;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const copyDropdownId = `copydropdown${isCompactMode ? '-subnav-compact' : ''}-${pageId}`;
|
|
|
|
|
- const copyDropdownToggleClassName = 'd-block text-muted bg-transparent btn-copy border-0 py-0';
|
|
|
|
|
-
|
|
|
|
|
- return (
|
|
|
|
|
- <div className="grw-page-path-nav">
|
|
|
|
|
- {formerLink}
|
|
|
|
|
- <span className="d-flex align-items-center">
|
|
|
|
|
- <h1 className="m-0">{latterLink}</h1>
|
|
|
|
|
- <div className="mx-2">
|
|
|
|
|
- <CopyDropdown
|
|
|
|
|
- pageId={pageId}
|
|
|
|
|
- pagePath={pagePath}
|
|
|
|
|
- dropdownToggleId={copyDropdownId}
|
|
|
|
|
- dropdownToggleClassName={copyDropdownToggleClassName}
|
|
|
|
|
- >
|
|
|
|
|
- <i className="ti-clipboard"></i>
|
|
|
|
|
- </CopyDropdown>
|
|
|
|
|
- </div>
|
|
|
|
|
- </span>
|
|
|
|
|
- </div>
|
|
|
|
|
- );
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
const GrowiSubNavigation = (props) => {
|
|
const GrowiSubNavigation = (props) => {
|
|
|
const {
|
|
const {
|
|
|
appContainer,
|
|
appContainer,
|