|
1 | 1 | import React, { useEffect, useState } from 'react'; |
2 | 2 | import { useNavigate } from 'react-router-dom'; |
3 | 3 | import { connect } from 'umi'; |
4 | | -import { Dropdown } from 'antd'; |
| 4 | +import { Dropdown, Tooltip } from 'antd'; |
5 | 5 | import classnames from 'classnames'; |
6 | 6 |
|
7 | 7 | import Iconfont from '@/components/Iconfont'; |
@@ -35,27 +35,31 @@ const navConfig: INavItem[] = [ |
35 | 35 | iconFontSize: 16, |
36 | 36 | isLoad: false, |
37 | 37 | component: <Workspace />, |
| 38 | + name: i18n('workspace.title'), |
38 | 39 | }, |
39 | 40 | { |
40 | 41 | key: 'dashboard', |
41 | 42 | icon: '\ue629', |
42 | 43 | iconFontSize: 24, |
43 | 44 | isLoad: false, |
44 | 45 | component: <Dashboard />, |
| 46 | + name: i18n('dashboard.title'), |
45 | 47 | }, |
46 | 48 | { |
47 | 49 | key: 'connections', |
48 | 50 | icon: '\ue622', |
49 | 51 | iconFontSize: 20, |
50 | 52 | isLoad: false, |
51 | 53 | component: <Connection />, |
| 54 | + name: i18n('connection.title'), |
52 | 55 | }, |
53 | 56 | { |
54 | 57 | key: 'github', |
55 | 58 | icon: '\ue885', |
56 | 59 | iconFontSize: 26, |
57 | 60 | isLoad: false, |
58 | 61 | openBrowser: 'https://github.com/chat2db/Chat2DB/', |
| 62 | + name: 'Github', |
59 | 63 | }, |
60 | 64 | ]; |
61 | 65 |
|
@@ -126,6 +130,7 @@ function MainPage(props: IProps) { |
126 | 130 | iconFontSize: 24, |
127 | 131 | isLoad: false, |
128 | 132 | component: <Team />, |
| 133 | + name: '团队协作', |
129 | 134 | }); |
130 | 135 | if (localStorage.getItem('curPage') === 'team') { |
131 | 136 | setActiveNav(navConfig[3]); |
@@ -197,32 +202,27 @@ function MainPage(props: IProps) { |
197 | 202 | <ul className={styles.navList}> |
198 | 203 | {navConfig.map((item) => { |
199 | 204 | return ( |
200 | | - <li |
201 | | - key={item.key} |
202 | | - className={classnames({ |
203 | | - [styles.activeNav]: item.key == activeNav?.key, |
204 | | - })} |
205 | | - onClick={() => switchingNav(item)} |
206 | | - > |
207 | | - <Iconfont |
208 | | - style={{ '--icon-size': item.iconFontSize + 'px' } as any} |
209 | | - className={styles.icon} |
210 | | - code={item.icon} |
211 | | - /> |
212 | | - </li> |
| 205 | + <Tooltip key={item.key} placement="right" title={item.name}> |
| 206 | + <li |
| 207 | + className={classnames({ |
| 208 | + [styles.activeNav]: item.key == activeNav?.key, |
| 209 | + })} |
| 210 | + onClick={() => switchingNav(item)} |
| 211 | + > |
| 212 | + <Iconfont |
| 213 | + style={{ '--icon-size': item.iconFontSize + 'px' } as any} |
| 214 | + className={styles.icon} |
| 215 | + code={item.icon} |
| 216 | + /> |
| 217 | + </li> |
| 218 | + </Tooltip> |
213 | 219 | ); |
214 | 220 | })} |
215 | 221 | </ul> |
216 | 222 | <div className={styles.footer}> |
217 | | - {/* <Iconfont |
218 | | - code="" |
219 | | - className={styles.questionIcon} |
220 | | - onClick={() => { |
221 | | - window.open('https://github.com/chat2db/chat2db/wiki'); |
222 | | - }} |
223 | | - /> */} |
224 | | - |
225 | | - {userInfo?.roleCode !== IRole.DESKTOP ? renderUser() : null} |
| 223 | + <Tooltip placement="right" title="个人中心"> |
| 224 | + {userInfo?.roleCode !== IRole.DESKTOP ? renderUser() : null} |
| 225 | + </Tooltip> |
226 | 226 | <Setting className={styles.setIcon} /> |
227 | 227 | </div> |
228 | 228 | </div> |
|
0 commit comments