瀏覽代碼

feat: add Tooltip to action icon of FileManager (#561)

### What problem does this PR solve?
#345
feat: add Tooltip to action icon of FileManager 

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
tags/v0.4.0
balibabu 1 年之前
父節點
當前提交
6329339a32
沒有連結到貢獻者的電子郵件帳戶。
共有 4 個檔案被更改,包括 29 行新增20 行删除
  1. 1
    0
      web/src/locales/en.ts
  2. 1
    0
      web/src/locales/zh-traditional.ts
  3. 1
    0
      web/src/locales/zh.ts
  4. 26
    20
      web/src/pages/file-manager/action-cell/index.tsx

+ 1
- 0
web/src/locales/en.ts 查看文件

@@ -23,6 +23,7 @@ export default {
copy: 'Copy',
copied: 'Copied',
comingSoon: 'Coming Soon',
download: 'Download',
},
login: {
login: 'Sign in',

+ 1
- 0
web/src/locales/zh-traditional.ts 查看文件

@@ -23,6 +23,7 @@ export default {
copy: '複製',
copied: '複製成功',
comingSoon: '即將推出',
download: '下載',
},
login: {
login: '登入',

+ 1
- 0
web/src/locales/zh.ts 查看文件

@@ -23,6 +23,7 @@ export default {
copy: '复制',
copied: '复制成功',
comingSoon: '即将推出',
download: '下载',
},
login: {
login: '登录',

+ 26
- 20
web/src/pages/file-manager/action-cell/index.tsx 查看文件

@@ -6,7 +6,7 @@ import {
DeleteOutlined,
DownloadOutlined,
EditOutlined,
ToolOutlined,
LinkOutlined,
} from '@ant-design/icons';
import { Button, Space, Tooltip } from 'antd';
import { useHandleDeleteFile } from '../hooks';
@@ -30,7 +30,7 @@ const ActionCell = ({
}: IProps) => {
const documentId = record.id;
const beingUsed = false;
const { t } = useTranslate('knowledgeDetails');
const { t } = useTranslate('fileManager');
const { handleRemoveFile } = useHandleDeleteFile(
[documentId],
setSelectedRowKeys,
@@ -58,13 +58,15 @@ const ActionCell = ({

return (
<Space size={0}>
<Button
type="text"
className={styles.iconButton}
onClick={onShowConnectToKnowledgeModal}
>
<ToolOutlined size={20} />
</Button>
<Tooltip title={t('addToKnowledge')}>
<Button
type="text"
className={styles.iconButton}
onClick={onShowConnectToKnowledgeModal}
>
<LinkOutlined size={20} />
</Button>
</Tooltip>

<Tooltip title={t('rename', { keyPrefix: 'common' })}>
<Button
@@ -76,23 +78,27 @@ const ActionCell = ({
<EditOutlined size={20} />
</Button>
</Tooltip>
<Button
type="text"
disabled={beingUsed}
onClick={handleRemoveFile}
className={styles.iconButton}
>
<DeleteOutlined size={20} />
</Button>
{record.type !== 'folder' && (
<Tooltip title={t('delete', { keyPrefix: 'common' })}>
<Button
type="text"
disabled={beingUsed}
onClick={onDownloadDocument}
onClick={handleRemoveFile}
className={styles.iconButton}
>
<DownloadOutlined size={20} />
<DeleteOutlined size={20} />
</Button>
</Tooltip>
{record.type !== 'folder' && (
<Tooltip title={t('download', { keyPrefix: 'common' })}>
<Button
type="text"
disabled={beingUsed}
onClick={onDownloadDocument}
className={styles.iconButton}
>
<DownloadOutlined size={20} />
</Button>
</Tooltip>
)}
</Space>
);

Loading…
取消
儲存