Skip to content

Commit f8a89e2

Browse files
authored
fix: icon support spin (#250)
1 parent d6cf981 commit f8a89e2

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

src/components/icon/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export function Icon(props: React.PropsWithChildren<IIconProps>) {
1515
className={classNames(
1616
className,
1717
'codicon',
18-
prefixClaName(type, 'codicon')
18+
type.includes('~spin') && 'codicon-spin',
19+
prefixClaName(type.split('~spin')[0], 'codicon')
1920
)}
2021
{...restProps}
2122
>

src/extensions/folderTree/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ export const ExtendsFolderTree: IExtension = {
4848
id: `${file.id}`?.split('_')?.[0],
4949
modified: false,
5050
data: {
51-
...(file.data || {}),
5251
value: file.content,
5352
path: file.location,
5453
language: extName,
54+
...(file.data || {}),
5555
},
5656
};
5757

src/style/animation.scss

+14
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,17 @@
1111
.fade-in {
1212
animation: fadeIn 0.083s linear;
1313
}
14+
15+
@keyframes fa-spin {
16+
0% {
17+
transform: rotate(0deg);
18+
}
19+
20+
100% {
21+
transform: rotate(359deg);
22+
}
23+
}
24+
25+
.codicon-spin {
26+
animation: fa-spin 2s infinite linear;
27+
}

src/workbench/editor/style.scss

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
&--disabled {
5050
cursor: default;
5151
opacity: 0.4;
52+
pointer-events: none;
5253
}
5354
}
5455
}

0 commit comments

Comments
 (0)