Skip to content

Commit 1ed380f

Browse files
committed
iconfont
1 parent 827db41 commit 1ed380f

3 files changed

Lines changed: 19 additions & 53 deletions

File tree

chat2db-client/src/components/CustomLayout/index.less

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,19 @@
44
display: flex;
55
align-items: center;
66
.iconPanel {
7+
display: flex;
8+
align-items: center;
9+
justify-content: center;
710
margin: 0px 5px;
8-
border: 1px solid var(--color-text-tertiary);
911
border-radius: 3px;
10-
height: 14px;
11-
width: 14px;
12-
position: relative;
13-
overflow: hidden;
12+
height: 20px;
13+
width: 20px;
1414
cursor: pointer;
15-
&::after {
16-
position: absolute;
17-
content: '';
18-
width: 6px;
19-
background-color: var(--color-text-tertiary);
15+
&:hover {
16+
background-color: var(--color-hover-bg);
2017
}
21-
}
22-
23-
.iconPanelLeft {
24-
&::after {
25-
top: 0;
26-
bottom: 0;
27-
left: 0;
28-
}
29-
}
30-
31-
.iconPanelLeftHidden {
32-
&::after {
33-
left: 5px;
34-
width: 1px;
35-
}
36-
}
37-
38-
.iconPanelRight {
39-
&::after {
40-
top: 0;
41-
bottom: 0;
42-
right: 0;
43-
width: 6px;
44-
}
45-
}
46-
47-
.iconPanelRightHidden {
48-
&::after {
49-
right: 5px;
50-
width: 1px;
18+
i {
19+
font-size: 18px;
5120
}
5221
}
5322
}

chat2db-client/src/components/CustomLayout/index.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import styles from './index.less';
33
import classnames from 'classnames';
44
import { useWorkspaceStore } from '@/pages/main/workspace/store';
55
import { togglePanelLeft, togglePanelRight } from '@/pages/main/workspace/store/config';
6+
import Iconfont from '@/components/Iconfont';
67

78
interface IProps {
89
className?: string;
@@ -24,16 +25,12 @@ export default memo<IProps>((props) => {
2425

2526
return (
2627
<div className={classnames(styles.customLayout, className)}>
27-
<div
28-
className={classnames(styles.iconPanelLeft, styles.iconPanel, { [styles.iconPanelLeftHidden]: !panelLeft })}
29-
onClick={togglePanelLeft}
30-
onDoubleClick={stopPropagation}
31-
/>
32-
<div
33-
className={classnames(styles.iconPanelRight, styles.iconPanel, { [styles.iconPanelRightHidden]: !panelRight })}
34-
onClick={togglePanelRight}
35-
onDoubleClick={stopPropagation}
36-
/>
28+
<div className={classnames(styles.iconPanel)} onClick={togglePanelLeft} onDoubleClick={stopPropagation}>
29+
{panelLeft ? <Iconfont code="&#xe674;" /> : <Iconfont code="&#xe670;" />}
30+
</div>
31+
<div className={classnames(styles.iconPanel)} onClick={togglePanelRight} onDoubleClick={stopPropagation}>
32+
{panelRight ? <Iconfont code="&#xe672;" /> : <Iconfont code="&#xe673;" />}
33+
</div>
3734
</div>
3835
);
3936
});

chat2db-client/src/components/Iconfont/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ if (__ENV__ === 'local') {
99
/* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
1010
@font-face {
1111
font-family: 'iconfont'; /* Project id 3633546 */
12-
src: url('//at.alicdn.com/t/c/font_3633546_wtvchggsz6n.woff2?t=1704785517485') format('woff2'),
13-
url('//at.alicdn.com/t/c/font_3633546_wtvchggsz6n.woff?t=1704785517485') format('woff'),
14-
url('//at.alicdn.com/t/c/font_3633546_wtvchggsz6n.ttf?t=1704785517485') format('truetype');
12+
src: url('//at.alicdn.com/t/c/font_3633546_n19od3mt6mo.woff2?t=1704792255884') format('woff2'),
13+
url('//at.alicdn.com/t/c/font_3633546_n19od3mt6mo.woff?t=1704792255884') format('woff'),
14+
url('//at.alicdn.com/t/c/font_3633546_n19od3mt6mo.ttf?t=1704792255884') format('truetype');
1515
}
1616
`;
1717
const style = document.createElement('style');

0 commit comments

Comments
 (0)