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 { 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 React, { useContext, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
@ -11,13 +11,15 @@ export const PluginManagerLink = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const history = useHistory(); const history = useHistory();
return ( return (
<Button <Tooltip title={t('Plugin manager')}>
icon={<ApiOutlined />} <Button
title={t('Plugin manager')} icon={<ApiOutlined />}
onClick={() => { title={t('Plugin manager')}
history.push('/admin/pm/list'); onClick={() => {
}} history.push('/admin/pm/list');
/> }}
/>
</Tooltip>
); );
}; };

View File

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