Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 3f4b434

Browse files
committed
Merge branch '263-bug-csv-button-is-not-shown'
2 parents d2b3d11 + ff8d046 commit 3f4b434

File tree

2 files changed

+34
-38
lines changed

2 files changed

+34
-38
lines changed

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,36 @@
2222
"@rollup/plugin-json": "4.1.0",
2323
"@rollup/plugin-node-resolve": "13.3.0",
2424
"@rollup/plugin-typescript": "8.3.4",
25-
"@types/jest": "28.1.6",
25+
"@types/jest": "28.1.7",
2626
"@testing-library/jest-dom": "5.16.5",
2727
"@testing-library/react": "13.3.0",
28-
"@types/node": "18.6.5",
28+
"@types/node": "18.7.6",
2929
"@types/react": "18.0.17",
3030
"@types/react-dom": "18.0.6",
3131
"@types/react-color": "3.0.6",
3232
"@types/react-window": "1.8.5",
3333
"@types/react-datepicker": "4.4.2",
3434
"@types/react-csv": "1.1.3",
3535
"@types/luxon": "3.0.0",
36-
"@typescript-eslint/eslint-plugin": "5.33.0",
37-
"@typescript-eslint/parser": "5.33.0",
38-
"eslint": "8.21.0",
36+
"@typescript-eslint/eslint-plugin": "5.33.1",
37+
"@typescript-eslint/parser": "5.33.1",
38+
"eslint": "8.22.0",
3939
"jest": "28.1.3",
4040
"jest-mock-extended": "2.0.7",
4141
"obsidian": "0.15.9",
42-
"rollup": "2.77.2",
42+
"rollup": "2.78.0",
4343
"rollup-plugin-typescript2": "0.32.1",
4444
"rollup-plugin-terser": "7.0.2",
45-
"ts-jest": "28.0.7",
45+
"ts-jest": "28.0.8",
4646
"tslib": "2.4.0",
4747
"typescript": "4.7.4",
4848
"@faker-js/faker": "7.4.0"
4949
},
5050
"dependencies": {
5151
"@emotion/styled": "11.10.0",
52-
"@mui/material": "5.10.0",
52+
"@mui/material": "5.10.1",
5353
"@mui/icons-material": "5.8.4",
54-
"@popperjs/core": "2.11.5",
54+
"@popperjs/core": "2.11.6",
5555
"monkey-around": "2.3.0",
5656
"pkg.json": "2.0.8",
5757
"obsidian-dataview": "0.5.41",

src/components/NavBar.tsx

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as React from "react";
22
import CsvButton from "components/CsvButton";
3+
import MenuIcon from "components/img/MenuIcon";
34
import { NavBarProps } from "cdm/MenuBarModel";
45
import GlobalFilter from "components/reducers/GlobalFilter";
56
import { NavBarConfig, StyleVariables } from "helpers/Constants";
@@ -10,7 +11,6 @@ import Menu from "@mui/material/Menu";
1011
import MenuItem from "@mui/material/MenuItem";
1112
import Toolbar from "@mui/material/Toolbar";
1213
import { c } from "helpers/StylesHelper";
13-
import MenuIcon from "components/img/MenuIcon";
1414
import Typography from "@mui/material/Typography";
1515
import 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

Comments
 (0)