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



##########
File path: superset-frontend/src/views/CRUD/data/query/QueryList.tsx
##########
@@ -80,17 +86,16 @@ const StyledPopoverItem = styled.div`
   color: ${({ theme }) => theme.colors.grayscale.dark2};
 `;
 
-const StatusIcon = styled(Icon, {
-  shouldForwardProp: prop => prop !== 'status',
-})<{ status: string }>`
-  color: ${({ status, theme }) => {
-    if (status === 'success') return theme.colors.success.base;
-    if (status === 'failed') return theme.colors.error.base;
-    if (status === 'running') return theme.colors.primary.base;
-    if (status === 'offline') return theme.colors.grayscale.light1;
+const getColor = (theme: SupersetTheme, status: string) => {
+  if (status === 'success') return theme.colors.success.base;
+  if (status === 'failed') return theme.colors.error.base;
+  if (status === 'running') return theme.colors.primary.base;
+  if (status === 'offline') return theme.colors.grayscale.light1;
+  return theme.colors.grayscale.base;
+};
 
-    return theme.colors.grayscale.base;
-  }};
+const StatusIcon = (theme: SupersetTheme, status: string) => css`

Review comment:
       This makes sense. One of the good reasons to use `styled` is for this 
sort of reusability... I think we would still need a `getColor` method to 
choose the right color for each of these `iconColor` implementations anyway, 
unless I'm mistaken.
   




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

To unsubscribe, e-mail: [email protected]

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