Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion superset-frontend/src/hooks/useThemeMenuItems.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ describe('useThemeMenuItems', () => {

it('displays override icon when hasLocalOverride is true', () => {
renderThemeMenu({ ...defaultProps, hasLocalOverride: true });
expect(screen.getByTestId('format-painter')).toBeInTheDocument();
expect(screen.getByTestId('thunderbolt')).toBeInTheDocument();
});

it('renders Theme group header', async () => {
Expand Down
12 changes: 6 additions & 6 deletions superset-frontend/src/hooks/useThemeMenuItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* under the License.
*/
import { useMemo } from 'react';
import { Icons } from '@superset-ui/core/components';
import { Icons, Tooltip } from '@superset-ui/core/components';
import type { MenuItem } from '@superset-ui/core/components/Menu';
import { t, ThemeMode, useTheme, ThemeAlgorithm } from '@superset-ui/core';
import { t, ThemeMode, ThemeAlgorithm } from '@superset-ui/core';

export interface ThemeSubMenuOption {
key: ThemeMode;
Expand All @@ -43,8 +43,6 @@ export const useThemeMenuItems = ({
onClearLocalSettings,
allowOSPreference = true,
}: ThemeSubMenuProps): MenuItem => {
const theme = useTheme();

const handleSelect = (mode: ThemeMode) => {
setThemeMode(mode);
};
Expand All @@ -63,11 +61,13 @@ export const useThemeMenuItems = ({
const selectedThemeModeIcon = useMemo(
() =>
hasLocalOverride ? (
<Icons.FormatPainterOutlined style={{ color: theme.colorError }} />
<Tooltip title={t('This theme is set locally')} placement="bottom">
<Icons.ThunderboltOutlined />
</Tooltip>
) : (
themeIconMap[themeMode]
),
[hasLocalOverride, theme.colorError, themeIconMap, themeMode],
[hasLocalOverride, themeIconMap, themeMode],
);

const themeOptions: MenuItem[] = [
Expand Down
Loading