mirror of
https://github.com/apache/superset.git
synced 2026-04-24 02:25:13 +00:00
chore: Removes direct theme imports (#19368)
This commit is contained in:
committed by
GitHub
parent
d304849b46
commit
816a2c3e1e
@@ -17,8 +17,8 @@
|
||||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import { mount } from 'enzyme';
|
||||
import { supersetTheme, ThemeProvider } from '@superset-ui/core';
|
||||
import RunQueryActionButton from 'src/SqlLab/components/RunQueryActionButton';
|
||||
import Button from 'src/components/Button';
|
||||
|
||||
@@ -35,7 +35,10 @@ describe('RunQueryActionButton', () => {
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(<RunQueryActionButton {...defaultProps} />);
|
||||
wrapper = mount(<RunQueryActionButton {...defaultProps} />, {
|
||||
wrappingComponent: ThemeProvider,
|
||||
wrappingComponentProps: { theme: supersetTheme },
|
||||
});
|
||||
});
|
||||
|
||||
it('is a valid react element', () => {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { t, styled, supersetTheme } from '@superset-ui/core';
|
||||
import { t, styled, useTheme } from '@superset-ui/core';
|
||||
|
||||
import { Menu } from 'src/components/Menu';
|
||||
import Button, { ButtonProps } from 'src/components/Button';
|
||||
@@ -93,6 +93,8 @@ const RunQueryActionButton = ({
|
||||
runQuery,
|
||||
stopQuery,
|
||||
}: Props) => {
|
||||
const theme = useTheme();
|
||||
|
||||
const shouldShowStopBtn =
|
||||
!!queryState && ['running', 'pending'].indexOf(queryState) > -1;
|
||||
|
||||
@@ -123,8 +125,8 @@ const RunQueryActionButton = ({
|
||||
<Icons.CaretDown
|
||||
iconColor={
|
||||
isDisabled
|
||||
? supersetTheme.colors.grayscale.base
|
||||
: supersetTheme.colors.grayscale.light5
|
||||
? theme.colors.grayscale.base
|
||||
: theme.colors.grayscale.light5
|
||||
}
|
||||
name="caret-down"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user