Skip to content

Commit dfb2429

Browse files
committed
add custom tooltip
1 parent 7b7f4f4 commit dfb2429

File tree

1 file changed

+40
-41
lines changed

1 file changed

+40
-41
lines changed

libs/remix-ui/workspace/src/lib/components/file-explorer-hovericons.tsx

Lines changed: 40 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { useState } from 'react'
22
import { CustomTooltip } from '@remix-ui/helper'
33
import { FormattedMessage } from 'react-intl'
4-
import { ROOT_PATH } from '../utils/constants'
54

65
export type FileHoverIconsProps = {
76
isEditable?: boolean
@@ -20,69 +19,69 @@ export function FileHoverIcons(props: FileHoverIconsProps) {
2019
{
2120
props.file.isDirectory ? (
2221
<>
23-
{/* <CustomTooltip
22+
<CustomTooltip
2423
placement="right-start"
2524
delay={{show: 1000, hide: 0}}
2625
tooltipText={<FormattedMessage id="filePanel.edit" />}
2726
tooltipId={`filePanel.edit.${props.file.path}`}
2827
tooltipClasses="text-nowrap"
29-
> */}
30-
<span
31-
className="far fa-folder fa-1x remixui_icons_space remixui_icons"
32-
onClick={async (e) => {
33-
e.stopPropagation()
34-
await props.handleNewFolderOp(props.file.path)
35-
}}
36-
></span>
37-
{/* </CustomTooltip> */}
38-
{/* <CustomTooltip
28+
>
29+
<span
30+
className="far fa-folder fa-1x remixui_icons_space remixui_icons"
31+
onClick={async (e) => {
32+
e.stopPropagation()
33+
await props.handleNewFolderOp(props.file.path)
34+
}}
35+
></span>
36+
</CustomTooltip>
37+
<CustomTooltip
3938
placement="right-start"
4039
delay={{show: 1000, hide: 0}}
4140
tooltipText={<FormattedMessage id="fileExplorer.edit" />}
4241
tooltipId={`fileExplorer.edit.${props.file.path}`}
4342
tooltipClasses="text-nowrap"
44-
> */}
45-
<span
46-
className="far fa-file fa-1x remixui_icons remixui_icons_space"
47-
onClick={async (e) => {
48-
e.stopPropagation()
49-
await props.handleNewFileOp(props.file.path)
50-
}}
51-
></span>
52-
{/* </CustomTooltip> */}
43+
>
44+
<span
45+
className="far fa-file fa-1x remixui_icons remixui_icons_space"
46+
onClick={async (e) => {
47+
e.stopPropagation()
48+
await props.handleNewFileOp(props.file.path)
49+
}}
50+
></span>
51+
</CustomTooltip>
5352
</>
5453
) : null
5554
}
56-
{/* <CustomTooltip
55+
<CustomTooltip
5756
placement="right-start"
5857
delay={{show: 1000, hide: 0}}
5958
tooltipText={<FormattedMessage id="fileExplorer.edit" />}
6059
tooltipId={`fileExplorer.edit.${props.file.path}`}
6160
tooltipClasses="text-nowrap"
62-
> */}
63-
<span
64-
className="far fa-pen fa-1x remixui_icons remixui_icons_space"
65-
onClick={async (e) => {
66-
e.stopPropagation()
67-
await props.renamePathOp(props.file.path, props.file.type)
68-
}}
69-
></span>
70-
{/* </CustomTooltip> */}
71-
{/* <CustomTooltip
61+
>
62+
<span
63+
className="far fa-pen fa-1x remixui_icons remixui_icons_space"
64+
onClick={async (e) => {
65+
e.stopPropagation()
66+
await props.renamePathOp(props.file.path, props.file.type)
67+
}}
68+
></span>
69+
</CustomTooltip>
70+
<CustomTooltip
7271
placement="right-start"
7372
delay={{show: 1000, hide: 0}}
7473
tooltipText={<FormattedMessage id="fileExplorer.edit" />}
7574
tooltipId={`fileExplorer.edit.${props.file.path}`}
7675
tooltipClasses="text-nowrap"
77-
> */}
78-
<span
79-
className="far fa-trash fa-1x remixui_icons remixui_icons_space"
80-
onClick={async (e) => {
81-
e.stopPropagation()
82-
await props.deletePathOp(props.file.path)
83-
}}
84-
></span>
85-
{/* </CustomTooltip> */}
76+
>
77+
<span
78+
className="far fa-trash fa-1x remixui_icons remixui_icons_space"
79+
onClick={async (e) => {
80+
e.stopPropagation()
81+
await props.deletePathOp(props.file.path)
82+
}}
83+
></span>
84+
</CustomTooltip>
8685
</div>
8786
}
8887
</>

0 commit comments

Comments
 (0)