All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.cjs.react-utils.PrivateRoute.PrivateRoute.js.map Maven / Gradle / Ivy

Go to download

A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.

There is a newer version: 4.12.3
Show newest version
{"version":3,"file":"PrivateRoute.js","names":["_ErrorPage","_interopRequireDefault","require","_ramda","_reactRouterDom","_jsxRuntime","_excluded","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","PrivateRoute","_ref","_ref$condition","condition","globalProps","authenticated","_ref$redirectRoute","redirectRoute","undefined","_ref$errorPage","errorPage","_ref$permissions","permissions","props","_objectWithoutProperties2","some","includes","__","jsx","Route","status","Redirect","to","pathname","_default","exports"],"sources":["../../../../src/react-utils/PrivateRoute/PrivateRoute.jsx"],"sourcesContent":["import ErrorPage from \"neetomolecules/ErrorPage\";\nimport { __, includes } from \"ramda\";\nimport { Redirect, Route } from \"react-router-dom\";\n\nconst PrivateRoute = ({\n  condition = globalProps.authenticated,\n  redirectRoute = undefined,\n  errorPage = undefined,\n  permissions = undefined,\n  ...props\n}) => {\n  if (condition) {\n    if (permissions) {\n      return globalProps.permissions.some(includes(__, permissions)) ? (\n        \n      ) : (\n        errorPage || \n      );\n    }\n\n    return ;\n  }\n\n  if (redirectRoute) {\n    return ;\n  }\n\n  return errorPage || ;\n};\n\nexport default PrivateRoute;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAAmD,IAAAG,WAAA,GAAAH,OAAA;AAAA,IAAAI,SAAA;AAAA,SAAAC,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAA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