Procházet zdrojové kódy

implemented the tooltip for pageAccessoriesModal

白石誠 před 5 roky
rodič
revize
b801adf0b8

+ 11 - 2
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,10 +69,14 @@ const PageAccessoriesModalControl = (props) => {
                 {accessory.Icon}
                 {accessory.Icon}
               </button>
               </button>
             </div>
             </div>
-            {accessory.disabled && (
+            {accessory.disabled ? (
               <UncontrolledTooltip placement="top" target={`shareLink-btn-wrapper-for-tooltip-for-${accessory.name}`} fade={false}>
               <UncontrolledTooltip placement="top" target={`shareLink-btn-wrapper-for-tooltip-for-${accessory.name}`} fade={false}>
                 {t('Not available for guest')}
                 {t('Not available for guest')}
               </UncontrolledTooltip>
               </UncontrolledTooltip>
+            ) : (
+              <UncontrolledTooltip placement="top" target={`shareLink-btn-wrapper-for-tooltip-for-${accessory.name}`} fade={false}>
+                {accessory.i18n}
+              </UncontrolledTooltip>
             )}
             )}
           </Fragment>
           </Fragment>
         );
         );