Merge pull request #4141 from ethereum/ferow

FE tooltips are back.
pull/5370/head
Liana Husikyan 1 year ago committed by GitHub
commit 4f32aa4d86
  1. 6
      libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx
  2. 20
      libs/remix-ui/workspace/src/lib/components/file-label.tsx
  3. 6
      libs/remix-ui/workspace/src/lib/css/file-explorer.css
  4. 2
      libs/remix-ui/workspace/src/lib/css/remix-ui-workspace.css

@ -86,7 +86,11 @@ const Icon = ({iconRecord, verticalIconPlugin, contextMenuAction, theme}: IconPr
return (
<>
<CustomTooltip placement={name === 'settings' ? 'right' : name === 'search' ? 'top' : name === 'udapp' ? 'bottom' : 'top'} tooltipText={title} delay={{show: 1000, hide: 0}}>
<CustomTooltip
placement={name === 'settings' ? 'right' : name === 'search' ? 'top' : name === 'udapp' ? 'bottom' : 'top'}
tooltipText={title}
delay={{show: 1000, hide: 0}}
>
<div
className={`remixui_icon m-2 pt-1`}
onClick={() => {

@ -1,5 +1,7 @@
// eslint-disable-next-line no-use-before-define
import {fileDecoration} from '@remix-ui/file-decorators'
import {CustomTooltip} from '@remix-ui/helper'
import {FormattedMessage} from 'react-intl'
import React, {useEffect, useRef, useState} from 'react'
import {FileType} from '../types'
export interface FileLabelProps {
@ -65,18 +67,28 @@ export const FileLabel = (props: FileLabelProps) => {
labelRef.current.innerText = file.name
}
// The tooltip is setted up on the label and not the whole line to avoid unnecessary tooltips on the short filenames.
// It has the delay for the same reason.
return (
<div
className="remixui_items d-inline-block w-100 text-break"
className="remixui_items d-inline-block w-100"
ref={isEditable ? labelRef : null}
suppressContentEditableWarning={true}
contentEditable={isEditable}
onKeyDown={handleEditInput}
onBlur={handleEditBlur}
>
<span className={`text-nowrap remixui_label ${fileStateClasses} ` + (file.isDirectory ? 'folder' : 'remixui_leaf')} data-path={file.path}>
{file.name}
</span>
<CustomTooltip
placement="top"
delay={{show: 1000, hide: 0}}
tooltipText={`${file.path}`}
tooltipId={`fileExplorer.${file.path}`}
tooltipClasses="text-nowrap"
>
<span className={`remixui_label ${fileStateClasses} ` + (file.isDirectory ? 'folder' : 'remixui_leaf')} data-path={file.path}>
{file.name}
</span>
</CustomTooltip>
</div>
)
}

@ -33,7 +33,11 @@ input[type="file"] {
margin-left : 20px;
}
.remixui_items {
display : inline
display : inline;
white-space : nowrap;
overflow : hidden;
text-overflow : ellipsis;
max-width : 90%;
}
.remixui_remove {
margin-left : auto;

@ -40,7 +40,7 @@
cursor : pointer;
}
.remixui_treeview {
overflow-y : auto;
overflow-x : hidden;
}
.remixui_dialog {
display: flex;

Loading…
Cancel
Save