zahmis 5 лет назад
Родитель
Сommit
71a7e62567
1 измененных файлов с 4 добавлено и 6 удалено
  1. 4 6
      src/client/js/components/Navbar/ThreeStrandedButton.jsx

+ 4 - 6
src/client/js/components/Navbar/ThreeStrandedButton.jsx

@@ -1,4 +1,4 @@
-import React, { useState } from 'react';
+import React from 'react';
 import PropTypes from 'prop-types';
 import { withTranslation } from 'react-i18next';
 import { UncontrolledTooltip } from 'reactstrap';
@@ -6,7 +6,6 @@ import { UncontrolledTooltip } from 'reactstrap';
 const ThreeStrandedButton = (props) => {
   const { t, isBtnDisabled } = props;
 
-  const [btnActive, setBtnActive] = useState('view');
 
   function threeStrandedButtonClickedHandler(viewType) {
     if (isBtnDisabled) {
@@ -15,7 +14,6 @@ const ThreeStrandedButton = (props) => {
     if (props.onThreeStrandedButtonClicked != null) {
       props.onThreeStrandedButtonClicked(viewType);
     }
-    setBtnActive(viewType);
   }
 
   return (
@@ -28,7 +26,7 @@ const ThreeStrandedButton = (props) => {
       >
         <button
           type="button"
-          className={`btn btn-outline-primary view-button ${btnActive === 'view' && 'active'} ${isBtnDisabled && 'disabled'}`}
+          className={`btn btn-outline-primary view-button ${ === 'view' && 'active'} ${isBtnDisabled && 'disabled'}`}
           onClick={() => { threeStrandedButtonClickedHandler('view') }}
         >
           <i className="icon-control-play icon-fw grw-three-stranded-button-icon" />
@@ -36,7 +34,7 @@ const ThreeStrandedButton = (props) => {
         </button>
         <button
           type="button"
-          className={`btn btn-outline-primary edit-button ${btnActive === 'edit' && 'active'} ${isBtnDisabled && 'disabled'}`}
+          className={`btn btn-outline-primary edit-button ${=== 'edit' && 'active'} ${isBtnDisabled && 'disabled'}`}
           onClick={() => { threeStrandedButtonClickedHandler('edit') }}
         >
           <i className="icon-note icon-fw grw-three-stranded-button-icon" />
@@ -44,7 +42,7 @@ const ThreeStrandedButton = (props) => {
         </button>
         <button
           type="button"
-          className={`btn btn-outline-primary hackmd-button ${btnActive === 'hackmd' && 'active'} ${isBtnDisabled && 'disabled'}`}
+          className={`btn btn-outline-primary hackmd-button ${=== 'hackmd' && 'active'} ${isBtnDisabled && 'disabled'}`}
           onClick={() => { threeStrandedButtonClickedHandler('hackmd') }}
         >
           <i className="fa fa-fw fa-file-text-o grw-three-stranded-button-icon" />