rusackas commented on a change in pull request #14318:
URL: https://github.com/apache/superset/pull/14318#discussion_r620895681
##########
File path: superset-frontend/src/components/Icons/Icon.tsx
##########
@@ -17,34 +17,52 @@
* under the License.
*/
-import React from 'react';
+import React, { useEffect, useRef, useState } from 'react';
import AntdIcon from '@ant-design/icons';
import { styled } from '@superset-ui/core';
-import { CustomIconComponentProps } from
'@ant-design/icons/lib/components/Icon';
+import { ReactComponent as TransparentIcon } from
'images/icons/transparent.svg';
import IconType from './IconType';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
-const EnhancedIcon = ({ iconColor, iconSize, ...rest }: IconType) => (
+const AntdIconComponent = ({ iconColor, iconSize, ...rest }: IconType) => (
<AntdIcon viewBox={rest.viewBox || '0 0 24 24'} {...rest} />
);
-const Icon = styled(EnhancedIcon)<IconType>`
+const StyledIcon = styled(AntdIconComponent)<IconType>`
${({ iconColor }) => iconColor && `color: ${iconColor};`};
font-size: ${({ iconSize, theme }) =>
iconSize ? `${theme.typography.sizes[iconSize]}px` : '24px'};
`;
-export const renderIcon = (
- SVGComponent:
- | React.ComponentClass<
- CustomIconComponentProps | React.SVGProps<SVGSVGElement>,
- any
- >
- | React.FunctionComponent<
- CustomIconComponentProps | React.SVGProps<SVGSVGElement>
- >
- | undefined,
- props: IconType,
-) => <Icon component={SVGComponent} {...props} />;
-
-export default Icon;
+interface IconProps extends IconType {
+ path: string;
Review comment:
nit, but it might be worth calling this filePath since that's what it's
really referencing, since `path` also sounds like an SVG path
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]