@campxdev/shared 0.5.6 → 0.5.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/package.json +1 -1
- package/src/components/SideNav.tsx +16 -19
package/package.json
CHANGED
|
@@ -15,7 +15,8 @@ import {
|
|
|
15
15
|
StyledChevronIcon,
|
|
16
16
|
StyledListItemButton,
|
|
17
17
|
} from './ListItemButton'
|
|
18
|
-
const accessIfNoKey = process.env.NODE_ENV === 'development' ?
|
|
18
|
+
const accessIfNoKey = process.env.NODE_ENV === 'development' ? false : false
|
|
19
|
+
|
|
19
20
|
const StyledLink = styled(Link)({
|
|
20
21
|
textDecoration: 'none',
|
|
21
22
|
})
|
|
@@ -85,28 +86,24 @@ const DropDownMenu = ({path, title, icon, menuItems, permissionKey}) => {
|
|
|
85
86
|
const [open, setOpen] = useState(false)
|
|
86
87
|
const permissions = PermissionsStore.useState((s) => s).permissions
|
|
87
88
|
|
|
88
|
-
const validateDropdownAccess = () => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
for (let i = 0; i < menuItems.length; i++) {
|
|
93
|
-
if (permissions[menuItems[i].permissionKey]) {
|
|
94
|
-
arr.push(true)
|
|
95
|
-
} else {
|
|
96
|
-
arr.push(accessIfNoKey)
|
|
97
|
-
}
|
|
98
|
-
}
|
|
89
|
+
// const validateDropdownAccess = () => {
|
|
90
|
+
// if (accessIfNoKey && !permissions) return true
|
|
91
|
+
// let arr = []
|
|
99
92
|
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
// for (let i = 0; i < menuItems.length; i++) {
|
|
94
|
+
// if (permissions[menuItems[i].permissionKey]) {
|
|
95
|
+
// arr.push(true)
|
|
96
|
+
// } else {
|
|
97
|
+
// arr.push(accessIfNoKey)
|
|
98
|
+
// }
|
|
99
|
+
// }
|
|
102
100
|
|
|
103
|
-
|
|
101
|
+
// return arr.includes(true)
|
|
102
|
+
// }
|
|
104
103
|
|
|
105
|
-
const dropdownAccess =
|
|
106
|
-
? validateDropdownAccess()
|
|
107
|
-
: hasAccess
|
|
104
|
+
// const dropdownAccess = validateDropdownAccess()
|
|
108
105
|
|
|
109
|
-
if (!dropdownAccess) return null
|
|
106
|
+
// if (!dropdownAccess) return null
|
|
110
107
|
return (
|
|
111
108
|
<>
|
|
112
109
|
<Box
|