From 66fbce9decbdc0b1d0bb86be7e78fea3bdf760c9 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Thu, 7 Oct 2021 01:36:57 -0600 Subject: [PATCH] chore: removing use of supersetTheme in favor of ThemeProvider (#17000) --- .../src/components/ErrorMessage/BasicErrorAlert.tsx | 8 +++++--- .../src/components/ErrorMessage/ErrorAlert.tsx | 12 +++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx index 0d5d99305dc..bcbb68022c4 100644 --- a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx +++ b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { styled, supersetTheme } from '@superset-ui/core'; +import { styled, useTheme } from '@superset-ui/core'; import Icons from 'src/components/Icons'; import { ErrorLevel } from './types'; @@ -54,12 +54,14 @@ export default function BasicErrorAlert({ level, title, }: BasicErrorAlertProps) { + const theme = useTheme(); + return ( {level === 'error' ? ( - + ) : ( - + )} {title} diff --git a/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx b/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx index 3298fcf0561..e98a463b251 100644 --- a/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx +++ b/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx @@ -17,7 +17,7 @@ * under the License. */ import React, { useState, ReactNode } from 'react'; -import { styled, supersetTheme, t } from '@superset-ui/core'; +import { styled, useTheme, t } from '@superset-ui/core'; import { noOp } from 'src/utils/common'; import Modal from 'src/components/Modal'; import Button from 'src/components/Button'; @@ -97,6 +97,8 @@ export default function ErrorAlert({ subtitle, title, }: ErrorAlertProps) { + const theme = useTheme(); + const [isModalOpen, setIsModalOpen] = useState(false); const [isBodyExpanded, setIsBodyExpanded] = useState(false); @@ -109,12 +111,12 @@ export default function ErrorAlert({ {level === 'error' ? ( ) : ( )} {title} @@ -172,12 +174,12 @@ export default function ErrorAlert({ {level === 'error' ? ( ) : ( )}
{title}