mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
chore: Convert direct uses of antd icons to 'Icons' component (#22516)
This commit is contained in:
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { FileOutlined, FileImageOutlined } from '@ant-design/icons';
|
||||
import { css, styled, t, useTheme } from '@superset-ui/core';
|
||||
import Icons from 'src/components/Icons';
|
||||
import { Menu } from 'src/components/Menu';
|
||||
import ModalTrigger from 'src/components/ModalTrigger';
|
||||
import Button from 'src/components/Button';
|
||||
@@ -92,6 +92,13 @@ export const MenuTrigger = styled(Button)`
|
||||
`}
|
||||
`;
|
||||
|
||||
const iconReset = css`
|
||||
.ant-dropdown-menu-item > & > .anticon:first-child {
|
||||
margin-right: 0;
|
||||
vertical-align: 0;
|
||||
}
|
||||
`;
|
||||
|
||||
export const useExploreAdditionalActionsMenu = (
|
||||
latestQueryFormData,
|
||||
canDownloadCSV,
|
||||
@@ -271,14 +278,14 @@ export const useExploreAdditionalActionsMenu = (
|
||||
<>
|
||||
<Menu.Item
|
||||
key={MENU_KEYS.EXPORT_TO_CSV}
|
||||
icon={<FileOutlined />}
|
||||
icon={<Icons.FileOutlined css={iconReset} />}
|
||||
disabled={!canDownloadCSV}
|
||||
>
|
||||
{t('Export to original .CSV')}
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
key={MENU_KEYS.EXPORT_TO_CSV_PIVOTED}
|
||||
icon={<FileOutlined />}
|
||||
icon={<Icons.FileOutlined css={iconReset} />}
|
||||
disabled={!canDownloadCSV}
|
||||
>
|
||||
{t('Export to pivoted .CSV')}
|
||||
@@ -287,18 +294,21 @@ export const useExploreAdditionalActionsMenu = (
|
||||
) : (
|
||||
<Menu.Item
|
||||
key={MENU_KEYS.EXPORT_TO_CSV}
|
||||
icon={<FileOutlined />}
|
||||
icon={<Icons.FileOutlined css={iconReset} />}
|
||||
disabled={!canDownloadCSV}
|
||||
>
|
||||
{t('Export to .CSV')}
|
||||
</Menu.Item>
|
||||
)}
|
||||
<Menu.Item key={MENU_KEYS.EXPORT_TO_JSON} icon={<FileOutlined />}>
|
||||
<Menu.Item
|
||||
key={MENU_KEYS.EXPORT_TO_JSON}
|
||||
icon={<Icons.FileOutlined css={iconReset} />}
|
||||
>
|
||||
{t('Export to .JSON')}
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
key={MENU_KEYS.DOWNLOAD_AS_IMAGE}
|
||||
icon={<FileImageOutlined />}
|
||||
icon={<Icons.FileImageOutlined css={iconReset} />}
|
||||
>
|
||||
{t('Download as image')}
|
||||
</Menu.Item>
|
||||
|
||||
Reference in New Issue
Block a user