@buerokratt-ria/menu 0.1.6 → 0.1.8

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,10 @@
2
2
 
3
3
  All changes to this project will be documented in this file.
4
4
 
5
+ ## [0.1.8] - 28-04-2024
6
+
7
+ - Hide some menu items
8
+
5
9
  ## [0.1.6] - 25-04-2024
6
10
 
7
11
  - Updated api call addresses
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerokratt-ria/menu",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
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
  ]
@@ -15,6 +15,7 @@ interface MenuItem {
15
15
  path?: string;
16
16
  target?: '_blank' | '_self';
17
17
  children?: MenuItem[];
18
+ hidden?: boolean;
18
19
  }
19
20
 
20
21
  interface TranslatedLabel {
@@ -97,7 +98,7 @@ const MainNavigation: FC<{items: MenuItem[], serviceId: string[]}> = ( {items, s
97
98
  };
98
99
 
99
100
  const renderMenuTree = (menuItems: MenuItem[]) => {
100
- return menuItems.map((menuItem) => (
101
+ return menuItems.filter(x => !x.hidden).map((menuItem) => (
101
102
  <li key={menuItem.label[currentlySelectedLanguage]}>
102
103
  {!!menuItem.children ? (
103
104
  <>
Binary file