11import * as React from "react" ;
22import CsvButton from "components/CsvButton" ;
3+ import MenuIcon from "components/img/MenuIcon" ;
34import { NavBarProps } from "cdm/MenuBarModel" ;
45import GlobalFilter from "components/reducers/GlobalFilter" ;
56import { NavBarConfig , StyleVariables } from "helpers/Constants" ;
@@ -10,7 +11,6 @@ import Menu from "@mui/material/Menu";
1011import MenuItem from "@mui/material/MenuItem" ;
1112import Toolbar from "@mui/material/Toolbar" ;
1213import { c } from "helpers/StylesHelper" ;
13- import MenuIcon from "components/img/MenuIcon" ;
1414import Typography from "@mui/material/Typography" ;
1515import DataviewFilters from "./reducers/DataviewFilters" ;
1616
@@ -20,6 +20,7 @@ export function NavBar(navBarProps: NavBarProps) {
2020 const columns = tableState . columns ( ( state ) => state . columns ) ;
2121 const [ anchorEl , setAnchorEl ] = React . useState < null | HTMLElement > ( null ) ;
2222 const open = Boolean ( anchorEl ) ;
23+ console . log ( `NavBar menu is open? => ${ open } ` ) ;
2324 const handleMenuClose = ( ) => {
2425 setAnchorEl ( null ) ;
2526 } ;
@@ -28,33 +29,6 @@ export function NavBar(navBarProps: NavBarProps) {
2829 setAnchorEl ( event . currentTarget ) ;
2930 } ;
3031
31- const renderMenu = (
32- < Menu
33- anchorEl = { anchorEl }
34- open = { open }
35- onClose = { handleMenuClose }
36- onClick = { handleMenuClose }
37- onBlur = { handleMenuClose }
38- PaperProps = { {
39- style : {
40- maxHeight : NavBarConfig . ITEM_HEIGHT * 4.5 ,
41- width : "20ch" ,
42- } ,
43- } }
44- MenuListProps = { {
45- "aria-labelledby" : "long-button" ,
46- } }
47- >
48- < MenuItem >
49- { /* CSV buttton download */ }
50- < CsvButton
51- columns = { columns }
52- rows = { table . getRowModel ( ) . rows }
53- name = { view . diskConfig . yaml . name }
54- />
55- </ MenuItem >
56- </ Menu >
57- ) ;
5832 return (
5933 < Box sx = { { flexGrow : 1 } } >
6034 < AppBar
@@ -80,7 +54,29 @@ export function NavBar(navBarProps: NavBarProps) {
8054 >
8155 < MenuIcon />
8256 </ IconButton >
83- { renderMenu }
57+ < Menu
58+ anchorEl = { anchorEl }
59+ open = { open }
60+ onClose = { handleMenuClose }
61+ PaperProps = { {
62+ style : {
63+ maxHeight : NavBarConfig . ITEM_HEIGHT * 4.5 ,
64+ width : "20ch" ,
65+ } ,
66+ } }
67+ MenuListProps = { {
68+ "aria-labelledby" : "long-button" ,
69+ } }
70+ >
71+ < MenuItem >
72+ { /* CSV buttton download */ }
73+ < CsvButton
74+ columns = { columns }
75+ rows = { table . getRowModel ( ) . rows }
76+ name = { view . diskConfig . yaml . name }
77+ />
78+ </ MenuItem >
79+ </ Menu >
8480 < Typography
8581 variant = "h6"
8682 noWrap
0 commit comments