File tree Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ import {
3333 MenuData ,
3434} from 'src/types/bootstrapTypes' ;
3535import RightMenu from './RightMenu' ;
36+ import { NAVBAR_MENU_POPUP_OFFSET } from './commonMenuData' ;
3637
3738interface MenuProps {
3839 data : MenuData ;
@@ -277,7 +278,7 @@ export function Menu({
277278 key : label ,
278279 label,
279280 icon : < Icons . DownOutlined iconSize = "xs" /> ,
280- popupOffset : [ 0 , - 8 ] ,
281+ popupOffset : NAVBAR_MENU_POPUP_OFFSET ,
281282 children : childItems ,
282283 } ;
283284 } ;
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ import {
5353 GlobalMenuDataOptions ,
5454 RightMenuProps ,
5555} from './types' ;
56+ import { NAVBAR_MENU_POPUP_OFFSET } from './commonMenuData' ;
5657
5758const extensionsRegistry = getExtensionsRegistry ( ) ;
5859
@@ -379,7 +380,7 @@ const RightMenu = ({
379380 label : menu . label ,
380381 icon : menu . icon ,
381382 children : childItems ,
382- popupOffset : [ 0 , - 8 ] ,
383+ popupOffset : NAVBAR_MENU_POPUP_OFFSET ,
383384 } ) ;
384385 } else if ( menu . url ) {
385386 if (
@@ -560,7 +561,7 @@ const RightMenu = ({
560561 className : 'submenu-with-caret' ,
561562 icon : < Icons . DownOutlined iconSize = "xs" /> ,
562563 children : buildNewDropdownItems ( ) ,
563- popupOffset : [ 0 , - 8 ] ,
564+ popupOffset : NAVBAR_MENU_POPUP_OFFSET ,
564565 } ) ;
565566 }
566567
@@ -578,7 +579,7 @@ const RightMenu = ({
578579 icon : < Icons . DownOutlined iconSize = "xs" /> ,
579580 children : buildSettingsMenuItems ( ) ,
580581 className : 'submenu-with-caret' ,
581- popupOffset : [ 0 , - 8 ] ,
582+ popupOffset : NAVBAR_MENU_POPUP_OFFSET ,
582583 } ) ;
583584
584585 return items ;
Original file line number Diff line number Diff line change 1818 */
1919import { t } from '@superset-ui/core' ;
2020
21+ /**
22+ * Shared popup offset configuration for navbar menu dropdowns.
23+ */
24+ export const NAVBAR_MENU_POPUP_OFFSET : [ number , number ] = [ 0 , - 8 ] ;
25+
2126export const commonMenuData = {
2227 name : t ( 'SQL' ) ,
2328 tabs : [
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import { Icons, Tooltip } from '@superset-ui/core/components';
2121import type { MenuItem } from '@superset-ui/core/components/Menu' ;
2222import { t } from '@superset-ui/core' ;
2323import { ThemeMode , ThemeAlgorithm } from '@apache-superset/core/ui' ;
24+ import { NAVBAR_MENU_POPUP_OFFSET } from 'src/features/home/commonMenuData' ;
2425
2526export interface ThemeSubMenuOption {
2627 key : ThemeMode ;
@@ -138,6 +139,6 @@ export const useThemeMenuItems = ({
138139 icon : < Icons . DownOutlined iconSize = "xs" /> ,
139140 className : 'submenu-with-caret' ,
140141 children,
141- popupOffset : [ 0 , - 8 ] ,
142+ popupOffset : NAVBAR_MENU_POPUP_OFFSET ,
142143 } ;
143144} ;
You can’t perform that action at this time.
0 commit comments