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(Icons): Replaces custom icons with Ant Design 5 icons #32112

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
refactor(caretDown):
- Small adjustments for caret down icon
- Restored menu icons in the header menu
  • Loading branch information
EnxDev committed Feb 5, 2025
commit 610adab1fe4093bdd73c3f4ef5043dd2c8db86f2
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const QueryLimitSelect = ({
<span className="limitDropdown">
{convertToNumWithSpaces(queryLimit)}
</span>
<Icons.DownOutlined
<Icons.CaretDownOutlined
iconSize="m"
iconColor={theme.colors.grayscale.base}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const RunQueryActionButton = ({
? {
overlay: overlayCreateAsMenu,
icon: (
<Icons.CaretDownOutlined
<Icons.DownOutlined
iconColor={
isDisabled
? theme.colors.grayscale.base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const SaveDatasetActionButton = ({
}
}
span[name='caret-down'] {
margin-left: ${theme.gridUnit * 1.5}px;
margin-left: ${theme.gridUnit * 2}px;
}
`;

Expand All @@ -62,8 +62,8 @@ const SaveDatasetActionButton = ({
onClick={() => setShowSave(true)}
overlay={overlayMenu}
icon={
<Icons.CaretDownOutlined
iconSize="xl"
<Icons.DownOutlined
iconSize="m"
iconColor={theme.colors.grayscale.light5}
name="caret-down"
/>
Expand Down
4 changes: 2 additions & 2 deletions superset-frontend/src/components/PopoverDropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ const PopoverDropdown = (props: PopoverDropdownProps) => {
>
<div role="button" css={{ display: 'flex', alignItems: 'center' }}>
{selected && renderButton(selected)}
<Icons.CaretDownOutlined
iconSize="m"
<Icons.DownOutlined
iconSize="s"
iconColor={theme.colors.grayscale.base}
css={{
marginTop: theme.gridUnit * 0.5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ const ConditionalFormattingControl = ({
<Icons.PlusOutlined
iconSize="xs"
iconColor={theme.colors.grayscale.light1}
css={theme => ({
margin: `auto ${theme.gridUnit * 2}px auto 0`,
verticalAlign: 'baseline',
})}
/>
{t('Add new color formatter')}
</AddControlLabel>
Expand Down
3 changes: 2 additions & 1 deletion superset-frontend/src/features/home/LanguagePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,15 @@ const StyledFlag = styled.i`
export default function LanguagePicker(props: LanguagePickerProps) {
const { locale, languages, ...rest } = props;
return (
//TODO remove TriangleDown with ANTD5 icon
<SubMenu
aria-label="Languages"
title={
<div className="f16">
<StyledFlag className={`flag ${languages[locale].flag}`} />
</div>
}
icon={<Icons.CaretDownOutlined />}
icon={<Icons.TriangleDown />}
{...rest}
>
{Object.keys(languages).map(langKey => (
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/features/home/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export function Menu({
<StyledSubMenu
key={index}
title={label}
icon={showMenu === 'inline' ? <></> : <Icons.CaretDownOutlined />}
icon={showMenu === 'inline' ? <></> : <Icons.TriangleDown />}
>
{childs?.map((child: MenuObjectChildProps | string, index1: number) => {
if (typeof child === 'string' && child === '-' && label !== 'Data') {
Expand Down
5 changes: 3 additions & 2 deletions superset-frontend/src/features/home/RightMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ const RightMenu = ({
data-test="new-dropdown-icon"
/>
}
icon={<Icons.CaretDownOutlined />}
icon={<Icons.TriangleDown />}
>
{dropdownItems?.map?.(menu => {
const canShowChild = menu.childs?.some(
Expand Down Expand Up @@ -473,7 +473,8 @@ const RightMenu = ({
})}
</StyledSubMenu>
)}
<StyledSubMenu title={t('Setting')} icon={<Icons.CaretDownOutlined />}>
{/* TODO replace TriangleDown with ANTD5 icons */ }
<StyledSubMenu title={t('Setting')} icon={<Icons.TriangleDown />}>
{settings?.map?.((section, index) => [
<Menu.ItemGroup key={`${section.label}`} title={section.label}>
{section?.childs?.map?.(child => {
Expand Down
3 changes: 2 additions & 1 deletion superset-frontend/src/features/home/SubMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,11 @@ const SubMenuComponent: FunctionComponent<SubMenuProps> = props => {
<div className={navRightStyle}>
<Menu mode="horizontal" triggerSubMenuAction="click" disabledOverflow>
{props.dropDownLinks?.map((link, i) => (
// TODO remove TriangleDown with ANTD5 icon
<SubMenu
key={i}
title={link.label}
icon={<Icons.CaretDownOutlined />}
icon={<Icons.TriangleDown />}
popupOffset={[10, 20]}
className="dropdown-menu-links"
>
Expand Down