Skip to content

Commit b7f7e00

Browse files
committed
style: change add icon style and hide icon without hover
1 parent 7f921aa commit b7f7e00

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

src/renderer/components/SideTree.tsx

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,31 @@ import { stopPropagation } from '../utils/dom';
1414
const StyledTree = styled(Tree)`
1515
margin-top: 0.5rem;
1616
17-
.arco-tree-node-title:hover .arco-tree-node-drag-icon {
18-
opacity: 0;
19-
}
17+
.arco-tree-node {
18+
.arco-tree-node-title:hover .arco-tree-node-drag-icon {
19+
opacity: 0;
20+
}
2021
21-
.arco-tree-node-title {
22-
padding: 0;
23-
padding-right: 4px;
22+
.arco-tree-node-title {
23+
padding: 0;
24+
padding-right: 4px;
25+
26+
& .arco-tree-node-title-text > div {
27+
padding: 5px 0 5px 4px;
28+
}
29+
}
2430
25-
& .arco-tree-node-title-text > div {
26-
padding: 5px 0 5px 4px;
31+
.add-icon {
32+
position: absolute;
33+
right: 8px;
34+
font-size: 12px;
35+
top: 10px;
36+
color: rgb(100, 100, 100);
37+
opacity: 0;
38+
}
39+
40+
&:hover .add-icon {
41+
opacity: 1;
2742
}
2843
}
2944
` as unknown as typeof Tree;
@@ -105,13 +120,7 @@ export const SideTree: React.FC = React.memo(() => {
105120
renderExtra={(node) => {
106121
return (
107122
<IconPlus
108-
style={{
109-
position: 'absolute',
110-
right: 8,
111-
fontSize: 12,
112-
top: 10,
113-
color: '#3370ff',
114-
}}
123+
className="add-icon"
115124
onClick={() => {
116125
if (!node.dataRef) {
117126
return;

0 commit comments

Comments
 (0)