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

implemented so that the when you press the open editor mode button it will show

白石誠 5 лет назад
Родитель
Сommit
30ef63a5aa

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

@@ -139,7 +139,7 @@ const GrowiSubNavigation = (props) => {
   const {
     appContainer, navigationContainer, pageContainer, isCompactMode,
   } = props;
-  const { isDrawerMode, editorMode } = navigationContainer.state;
+  const { isDrawerMode } = navigationContainer.state;
   const {
     pageId, path, createdAt, creator, updatedAt, revisionAuthor,
     isForbidden: isPageForbidden, pageUser, isCreatable,
@@ -197,7 +197,7 @@ const GrowiSubNavigation = (props) => {
           </div>
           <div className="mt-2">
             { !isCreatable && !isPageInTrash
-            && <ThreeStrandedButton onThreeStrandedButtonClicked={onThreeStrandedButtonClicked} isBtnDisabled={currentUser == null} editorMode={editorMode} />}
+            && <ThreeStrandedButton onThreeStrandedButtonClicked={onThreeStrandedButtonClicked} isBtnDisabled={currentUser == null} />}
           </div>
         </div>
 

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

@@ -4,8 +4,8 @@ import { withTranslation } from 'react-i18next';
 import { UncontrolledTooltip } from 'reactstrap';
 
 const ThreeStrandedButton = (props) => {
-  const { t, editorMode, isBtnDisabled } = props;
-  const [btnActive, setBtnActive] = useState(editorMode);
+  const { t, isBtnDisabled } = props;
+  const [btnActive, setBtnActive] = useState('view');
 
   function threeStrandedButtonClickedHandler(viewType) {
     if (isBtnDisabled) {
@@ -62,7 +62,6 @@ const ThreeStrandedButton = (props) => {
 
 ThreeStrandedButton.propTypes = {
   t: PropTypes.func.isRequired, //  i18next
-  editorMode: PropTypes.string.isRequired,
   onThreeStrandedButtonClicked: PropTypes.func,
   isBtnDisabled: PropTypes.bool,
 };