@campxdev/shared 0.5.7 → 0.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "0.5.7",
3
+ "version": "0.5.9",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -52,7 +52,7 @@ const RenderMenuItem = ({menuItem}) => {
52
52
  const permissions = PermissionsStore.useState((s) => s).permissions
53
53
  const hasAccess = permissionKey ? permissions[permissionKey] : accessIfNoKey
54
54
 
55
- if (!hasAccess) return null
55
+ if (!hasAccess && !children?.length) return null
56
56
  if (children?.length)
57
57
  return (
58
58
  <Box
@@ -101,9 +101,7 @@ const DropDownMenu = ({path, title, icon, menuItems, permissionKey}) => {
101
101
  return arr.includes(true)
102
102
  }
103
103
 
104
- const dropdownAccess = validateDropdownAccess()
105
-
106
- if (!dropdownAccess) return null
104
+ if (!validateDropdownAccess()) return null
107
105
  return (
108
106
  <>
109
107
  <Box