@buerokratt-ria/menu 0.1.12 → 0.1.14
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
|
Binary file
|
package/package.json
CHANGED
|
@@ -30,7 +30,20 @@ const useMenuItems = () => {
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
const items = useMemo(() => {
|
|
33
|
-
|
|
33
|
+
let externals;
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
if(externalMenuItems) {
|
|
37
|
+
externals = JSON.parse(externalMenuItems);
|
|
38
|
+
if(!Array.isArray(externals)) {
|
|
39
|
+
console.warn('REACT_APP_MENU_JSON was ignored becuase it wasn\'t an array');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
} catch (e) {
|
|
43
|
+
console.warn(e);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const allItems = externals ?? mainMenuItems ?? menuStructure ?? [];
|
|
34
47
|
return allItems.filter(x => !x.hidden);
|
|
35
48
|
}, [externalMenuItems, mainMenuItems, menuStructure]);
|
|
36
49
|
|
|
Binary file
|