fix: plugin-manage and designable-switch add tooltip (#1749)

This commit is contained in:
李小斐 2023-04-24 14:29:26 +08:00 committed by GitHub
parent 60b818fd3c
commit fbe73d1e80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 19 deletions

View File

@ -1,5 +1,5 @@
import { ApiOutlined, SettingOutlined } from '@ant-design/icons';
import { Button, Dropdown, Menu } from 'antd';
import { Button, Dropdown, Menu, Tooltip } from 'antd';
import React, { useContext, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router-dom';
@ -11,13 +11,15 @@ export const PluginManagerLink = () => {
const { t } = useTranslation();
const history = useHistory();
return (
<Button
icon={<ApiOutlined />}
title={t('Plugin manager')}
onClick={() => {
history.push('/admin/pm/list');
}}
/>
<Tooltip title={t('Plugin manager')}>
<Button
icon={<ApiOutlined />}
title={t('Plugin manager')}
onClick={() => {
history.push('/admin/pm/list');
}}
/>
</Tooltip>
);
};

View File

@ -1,5 +1,5 @@
import { HighlightOutlined } from '@ant-design/icons';
import { Button } from 'antd';
import { Button, Tooltip } from 'antd';
import React from 'react';
import { useHotkeys } from 'react-hotkeys-hook';
import { useTranslation } from 'react-i18next';
@ -17,15 +17,17 @@ export const DesignableSwitch = () => {
useHotkeys('Ctrl+Shift+U', () => setDesignable(!designable), [designable]);
return (
<Button
// selected={designable}
icon={<HighlightOutlined />}
title={t('UI Editor')}
// subtitle={'Ctrl+Shift+U'}
style={style}
onClick={() => {
setDesignable(!designable);
}}
/>
<Tooltip title={t('UI Editor')}>
<Button
// selected={designable}
icon={<HighlightOutlined />}
title={t('UI Editor')}
// subtitle={'Ctrl+Shift+U'}
style={style}
onClick={() => {
setDesignable(!designable);
}}
/>
</Tooltip>
);
};