rusackas commented on a change in pull request #14318:
URL: https://github.com/apache/superset/pull/14318#discussion_r620879086



##########
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'};

Review comment:
       Not part of this PR, but:
   
   This value is typed for `tsx` files, but you could perhaps pass a bad 
`iconSize` into this via `jsx` files. If that's a risk worth considering, you 
could mitigate it with `${theme.typography.sizes[iconSize] || 
theme.typography.sizes.m}px`
   ```suggestion
       iconSize ? `${theme.typography.sizes[iconSize]}px` : '24px'};
   ```




-- 
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]

Reply via email to