@bigbinary/neeto-molecules 1.0.47 → 1.0.48

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/dist/Sidebar.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { useRef, useCallback, useEffect, Children, isValidElement, cloneElement, forwardRef, useState } from 'react';
2
- import { toLower, mergeDeepLeft, curry, not } from 'ramda';
2
+ import { toLower, mergeDeepLeft, curry, is, includes, __, not } from 'ramda';
3
3
  import { Link, useLocation, NavLink } from 'react-router-dom';
4
4
  import { NeetoIcon, Close, Search, AppSwitcher as AppSwitcher$1, ChatEmpty, Book, Gift, Keyboard, User, Settings, LeftArrow, Help } from '@bigbinary/neeto-icons';
5
5
  import { Typography, Button, Input, Tooltip, Avatar } from '@bigbinary/neetoui';
@@ -32076,13 +32076,16 @@ var _excluded = ["label", "to", "icon", "description"];
32076
32076
  var Links = function Links(_ref) {
32077
32077
  var navLinks = _ref.navLinks;
32078
32078
  var location = useLocation();
32079
- var filterByPermission = curry(function (_ref2) {
32080
- var permission = _ref2.permission;
32081
- return permission ? globalProps$1.permissions.includes(permission) : true;
32079
+ var filterByPermissions = curry(function (_ref2) {
32080
+ var permissions = _ref2.permissions;
32081
+ if (permissions) {
32082
+ return is(Array, permissions) ? permissions.some(includes(__, globalProps$1.permissions)) : globalProps$1.permissions.includes(permissions);
32083
+ }
32084
+ return true;
32082
32085
  });
32083
32086
  return /*#__PURE__*/React.createElement("div", {
32084
32087
  className: "neeto-molecules-sidebar__links"
32085
- }, navLinks.filter(filterByPermission).map(function (_ref3, mainIndex) {
32088
+ }, navLinks.filter(filterByPermissions).map(function (_ref3, mainIndex) {
32086
32089
  var label = _ref3.label,
32087
32090
  to = _ref3.to,
32088
32091
  icon = _ref3.icon,