Yuki Takei 3 лет назад
Родитель
Сommit
dcf2848b50

+ 7 - 4
packages/plugin-lsx/src/components/LsxPageList/LsxPage.tsx

@@ -1,13 +1,11 @@
 import React, { useMemo } from 'react';
 
 import { pathUtils } from '@growi/core';
-import { PageListMeta } from '@growi/ui';
+import { PagePathLabel, PageListMeta } from '@growi/ui';
 
 import { PageNode } from '../PageNode';
 import { LsxContext } from '../lsx-context';
 
-import { PagePathWrapper } from './PagePathWrapper';
-
 
 type Props = {
   pageNode: PageNode,
@@ -66,8 +64,13 @@ export const LsxPage = React.memo((props: Props): JSX.Element => {
   }, [isExists]);
 
   const pagePathElement: JSX.Element = useMemo(() => {
+    const classNames: string[] = [];
+    if (!isExists) {
+      classNames.push('lsx-page-not-exist');
+    }
+
     // create PagePath element
-    let pagePathNode = <PagePathWrapper pagePath={pageNode.pagePath} isExists={isExists} />;
+    let pagePathNode = <PagePathLabel path={pageNode.pagePath} isLatterOnly additionalClassNames={classNames} />;
     if (isLinkable) {
       pagePathNode = <a className="page-list-link" href={encodeURI(pathUtils.removeTrailingSlash(pageNode.pagePath))}>{pagePathNode}</a>;
     }

+ 0 - 31
packages/plugin-lsx/src/components/LsxPageList/PagePathWrapper.jsx

@@ -1,31 +0,0 @@
-import React from 'react';
-
-import { PagePathLabel } from '@growi/ui';
-import PropTypes from 'prop-types';
-
-
-export class PagePathWrapper extends React.Component {
-
-  render() {
-
-    const classNames = [];
-    if (!this.props.isExists) {
-      classNames.push('lsx-page-not-exist');
-    }
-
-    return (
-      <PagePathLabel path={this.props.pagePath} isLatterOnly additionalClassNames={classNames} />
-    );
-  }
-
-}
-
-PagePathWrapper.propTypes = {
-  pagePath: PropTypes.string.isRequired,
-  isExists: PropTypes.bool.isRequired,
-  excludePathString: PropTypes.string,
-};
-
-PagePathWrapper.defaultProps = {
-  excludePathString: '',
-};