diff --git a/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx b/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx index 9ab653da5c..99a132b53d 100644 --- a/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx +++ b/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx @@ -17,11 +17,17 @@ * under the License. */ import React, { FunctionComponent, useState, useEffect } from 'react'; -import { styled, t, SupersetClient } from '@superset-ui/core'; +import { + styled, + t, + SupersetClient, + css, + SupersetTheme, +} from '@superset-ui/core'; import rison from 'rison'; import { useSingleViewResource } from 'src/views/CRUD/hooks'; -import Icon from 'src/components/Icon'; +import Icons from 'src/components/Icons'; import { Switch } from 'src/components/Switch'; import Modal from 'src/components/Modal'; import { Radio } from 'src/components/Radio'; @@ -135,8 +141,9 @@ const StyledModal = styled(Modal)` } `; -const StyledIcon = styled(Icon)` - margin: auto ${({ theme }) => theme.gridUnit * 2}px auto 0; +const StyledIcon = (theme: SupersetTheme) => css` + margin: auto ${theme.gridUnit * 2}px auto 0; + color: ${theme.colors.grayscale.base}; `; const StyledSectionContainer = styled.div` @@ -998,9 +1005,9 @@ const AlertReportModal: FunctionComponent = ({ title={

{isEditMode ? ( - + ) : ( - + )} {isEditMode ? t(`Edit ${isReport ? 'Report' : 'Alert'}`) diff --git a/superset-frontend/src/views/CRUD/alert/components/NotificationMethod.tsx b/superset-frontend/src/views/CRUD/alert/components/NotificationMethod.tsx index 7a43d2d590..0e4b1b7e09 100644 --- a/superset-frontend/src/views/CRUD/alert/components/NotificationMethod.tsx +++ b/superset-frontend/src/views/CRUD/alert/components/NotificationMethod.tsx @@ -17,9 +17,9 @@ * under the License. */ import React, { FunctionComponent, useState } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { styled, t, useTheme } from '@superset-ui/core'; import { NativeGraySelect as Select } from 'src/components/Select'; -import Icon from 'src/components/Icon'; +import Icons from 'src/components/Icons'; import { StyledInputContainer } from '../AlertReportModal'; const StyledNotificationMethod = styled.div` @@ -74,6 +74,7 @@ export const NotificationMethod: FunctionComponent = ({ const [recipientValue, setRecipientValue] = useState( recipients || '', ); + const theme = useTheme(); if (!setting) { return null; @@ -144,7 +145,7 @@ export const NotificationMethod: FunctionComponent = ({ className="delete-button" onClick={() => onRemove(index)} > - + ) : null} diff --git a/superset-frontend/src/views/CRUD/alert/components/RecipientIcon.tsx b/superset-frontend/src/views/CRUD/alert/components/RecipientIcon.tsx index 3a8fff81d1..b2e8652c53 100644 --- a/superset-frontend/src/views/CRUD/alert/components/RecipientIcon.tsx +++ b/superset-frontend/src/views/CRUD/alert/components/RecipientIcon.tsx @@ -16,38 +16,38 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, t } from '@superset-ui/core'; -import React from 'react'; +import { t, SupersetTheme, css } from '@superset-ui/core'; +import React, { ReactElement } from 'react'; import { Tooltip } from 'src/components/Tooltip'; -import Icon, { IconName } from 'src/components/Icon'; +import Icons from 'src/components/Icons'; import { RecipientIconName } from '../types'; -const StyledIcon = styled(Icon)` - color: ${({ theme }) => theme.colors.grayscale.light1}; - margin-right: ${({ theme }) => theme.gridUnit * 2}px; +const StyledIcon = (theme: SupersetTheme) => css` + color: ${theme.colors.grayscale.light1}; + margin-right: ${theme.gridUnit * 2}px; `; export default function RecipientIcon({ type }: { type: string }) { - const recipientIconConfig = { - name: '', + const recipientIconConfig: { icon: null | ReactElement; label: string } = { + icon: null, label: '', }; switch (type) { case RecipientIconName.email: - recipientIconConfig.name = 'email'; + recipientIconConfig.icon = ; recipientIconConfig.label = t(`${RecipientIconName.email}`); break; case RecipientIconName.slack: - recipientIconConfig.name = 'slack'; + recipientIconConfig.icon = ; recipientIconConfig.label = t(`${RecipientIconName.slack}`); break; default: - recipientIconConfig.name = ''; + recipientIconConfig.icon = null; recipientIconConfig.label = ''; } - return recipientIconConfig.name.length ? ( + return recipientIconConfig.icon ? ( - + {recipientIconConfig.icon} ) : null; }