Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: icon to icons for tabs #15551

Merged
merged 1 commit into from
Jul 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions superset-frontend/src/components/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import React from 'react';
import { css, styled } from '@superset-ui/core';
import AntDTabs, { TabsProps as AntDTabsProps } from 'antd/lib/tabs';
import Icon from 'src/components/Icon';
import Icons from 'src/components/Icons';

export interface TabsProps extends AntDTabsProps {
fullWidth?: boolean;
Expand Down Expand Up @@ -119,6 +119,9 @@ const StyledEditableTabs = styled(StyledTabs)`
`}
`;

const StyledCancelXIcon = styled(Icons.CancelX)`
color: ${({ theme }) => theme.colors.grayscale.base};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as in another PR. Here we should define whether the standard is to use the iconColor prop or go with this approach. Additionally, we might want to use this color as the base for the Icons component in general, to avoid repetition.

`;
export const EditableTabs = Object.assign(StyledEditableTabs, {
TabPane: StyledTabPane,
});
Expand All @@ -130,9 +133,7 @@ EditableTabs.defaultProps = {
};

EditableTabs.TabPane.defaultProps = {
closeIcon: (
<Icon role="button" tabIndex={0} cursor="pointer" name="cancel-x" />
),
closeIcon: <StyledCancelXIcon role="button" tabIndex={0} />,
};

export const StyledLineEditableTabs = styled(EditableTabs)`
Expand Down