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

Merge pull request #3208 from weseek/imprv/master-gw4487

implemented the tooltip for pageAccessoriesModal
Yuki Takei 5 лет назад
Родитель
Сommit
23bd215793
1 измененных файлов с 9 добавлено и 6 удалено
  1. 9 6
      src/client/js/components/PageAccessoriesModalControl.jsx

+ 9 - 6
src/client/js/components/PageAccessoriesModalControl.jsx

@@ -26,29 +26,34 @@ const PageAccessoriesModalControl = (props) => {
         name: 'pagelist',
         name: 'pagelist',
         Icon: <PageListIcon />,
         Icon: <PageListIcon />,
         disabled: isSharedUser,
         disabled: isSharedUser,
+        i18n: t('page_list'),
       },
       },
       {
       {
         name: 'timeline',
         name: 'timeline',
         Icon: <TimeLineIcon />,
         Icon: <TimeLineIcon />,
         disabled: isSharedUser,
         disabled: isSharedUser,
+        i18n: t('Timeline View'),
       },
       },
       {
       {
         name: 'pageHistory',
         name: 'pageHistory',
         Icon: <HistoryIcon />,
         Icon: <HistoryIcon />,
         disabled: isGuestUser || isSharedUser,
         disabled: isGuestUser || isSharedUser,
+        i18n: t('History'),
       },
       },
       {
       {
         name: 'attachment',
         name: 'attachment',
         Icon: <AttachmentIcon />,
         Icon: <AttachmentIcon />,
         disabled: false,
         disabled: false,
+        i18n: t('attachment_data'),
       },
       },
       {
       {
         name: 'shareLink',
         name: 'shareLink',
         Icon: <ShareLinkIcon />,
         Icon: <ShareLinkIcon />,
         disabled: isGuestUser || isSharedUser,
         disabled: isGuestUser || isSharedUser,
+        i18n: t('share_links.share_link_management'),
       },
       },
     ];
     ];
-  }, [isGuestUser, isSharedUser]);
+  }, [t, isGuestUser, isSharedUser]);
 
 
   return (
   return (
     <div className="grw-page-accessories-control d-flex flex-nowrap align-items-center justify-content-end justify-content-lg-between">
     <div className="grw-page-accessories-control d-flex flex-nowrap align-items-center justify-content-end justify-content-lg-between">
@@ -64,11 +69,9 @@ const PageAccessoriesModalControl = (props) => {
                 {accessory.Icon}
                 {accessory.Icon}
               </button>
               </button>
             </div>
             </div>
-            {accessory.disabled && (
-              <UncontrolledTooltip placement="top" target={`shareLink-btn-wrapper-for-tooltip-for-${accessory.name}`} fade={false}>
-                {t('Not available for guest')}
-              </UncontrolledTooltip>
-            )}
+            <UncontrolledTooltip placement="top" target={`shareLink-btn-wrapper-for-tooltip-for-${accessory.name}`} fade={false}>
+              {accessory.disabled ? t('Not available for guest') : accessory.i18n}
+            </UncontrolledTooltip>
           </Fragment>
           </Fragment>
         );
         );
       })}
       })}