add custom tooltip

pull/4446/head
Joseph Izang 9 months ago
parent 7b7f4f49ec
commit dfb2429df9
  1. 81
      libs/remix-ui/workspace/src/lib/components/file-explorer-hovericons.tsx

@ -1,7 +1,6 @@
import React, { useState } from 'react' import React, { useState } from 'react'
import { CustomTooltip } from '@remix-ui/helper' import { CustomTooltip } from '@remix-ui/helper'
import { FormattedMessage } from 'react-intl' import { FormattedMessage } from 'react-intl'
import { ROOT_PATH } from '../utils/constants'
export type FileHoverIconsProps = { export type FileHoverIconsProps = {
isEditable?: boolean isEditable?: boolean
@ -20,69 +19,69 @@ export function FileHoverIcons(props: FileHoverIconsProps) {
{ {
props.file.isDirectory ? ( props.file.isDirectory ? (
<> <>
{/* <CustomTooltip <CustomTooltip
placement="right-start" placement="right-start"
delay={{show: 1000, hide: 0}} delay={{show: 1000, hide: 0}}
tooltipText={<FormattedMessage id="filePanel.edit" />} tooltipText={<FormattedMessage id="filePanel.edit" />}
tooltipId={`filePanel.edit.${props.file.path}`} tooltipId={`filePanel.edit.${props.file.path}`}
tooltipClasses="text-nowrap" tooltipClasses="text-nowrap"
> */} >
<span <span
className="far fa-folder fa-1x remixui_icons_space remixui_icons" className="far fa-folder fa-1x remixui_icons_space remixui_icons"
onClick={async (e) => { onClick={async (e) => {
e.stopPropagation() e.stopPropagation()
await props.handleNewFolderOp(props.file.path) await props.handleNewFolderOp(props.file.path)
}} }}
></span> ></span>
{/* </CustomTooltip> */} </CustomTooltip>
{/* <CustomTooltip <CustomTooltip
placement="right-start" placement="right-start"
delay={{show: 1000, hide: 0}} delay={{show: 1000, hide: 0}}
tooltipText={<FormattedMessage id="fileExplorer.edit" />} tooltipText={<FormattedMessage id="fileExplorer.edit" />}
tooltipId={`fileExplorer.edit.${props.file.path}`} tooltipId={`fileExplorer.edit.${props.file.path}`}
tooltipClasses="text-nowrap" tooltipClasses="text-nowrap"
> */} >
<span <span
className="far fa-file fa-1x remixui_icons remixui_icons_space" className="far fa-file fa-1x remixui_icons remixui_icons_space"
onClick={async (e) => { onClick={async (e) => {
e.stopPropagation() e.stopPropagation()
await props.handleNewFileOp(props.file.path) await props.handleNewFileOp(props.file.path)
}} }}
></span> ></span>
{/* </CustomTooltip> */} </CustomTooltip>
</> </>
) : null ) : null
} }
{/* <CustomTooltip <CustomTooltip
placement="right-start" placement="right-start"
delay={{show: 1000, hide: 0}} delay={{show: 1000, hide: 0}}
tooltipText={<FormattedMessage id="fileExplorer.edit" />} tooltipText={<FormattedMessage id="fileExplorer.edit" />}
tooltipId={`fileExplorer.edit.${props.file.path}`} tooltipId={`fileExplorer.edit.${props.file.path}`}
tooltipClasses="text-nowrap" tooltipClasses="text-nowrap"
> */} >
<span <span
className="far fa-pen fa-1x remixui_icons remixui_icons_space" className="far fa-pen fa-1x remixui_icons remixui_icons_space"
onClick={async (e) => { onClick={async (e) => {
e.stopPropagation() e.stopPropagation()
await props.renamePathOp(props.file.path, props.file.type) await props.renamePathOp(props.file.path, props.file.type)
}} }}
></span> ></span>
{/* </CustomTooltip> */} </CustomTooltip>
{/* <CustomTooltip <CustomTooltip
placement="right-start" placement="right-start"
delay={{show: 1000, hide: 0}} delay={{show: 1000, hide: 0}}
tooltipText={<FormattedMessage id="fileExplorer.edit" />} tooltipText={<FormattedMessage id="fileExplorer.edit" />}
tooltipId={`fileExplorer.edit.${props.file.path}`} tooltipId={`fileExplorer.edit.${props.file.path}`}
tooltipClasses="text-nowrap" tooltipClasses="text-nowrap"
> */} >
<span <span
className="far fa-trash fa-1x remixui_icons remixui_icons_space" className="far fa-trash fa-1x remixui_icons remixui_icons_space"
onClick={async (e) => { onClick={async (e) => {
e.stopPropagation() e.stopPropagation()
await props.deletePathOp(props.file.path) await props.deletePathOp(props.file.path)
}} }}
></span> ></span>
{/* </CustomTooltip> */} </CustomTooltip>
</div> </div>
} }
</> </>

Loading…
Cancel
Save