@buerokratt-ria/menu 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All changes to this project will be documented in this file.
4
4
 
5
+ ## [0.1.9] - 28-04-2024
6
+
7
+ - Merge previous code
8
+
9
+ ## [0.1.8] - 28-04-2024
10
+
11
+ - Hide some menu items
12
+
5
13
  ## [0.1.7] - 27-05-2024
6
14
 
7
15
  - Fix close menu button
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerokratt-ria/menu",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Generic MainNavigation component that would be injected as dependency.",
5
5
  "main": "index.js",
6
6
  "scripts": {},
@@ -346,5 +346,14 @@
346
346
  "path": "/uptime"
347
347
  }
348
348
  ]
349
+ },
350
+ {
351
+ "id":"hidden-item",
352
+ "label": {
353
+ "et": "Peidetud",
354
+ "en": "Hidden"
355
+ },
356
+ "path": "/hidden",
357
+ "hidden": true
349
358
  }
350
359
  ]
@@ -24,6 +24,7 @@ interface MenuItem {
24
24
  path?: string;
25
25
  target?: '_blank' | '_self';
26
26
  children?: MenuItem[];
27
+ hidden?: boolean;
27
28
  }
28
29
 
29
30
  interface TranslatedLabel {
@@ -105,7 +106,7 @@ const MainNavigation: FC<{items: MenuItem[], serviceId: string[]}> = ( {items, s
105
106
  };
106
107
 
107
108
  const renderMenuTree = (menuItems: MenuItem[]) => {
108
- return menuItems.map((menuItem) => (
109
+ return menuItems.filter(x => !x.hidden).map((menuItem) => (
109
110
  <li key={menuItem.label[currentlySelectedLanguage]}>
110
111
  {!!menuItem.children ? (
111
112
  <>
Binary file