09cae19595295fa031873ddcd452e531.json 5.9 KB
Newer Older
1
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\navbar\\\\Navbar.jsx\",\n    _s = $RefreshSig$();\n\nimport React from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./Navbar.css\";\nimport Logo from './logo/Logo';\nimport NavLinks from './navigationLinks/NavLinks';\nimport Searchbar from './searchbar/Searchbar';\nimport NavbarDropdownMenu from './dropdownMenu/NavbarDropdownMenu';\nimport LoginButton from './loginButton/LoginButton';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst Navbar = () => {\n  _s();\n\n  const {\n    authState,\n    oktaAuth\n  } = useOktaAuth();\n\n  const login = () => oktaAuth.signInWithRedirect({\n    originalUri: '/home'\n  });\n\n  if (!authState) {\n    return null;\n  }\n\n  return /*#__PURE__*/_jsxDEV(\"div\", {\n    className: \"navbar\",\n    children: /*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"header-content\",\n      children: [/*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"title-navigation-links-container\",\n        children: [/*#__PURE__*/_jsxDEV(Logo, {}, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 22,\n          columnNumber: 11\n        }, this), authState.isAuthenticated && /*#__PURE__*/_jsxDEV(NavLinks, {}, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 24,\n          columnNumber: 13\n        }, this)]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 21,\n        columnNumber: 9\n      }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"searchbar-profile-container\",\n        children: [authState.isAuthenticated && /*#__PURE__*/_jsxDEV(\"ul\", {\n          className: \"right-unstyled-navbar\",\n          children: [/*#__PURE__*/_jsxDEV(Searchbar, {}, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 30,\n            columnNumber: 15\n          }, this), /*#__PURE__*/_jsxDEV(NavbarDropdownMenu, {}, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 31,\n            columnNumber: 15\n          }, this)]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 29,\n          columnNumber: 13\n        }, this), !authState.isPending && !authState.isAuthenticated && /*#__PURE__*/_jsxDEV(LoginButton, {\n          login: login\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 35,\n          columnNumber: 13\n        }, this)]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 27,\n        columnNumber: 9\n      }, this)]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 20,\n      columnNumber: 7\n    }, this)\n  }, void 0, false, {\n    fileName: _jsxFileName,\n    lineNumber: 19,\n    columnNumber: 5\n  }, this);\n};\n\n_s(Navbar, \"XFnfjrqktn2GIu+f3Siekv/ekaU=\", false, function () {\n  return [useOktaAuth];\n});\n\n_c = Navbar;\nexport default Navbar;\n\nvar _c;\n\n$RefreshReg$(_c, \"Navbar\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/navbar/Navbar.jsx"],"names":["React","useOktaAuth","Logo","NavLinks","Searchbar","NavbarDropdownMenu","LoginButton","Navbar","authState","oktaAuth","login","signInWithRedirect","originalUri","isAuthenticated","isPending"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,cAAP;AACA,OAAOC,IAAP,MAAiB,aAAjB;AACA,OAAOC,QAAP,MAAqB,4BAArB;AACA,OAAOC,SAAP,MAAsB,uBAAtB;AACA,OAAOC,kBAAP,MAA+B,mCAA/B;AACA,OAAOC,WAAP,MAAwB,2BAAxB;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BR,WAAW,EAA3C;;AACA,QAAMS,KAAK,GAAG,MAAMD,QAAQ,CAACE,kBAAT,CAA4B;AAAEC,IAAAA,WAAW,EAAE;AAAf,GAA5B,CAApB;;AAEA,MAAI,CAACJ,SAAL,EAAgB;AACd,WAAO,IAAP;AACD;;AAED,sBACE;AAAK,IAAA,SAAS,EAAC,QAAf;AAAA,2BACE;AAAK,MAAA,SAAS,EAAC,gBAAf;AAAA,8BACE;AAAK,QAAA,SAAS,EAAC,kCAAf;AAAA,gCACE,QAAC,IAAD;AAAA;AAAA;AAAA;AAAA,gBADF,EAEGA,SAAS,CAACK,eAAV,iBACC,QAAC,QAAD;AAAA;AAAA;AAAA;AAAA,gBAHJ;AAAA;AAAA;AAAA;AAAA;AAAA,cADF,eAOE;AAAK,QAAA,SAAS,EAAC,6BAAf;AAAA,mBACGL,SAAS,CAACK,eAAV,iBACC;AAAI,UAAA,SAAS,EAAC,uBAAd;AAAA,kCACE,QAAC,SAAD;AAAA;AAAA;AAAA;AAAA,kBADF,eAEE,QAAC,kBAAD;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAFJ,EAOG,CAACL,SAAS,CAACM,SAAX,IAAwB,CAACN,SAAS,CAACK,eAAnC,iBACC,QAAC,WAAD;AAAa,UAAA,KAAK,EAAEH;AAApB;AAAA;AAAA;AAAA;AAAA,gBARJ;AAAA;AAAA;AAAA;AAAA;AAAA,cAPF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAuBD,CA/BD;;GAAMH,M;UAC4BN,W;;;KAD5BM,M;AAiCN,eAAeA,MAAf","sourcesContent":["import React from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./Navbar.css\"\r\nimport Logo from './logo/Logo'\r\nimport NavLinks from './navigationLinks/NavLinks'\r\nimport Searchbar from './searchbar/Searchbar'\r\nimport NavbarDropdownMenu from './dropdownMenu/NavbarDropdownMenu'\r\nimport LoginButton from './loginButton/LoginButton';\r\n\r\nconst Navbar = () => {\r\n  const { authState, oktaAuth } = useOktaAuth();\r\n  const login = () => oktaAuth.signInWithRedirect({ originalUri: '/home' })\r\n\r\n  if (!authState) {\r\n    return null;\r\n  }\r\n\r\n  return (\r\n    <div className=\"navbar\" >\r\n      <div className=\"header-content\">\r\n        <div className=\"title-navigation-links-container\">\r\n          <Logo />\r\n          {authState.isAuthenticated && (\r\n            <NavLinks />\r\n          )}\r\n        </div>\r\n        <div className=\"searchbar-profile-container\">\r\n          {authState.isAuthenticated && (\r\n            <ul className=\"right-unstyled-navbar\">\r\n              <Searchbar />\r\n              <NavbarDropdownMenu />\r\n            </ul>\r\n          )}\r\n          {!authState.isPending && !authState.isAuthenticated && (\r\n            <LoginButton login={login} />\r\n          )}\r\n        </div>\r\n      </div>\r\n    </div >\r\n  )\r\n}\r\n\r\nexport default Navbar"]},"metadata":{},"sourceType":"module"}