Просмотр исходного кода

use withTranslation to two butttons

kaori 5 лет назад
Родитель
Сommit
ea9b66517e

+ 3 - 3
src/client/js/components/Navbar/GrowiSubNavigation.jsx

@@ -16,7 +16,7 @@ import RevisionPathControls from '../Page/RevisionPathControls';
 import TagLabels from '../Page/TagLabels';
 import LikeButton from '../LikeButton';
 import BookmarkButton from '../BookmarkButton';
-import { TwoStrandedButton, Hoge } from './ThreeStrandedButton';
+import { TwoStrandedButton, ThreeStrandedButton } from './ThreeStrandedButton';
 
 import AuthorInfo from './AuthorInfo';
 import DrawerToggler from './DrawerToggler';
@@ -134,12 +134,12 @@ const GrowiSubNavigation = (props) => {
           <div className={`${isEditorMode ? 'ml-2' : 'mt-2'}`}>
             {pageContainer.isAbleToShowThreeStrandedButton && (
               <>
-                <TwoStrandedButton
+                <ThreeStrandedButton
                   onThreeStrandedButtonClicked={onThreeStrandedButtonClicked}
                   isBtnDisabled={isGuestUser}
                   editorMode={editorMode}
                 />
-                <Hoge
+                <TwoStrandedButton
                   onThreeStrandedButtonClicked={onThreeStrandedButtonClicked}
                   isBtnDisabled={isGuestUser}
                   editorMode={editorMode}

+ 3 - 3
src/client/js/components/Navbar/ThreeStrandedButton.jsx

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
 import { withTranslation } from 'react-i18next';
 import { UncontrolledTooltip } from 'reactstrap';
 
-const ThreeStrandedButton = (props) => {
+export const ThreeStrandedButton = withTranslation()((props) => {
   const { t, isBtnDisabled, editorMode } = props;
 
 
@@ -57,7 +57,7 @@ const ThreeStrandedButton = (props) => {
     </>
   );
 
-};
+});
 
 ThreeStrandedButton.propTypes = {
   t: PropTypes.func.isRequired, //  i18next
@@ -141,5 +141,5 @@ TwoStrandedButton.defaultProps = {
   isBtnDisabled: false,
 };
 
-export const Hoge = withTranslation()(ThreeStrandedButton);
+// export const Hoge = withTranslation()(ThreeStrandedButton);
 // export default withTranslation()(ThreeStrandedButton);