|
@@ -4,8 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
import { DevidedPagePath } from '@growi/core';
|
|
import { DevidedPagePath } from '@growi/core';
|
|
|
|
|
|
|
|
export const PagePathLabel = (props) => {
|
|
export const PagePathLabel = (props) => {
|
|
|
- const highlightedPath = props.page.elasticSearchResult.highlightedPath;
|
|
|
|
|
- const dPagePath = new DevidedPagePath(highlightedPath, false, true);
|
|
|
|
|
|
|
+ const dPagePath = new DevidedPagePath(props.path, false, true);
|
|
|
|
|
|
|
|
let classNames = [''];
|
|
let classNames = [''];
|
|
|
classNames = classNames.concat(props.additionalClassNames);
|
|
classNames = classNames.concat(props.additionalClassNames);
|
|
@@ -21,7 +20,7 @@ export const PagePathLabel = (props) => {
|
|
|
|
|
|
|
|
if (props.isFormerOnly) {
|
|
if (props.isFormerOnly) {
|
|
|
const textElem = dPagePath.isFormerRoot
|
|
const textElem = dPagePath.isFormerRoot
|
|
|
- ? <></>
|
|
|
|
|
|
|
+ ? <>/</>
|
|
|
: <>{dPagePath.former}</>;
|
|
: <>{dPagePath.former}</>;
|
|
|
return displayPath(textElem);
|
|
return displayPath(textElem);
|
|
|
}
|
|
}
|
|
@@ -34,10 +33,10 @@ export const PagePathLabel = (props) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
PagePathLabel.propTypes = {
|
|
PagePathLabel.propTypes = {
|
|
|
- page: PropTypes.object.isRequired,
|
|
|
|
|
isLatterOnly: PropTypes.bool,
|
|
isLatterOnly: PropTypes.bool,
|
|
|
isFormerOnly: PropTypes.bool,
|
|
isFormerOnly: PropTypes.bool,
|
|
|
additionalClassNames: PropTypes.arrayOf(PropTypes.string),
|
|
additionalClassNames: PropTypes.arrayOf(PropTypes.string),
|
|
|
|
|
+ path: PropTypes.string.isRequired,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
PagePathLabel.defaultProps = {
|
|
PagePathLabel.defaultProps = {
|