Skip to content
Merged
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
25 changes: 13 additions & 12 deletions superset-frontend/src/hooks/useThemeMenuItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,14 @@ export const useThemeMenuItems = ({
: []),
];

const children: MenuItem[] = [
{
type: 'group' as const,
label: t('Theme'),
key: 'theme-group',
children: themeOptions,
},
];

// Add clear settings option only when there's a local theme active
// Add clear settings option to theme options if there's a local theme active
const themeGroupOptions = [...themeOptions];
if (onClearLocalSettings && hasLocalOverride) {
children.push({
themeGroupOptions.push({
type: 'divider' as const,
key: 'theme-divider',
});
children.push({
themeGroupOptions.push({
key: 'clear-local',
label: (
<>
Expand All @@ -130,6 +122,15 @@ export const useThemeMenuItems = ({
});
}

const children: MenuItem[] = [
{
type: 'group' as const,
label: t('Theme'),
key: 'theme-group',
children: themeGroupOptions,
},
];

return {
key: 'theme-sub-menu',
label: selectedThemeModeIcon,
Expand Down
Loading