Yuki Takei 6 lat temu
rodzic
commit
7e6d0bb45f

+ 6 - 1
src/client/js/components/Page/CopyDropdown.jsx

@@ -1,6 +1,8 @@
 import React from 'react';
 import PropTypes from 'prop-types';
 
+import { withTranslation } from 'react-i18next';
+
 import {
   Dropdown, DropdownToggle, DropdownMenu, DropdownItem,
   Tooltip,
@@ -8,7 +10,7 @@ import {
 
 import { CopyToClipboard } from 'react-copy-to-clipboard';
 
-export default class CopyDropdown extends React.Component {
+class CopyDropdown extends React.Component {
 
   constructor(props) {
     super(props);
@@ -127,7 +129,10 @@ export default class CopyDropdown extends React.Component {
 
 CopyDropdown.propTypes = {
   t: PropTypes.func.isRequired, // i18next
+
   pagePath: PropTypes.string.isRequired,
   pageId: PropTypes.string,
   buttonStyle: PropTypes.object,
 };
+
+export default withTranslation()(CopyDropdown);

+ 2 - 1
src/client/js/components/Page/RevisionPath.jsx

@@ -26,7 +26,7 @@ const RevisionPath = (props) => {
 
       <PagePathHierarchicalLink linkedPagePath={linkedPagePath} />
 
-      <CopyDropdown t={props.t} pagePath={pagePath} pageId={pageId} buttonStyle={buttonStyle}></CopyDropdown>
+      <CopyDropdown pagePath={pagePath} pageId={pageId} buttonStyle={buttonStyle} />
 
       { !isPageInTrash && !isPageForbidden && (
         <a href="#edit" className="d-block d-edit-none text-muted btn btn-secondary bg-transparent btn-edit border-0" style={buttonStyle}>
@@ -39,6 +39,7 @@ const RevisionPath = (props) => {
 
 RevisionPath.propTypes = {
   t: PropTypes.func.isRequired, // i18next
+
   pagePath: PropTypes.string.isRequired,
   pageId: PropTypes.string,
   isPageForbidden: PropTypes.bool,

+ 2 - 11
src/client/js/components/PageList/PagePathHierarchicalLink.jsx

@@ -5,10 +5,7 @@ import LinkedPagePath from '../../models/LinkedPagePath';
 
 
 const PagePathHierarchicalLink = (props) => {
-  const { linkedPagePath, additionalClassNames } = props;
-
-  let classNames = ['page-segment'];
-  classNames = classNames.concat(additionalClassNames);
+  const { linkedPagePath } = props;
 
   const RootLink = () => {
     return props.isPageInTrash
@@ -46,20 +43,14 @@ const PagePathHierarchicalLink = (props) => {
       ) }
       { !isParentExists && <RootLink /> }
 
-      <a classNames={classNames} href={encodeURI(linkedPagePath.href)}>{linkedPagePath.pathName}</a>
+      <a className="page-segment" href={encodeURI(linkedPagePath.href)}>{linkedPagePath.pathName}</a>
     </>
   );
 };
 
 PagePathHierarchicalLink.propTypes = {
   linkedPagePath: PropTypes.instanceOf(LinkedPagePath).isRequired,
-  additionalClassNames: PropTypes.array,
-
   isPageInTrash: PropTypes.bool,
 };
 
-PagePathHierarchicalLink.defaultProps = {
-  additionalClassNames: [],
-};
-
 export default PagePathHierarchicalLink;