itizawa 5 лет назад
Родитель
Сommit
9c7244958f

+ 4 - 4
src/client/js/components/PageAccessoriesModal.jsx

@@ -32,7 +32,7 @@ const navTabMapping = {
     i18n: 'Timeline View',
     index: 1,
   },
-  pageHistroy: {
+  pageHistory: {
     icon: <RecentChangesIcon />,
     i18n: 'History',
     index: 2,
@@ -75,7 +75,7 @@ const PageAccessoriesModal = (props) => {
     return min / max * 100;
   }
 
-  const widthAndOffsetValues = useMemo(() => {
+  const getStyles = useMemo(() => {
     let tempML = 0;
     return [].map.call(navTabs, (el) => {
       const width = getPercentage(el.offsetWidth, navTitle.offsetWidth);
@@ -89,9 +89,9 @@ const PageAccessoriesModal = (props) => {
     if (activeTab === '') {
       return;
     }
-    const { width, marginLeft } = widthAndOffsetValues[navTabMapping[activeTab].index];
+    const { width, marginLeft } = getStyles[navTabMapping[activeTab].index];
     changeFlexibility(width, marginLeft);
-  }, [activeTab, widthAndOffsetValues, changeFlexibility]);
+  }, [activeTab, getStyles, changeFlexibility]);
 
 
   return (

+ 2 - 2
src/client/js/components/TopOfTableContents.jsx

@@ -51,7 +51,7 @@ const TopOfTableContents = (props) => {
         <button
           type="button"
           className="btn btn-link grw-btn-top-of-table"
-          onClick={() => pageAccessoriesContainer.openPageAccessoriesModal('page-history')}
+          onClick={() => pageAccessoriesContainer.openPageAccessoriesModal('pageHistory')}
         >
           <RecentChangesIcon />
         </button>
@@ -67,7 +67,7 @@ const TopOfTableContents = (props) => {
         <button
           type="button"
           className="btn btn-link grw-btn-top-of-table"
-          onClick={() => pageAccessoriesContainer.openPageAccessoriesModal('share-link')}
+          onClick={() => pageAccessoriesContainer.openPageAccessoriesModal('shareLink')}
         >
           <ShareLinkIcon />
         </button>

+ 1 - 0
src/client/js/services/PageAccessoriesContainer.js

@@ -41,6 +41,7 @@ export default class PageAccessoriesContainer extends Container {
   closePageAccessoriesModal() {
     this.setState({
       isPageAccessoriesModalShown: false,
+      activeTab: '',
     });
   }