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

package.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","__","includes","Redirect","Route","jsx","_jsx","PrivateRoute","_ref","_ref$condition","condition","globalProps","authenticated","_ref$redirectRoute","redirectRoute","undefined","_ref$errorPage","errorPage","_ref$permissions","permissions","props","_objectWithoutProperties","_excluded","some","_objectSpread","status","to","pathname"],"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,OAAOA,SAAS;AAChB,SAASC,EAAE,EAAEC,QAAQ,QAAQ,OAAO;AACpC,SAASC,QAAQ,EAAEC,KAAK,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAMZ;EAAA,IAAAC,cAAA,GAAAD,IAAA,CALJE,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAGE,WAAW,CAACC,aAAa,GAAAH,cAAA;IAAAI,kBAAA,GAAAL,IAAA,CACrCM,aAAa;IAAbA,aAAa,GAAAD,kBAAA,cAAGE,SAAS,GAAAF,kBAAA;IAAAG,cAAA,GAAAR,IAAA,CACzBS,SAAS;IAAT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