fixed tooltips for plugins' tabs

pull/3530/head^2
lianahus 2 years ago committed by Aniket
parent 70926ae70b
commit 46e2ffe699
  1. 15
      apps/remix-ide/src/app/panels/tab-proxy.js
  2. 2
      apps/remix-ide/src/app/plugins/solidity-umlgen.tsx
  3. 3
      libs/remix-ui/helper/src/lib/components/custom-tooltip.tsx
  4. 4
      libs/remix-ui/home-tab/src/lib/components/homeTabTitle.tsx

@ -146,7 +146,7 @@ export class TabProxy extends Plugin {
}
})
this.on('manager', 'pluginActivated', ({ name, location, displayName, icon }) => {
this.on('manager', 'pluginActivated', ({ name, location, displayName, icon, description }) => {
if (location === 'mainPanel') {
this.addTab(
name,
@ -160,7 +160,8 @@ export class TabProxy extends Plugin {
this.emit('closeApp', name)
this.call('manager', 'deactivatePlugin', name)
},
icon
icon,
description
)
this.switchTab(name)
}
@ -223,7 +224,7 @@ export class TabProxy extends Plugin {
this.removeTab(oldName)
}
addTab (name, title, switchTo, close, icon) {
addTab (name, title, switchTo, close, icon, description = '') {
if (this._handlers[name]) return this.renderComponent()
var slash = name.split('/')
@ -244,7 +245,7 @@ export class TabProxy extends Plugin {
name,
title,
icon,
tooltip: title || name,
tooltip: name,
iconClass: getPathIcon(name)
})
formatPath.shift()
@ -252,7 +253,7 @@ export class TabProxy extends Plugin {
const index = this.loadedTabs.findIndex(({ title }) => title === formatPath.join('/'))
if (index > -1) {
const duplicateTabName = this.loadedTabs[index].name
const duplicateTabTooltip = this.loadedTabs[index].tooltip
const duplicateTabTooltip = this.loadedTabs[index].description
const duplicateTabPath = duplicateTabName.split('/')
const duplicateTabFormatPath = [...duplicateTabPath].reverse()
const duplicateTabTitle = duplicateTabFormatPath.slice(0, titleLength).reverse().join('/')
@ -261,7 +262,7 @@ export class TabProxy extends Plugin {
name: duplicateTabName,
title: duplicateTabTitle,
icon,
tooltip: duplicateTabTooltip,
tooltip: duplicateTabTooltip || duplicateTabTitle,
iconClass: getPathIcon(duplicateTabName)
}
}
@ -275,7 +276,7 @@ export class TabProxy extends Plugin {
name,
title,
icon,
tooltip: title || name,
tooltip: description || title,
iconClass: getPathIcon(name)
})
}

@ -18,7 +18,7 @@ const _paq = window._paq = window._paq || []
const profile = {
name: 'solidityumlgen',
displayName: 'Solidity UML Generator',
description: 'Generate UML diagram in svg format from last compiled contract',
description: 'Generates UML diagram in svg format from last compiled contract',
location: 'mainPanel',
methods: ['showUmlDiagram', 'generateUml', 'generateCustomAction'],
events: [],

@ -2,7 +2,8 @@ import React from 'react';
import { Fragment } from 'react';
import { OverlayTrigger, Popover } from 'react-bootstrap';
import { CustomTooltipType } from '../../types/customtooltip'
export function CustomTooltip({ children, placement, tooltipId, tooltipClasses, tooltipText, tooltipTextClasses, delay }: CustomTooltipType) {
export function CustomTooltip ({ children, placement, tooltipId, tooltipClasses, tooltipText, tooltipTextClasses, delay }: CustomTooltipType) {
if (typeof tooltipText !== 'string') {
const newTooltipText = React.cloneElement(tooltipText, {

@ -6,7 +6,7 @@ import { CustomTooltip } from '@remix-ui/helper'
const _paq = window._paq = window._paq || [] // eslint-disable-line
function HomeTabTitle() {
function HomeTabTitle () {
useEffect(() => {
document.addEventListener("keyup", (e) => handleSearchKeyDown(e))
return () => {
@ -184,4 +184,4 @@ function HomeTabTitle() {
)
}
export default HomeTabTitle
export default HomeTabTitle
Loading…
Cancel
Save