Commit e4f09cae authored by Mathias Engelbrecht Pilegård's avatar Mathias Engelbrecht Pilegård
Browse files

added redirect to home when oktaAuth detects user as already logged in

parent 47e062ec
This diff is collapsed.
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\App.jsx\",\n _s = $RefreshSig$();\n\nimport React from \"react\";\nimport { Route, Switch, useHistory } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport { library } from '@fortawesome/fontawesome-svg-core';\nimport { fas } from '@fortawesome/free-solid-svg-icons';\nimport { OktaAuth, toRelativeUrl } from '@okta/okta-auth-js';\nimport { Security, SecureRoute, LoginCallback } from \"@okta/okta-react\";\nimport \"./style.css\";\nimport config from \"./config\"; //Components\n\nimport Login from \"./pages/login/Login\";\nimport Navbar from \"./components/navbar/Navbar\";\nimport Home from \"./pages/home/Home\";\nimport ReportForm from \"./pages/reportForm/ReportForm\";\nimport ProjectOverview from \"./pages/project/projectOverview/ProjectOverview\";\nimport ProjectInfo from \"./pages/project/projectInfo/ProjectInfo\";\nimport TeamOverview from \"./pages/team/teamOverview/TeamOverview\";\nimport TeamInfo from \"./pages/team/teamInfo/TeamInfo\";\nimport Messages from \"./pages/Messages/Messages\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nlibrary.add(fas);\nconst oktaAuth = new OktaAuth(config.oidc);\nconst CALLBACK_PATH = '/login/callback';\n\nconst App = () => {\n _s();\n\n const history = useHistory();\n const {\n authState\n } = oktaAuth.isAuthenticated;\n\n const restoreOriginalUri = async (_oktaAuth, originalUri) => {\n history.replace(toRelativeUrl(originalUri || '/', window.location.origin));\n };\n\n return /*#__PURE__*/_jsxDEV(Security, {\n oktaAuth: oktaAuth,\n restoreOriginalUri: restoreOriginalUri,\n children: [/*#__PURE__*/_jsxDEV(Navbar, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 36,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(Switch, {\n children: [/*#__PURE__*/_jsxDEV(Route, {\n exact: true,\n path: \"/\",\n component: Login\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(Route, {\n path: CALLBACK_PATH,\n component: LoginCallback\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 39,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/home\",\n component: Home\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 40,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/reportissue\",\n component: ReportForm\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/projects\",\n component: ProjectOverview\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/ReactApp\",\n component: ProjectInfo\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/teams\",\n component: TeamOverview\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/HenriksMemeMachine\",\n component: TeamInfo\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/messages\",\n component: Messages\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 37,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 5\n }, this);\n};\n\n_s(App, \"9cZfZ04734qoCGIctmKX7+sX6eU=\", false, function () {\n return [useHistory];\n});\n\n_c = App;\nexport default App;\n\nvar _c;\n\n$RefreshReg$(_c, \"App\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/App.jsx"],"names":["React","Route","Switch","useHistory","useOktaAuth","library","fas","OktaAuth","toRelativeUrl","Security","SecureRoute","LoginCallback","config","Login","Navbar","Home","ReportForm","ProjectOverview","ProjectInfo","TeamOverview","TeamInfo","Messages","add","oktaAuth","oidc","CALLBACK_PATH","App","history","authState","isAuthenticated","restoreOriginalUri","_oktaAuth","originalUri","replace","window","location","origin"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,KAAT,EAAgBC,MAAhB,EAAwBC,UAAxB,QAA0C,kBAA1C;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,SAASC,OAAT,QAAwB,mCAAxB;AACA,SAASC,GAAT,QAAoB,mCAApB;AACA,SAASC,QAAT,EAAmBC,aAAnB,QAAwC,oBAAxC;AACA,SAASC,QAAT,EAAmBC,WAAnB,EAAgCC,aAAhC,QAAqD,kBAArD;AACA,OAAO,aAAP;AACA,OAAOC,MAAP,MAAmB,UAAnB,C,CAEA;;AACA,OAAOC,KAAP,MAAkB,qBAAlB;AACA,OAAOC,MAAP,MAAmB,4BAAnB;AACA,OAAOC,IAAP,MAAiB,mBAAjB;AACA,OAAOC,UAAP,MAAuB,+BAAvB;AACA,OAAOC,eAAP,MAA4B,iDAA5B;AACA,OAAOC,WAAP,MAAwB,yCAAxB;AACA,OAAOC,YAAP,MAAyB,wCAAzB;AACA,OAAOC,QAAP,MAAqB,gCAArB;AACA,OAAOC,QAAP,MAAqB,2BAArB;;AAEAhB,OAAO,CAACiB,GAAR,CAAYhB,GAAZ;AAEA,MAAMiB,QAAQ,GAAG,IAAIhB,QAAJ,CAAaK,MAAM,CAACY,IAApB,CAAjB;AACA,MAAMC,aAAa,GA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AC,WAAD;AAAa,QAAA,IAAI,EAAC,QAAlB;AAA2B,QAAA,SAAS,EAAEC;AAAtC;AAAA;AAAA;AAAA;AAAA,cAPF,eAQE,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,qBAAlB;AAAwC,QAAA,SAAS,EAAEC;AAAnD;AAAA;AAAA;AAAA;AAAA,cARF,eASE,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,WAAlB;AAA8B,QAAA,SAAS,EAAEC;AAAzC;AAAA;AAAA;AAAA;AAAA,cATF;AAAA;AAAA;AAAA;AAAA;AAAA,YAFF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAgBD,CAvBD;;GAAMK,G;UACYvB,U;;;KADZuB,G;AAyBN,eAAeA,GAAf","sourcesContent":["import React from \"react\"\r\nimport { Route, Switch, useHistory } from \"react-router-dom\"\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport { library } from '@fortawesome/fontawesome-svg-core'\r\nimport { fas } from '@fortawesome/free-solid-svg-icons'\r\nimport { OktaAuth, toRelativeUrl } from '@okta/okta-auth-js';\r\nimport { Security, SecureRoute, LoginCallback } from \"@okta/okta-react\"\r\nimport \"./style.css\"\r\nimport config from \"./config\"\r\n\r\n//Components\r\nimport Login from \"./pages/login/Login\"\r\nimport Navbar from \"./components/navbar/Navbar\"\r\nimport Home from \"./pages/home/Home\"\r\nimport ReportForm from \"./pages/reportForm/ReportForm\"\r\nimport ProjectOverview from \"./pages/project/projectOverview/ProjectOverview\"\r\nimport ProjectInfo from \"./pages/project/projectInfo/ProjectInfo\"\r\nimport TeamOverview from \"./pages/team/teamOverview/TeamOverview\"\r\nimport TeamInfo from \"./pages/team/teamInfo/TeamInfo\"\r\nimport Messages from \"./pages/Messages/Messages\"\r\n\r\nlibrary.add(fas)\r\n\r\nconst oktaAuth = new OktaAuth(config.oidc);\r\nconst CALLBACK_PATH = '/login/callback';\r\n\r\nconst App = () => {\r\n const history = useHistory()\r\n const { authState } = oktaAuth.isAuthenticated\r\n const restoreOriginalUri = async (_oktaAuth, originalUri) => {\r\n history.replace(toRelativeUrl(originalUri || '/', window.location.origin))\r\n }\r\n\r\n return (\r\n <Security oktaAuth={oktaAuth} restoreOriginalUri={restoreOriginalUri}>\r\n <Navbar />\r\n <Switch>\r\n <Route exact path=\"/\" component={Login} />\r\n <Route path={CALLBACK_PATH} component={LoginCallback} />\r\n <SecureRoute path=\"/home\" component={Home} />\r\n <SecureRoute path=\"/reportissue\" component={ReportForm} />\r\n <SecureRoute path=\"/projects\" component={ProjectOverview} />\r\n <SecureRoute path=\"/ReactApp\" component={ProjectInfo} />\r\n <SecureRoute path=\"/teams\" component={TeamOverview} />\r\n <SecureRoute path=\"/HenriksMemeMachine\" component={TeamInfo} />\r\n <SecureRoute path=\"/messages\" component={Messages} />\r\n </Switch>\r\n </Security>\r\n )\r\n}\r\n\r\nexport default App"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\navbar\\\\dropdownMenu\\\\NavbarDropdownMenu.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useRef, useState, useEffect } from 'react';\nimport { NavLink } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./NavbarDropdownMenu.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst DropdownMenu = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const dropdownRef = useRef(null);\n const [isActive, setIsActive] = useState(false);\n\n const onClick = () => setIsActive(!isActive);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\n setIsActive(!isActive);\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (isActive) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [isActive]);\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const logout = () => {\n oktaAuth.signOut();\n };\n\n return /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"navbar-user-dropdown-container\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: `user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`,\n onClick: onClick,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"user-icon\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"down-arrow\",\n icon: \"angle-down\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n ref: dropdownRef,\n className: `user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`,\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"menu-item\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"item-text-top\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"upper-row\",\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n className: \"menu-item-link\",\n children: \"Account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"bottom-row\",\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n className: \"menu-item-link-bottom\",\n children: userInfo ? userInfo.email : \"...\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 69,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"item-icon\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"menu-item\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"item-text-top\",\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n className: \"menu-item-link\",\n children: \"Messages\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 82,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"item-icon\",\n icon: \"envelope\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 81,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 80,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 102,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 5\n }, this);\n};\n\n_s(DropdownMenu, \"fSJPYre4v1rGcIZdck7wMJJU1dU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = DropdownMenu;\nexport default DropdownMenu;\n\nvar _c;\n\n$RefreshReg$(_c, \"DropdownMenu\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/navbar/dropdownMenu/NavbarDropdownMenu.jsx"],"names":["React","useRef","useState","useEffect","NavLink","useOktaAuth","FontAwesomeIcon","DropdownMenu","authState","oktaAuth","userInfo","setUserInfo","dropdownRef","isActive","setIsActive","onClick","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","isAuthenticated","getUser","then","info","logout","signOut","email"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,MAAhB,EAAwBC,QAAxB,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,0BAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAGA,MAAMC,YAAY,GAAG,MAAM;AAAA;;AACzB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb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;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,sBAbF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBAFF,eAsBE;AAAA,mCACE;AAAK,cAAA,SAAS,EAAC,WAAf;AAAA,sCACE;AAAK,gBAAA,SAAS,EAAC,eAAf;AAAA,uCACE,QAAC,OAAD;AAAS,kBAAA,EAAE,EAAC,UAAZ;AAAuB,kBAAA,SAAS,EAAC,gBAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,sBADF,eAME;AAAA,uCACE,QAAC,eAAD;AAAiB,kBAAA,SAAS,EAAC,WAA3B;AAAuC,kBAAA,IAAI,EAAC;AAA5C;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,sBANF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBAtBF,eA4CE;AAAA;AAAA;AAAA;AAAA,kBA5CF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cANF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AA+DD,CAxGD;;GAAMvB,Y;UAC4BF,W;;;KAD5BE,Y;AA0GN,eAAeA,YAAf","sourcesContent":["import React, { useRef, useState, useEffect } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./NavbarDropdownMenu.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\n\r\nconst DropdownMenu = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [isActive]);\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const logout = () => {\r\n oktaAuth.signOut()\r\n }\r\n\r\n return (\r\n <li>\r\n <div className=\"navbar-user-dropdown-container\">\r\n <button className={`user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"user-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n {/* show submenu?*/}\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n\r\n <li>\r\n <div className=\"menu-item\">\r\n <div className=\"item-text-top\">\r\n <div className=\"upper-row\">\r\n <NavLink to=\"/account\" className=\"menu-item-link\">\r\n Account\r\n </NavLink>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <NavLink to=\"/account\" className=\"menu-item-link-bottom\">\r\n {userInfo ? userInfo.email : \"...\"}\r\n </NavLink>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"item-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </li>\r\n\r\n <li>\r\n <div className=\"menu-item\">\r\n <div className=\"item-text-top\">\r\n <NavLink to=\"/account\" className=\"menu-item-link\">\r\n Messages\r\n </NavLink>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"item-icon\" icon=\"envelope\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n {/* <NavLink to=\"/messages\">\r\n \r\n </NavLink> */}\r\n </li>\r\n\r\n {/* <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"sliders-h\"></FontAwesomeIcon>&nbsp;&nbsp;Preferences\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"item-icon-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li> */}\r\n <li>\r\n {/* <a onClick={logout}>\r\n <FontAwesomeIcon icon=\"sign-out-alt\"></FontAwesomeIcon>&nbsp;&nbsp;Log out\r\n </a> */}\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </li >\r\n )\r\n}\r\n\r\nexport default DropdownMenu"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\navbar\\\\dropdownMenu\\\\NavbarDropdownMenu.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useRef, useState, useEffect } from 'react';\nimport { NavLink } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./NavbarDropdownMenu.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst DropdownMenu = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const dropdownRef = useRef(null);\n const [isActive, setIsActive] = useState(false);\n\n const onClick = () => setIsActive(!isActive);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\n setIsActive(!isActive);\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (isActive) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [isActive]);\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const logout = () => {\n oktaAuth.signOut();\n };\n\n return /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"navbar-user-dropdown-container\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: `user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`,\n onClick: onClick,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"user-icon\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"down-arrow\",\n icon: \"angle-down\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n ref: dropdownRef,\n className: `user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`,\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n onClick: onClick,\n className: \"top-item\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 17\n }, this), \"\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(\"span\", {\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"p\", {\n children: userInfo ? userInfo.email : \"...\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/messages\",\n onClick: onClick,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"envelope\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Messages\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 69,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: logout,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-out-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Log out\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 82,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 81,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 5\n }, this);\n};\n\n_s(DropdownMenu, \"fSJPYre4v1rGcIZdck7wMJJU1dU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = DropdownMenu;\nexport default DropdownMenu;\n\nvar _c;\n\n$RefreshReg$(_c, \"DropdownMenu\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/navbar/dropdownMenu/NavbarDropdownMenu.jsx"],"names":["React","useRef","useState","useEffect","NavLink","useOktaAuth","FontAwesomeIcon","DropdownMenu","authState","oktaAuth","userInfo","setUserInfo","dropdownRef","isActive","setIsActive","onClick","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","isAuthenticated","getUser","then","info","logout","signOut","email"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,MAAhB,EAAwBC,QAAxB,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,0BAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAGA,MAAMC,YAAY,GAAG,MAAM;AAAA;;AACzB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BJ,WAAW,EAA3C;AACA,QAAM,CAACK,QAAD,EAAWC,WAAX,IAA0BT,QAAQ,CAAC,IAAD,CAAxC;AAEA,QAAMU,WAAW,GAAGX,MAAM,CAAC,IAAD,CAA1B;AACA,QAAM,CAACY,QAAD,EAAWC,WAAX,IAA0BZ,QAAQ,CAAC,KAAD,CAAxC;;AACA,QAAMa,O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AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBAXF,eAuBE;AAAA,mCACE;AAAG,cAAA,OAAO,EAAEa,MAAZ;AAAA,sCACE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBAvBF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cANF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AA0CD,CAnFD;;GAAMrB,Y;UAC4BF,W;;;KAD5BE,Y;AAqFN,eAAeA,YAAf","sourcesContent":["import React, { useRef, useState, useEffect } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./NavbarDropdownMenu.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\n\r\nconst DropdownMenu = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [isActive]);\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const logout = () => {\r\n oktaAuth.signOut()\r\n }\r\n\r\n return (\r\n <li>\r\n <div className=\"navbar-user-dropdown-container\">\r\n <button className={`user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"user-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n {/* show submenu?*/}\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <NavLink to=\"/account\" onClick={onClick} className=\"top-item\">\r\n <FontAwesomeIcon icon=\"user\"></FontAwesomeIcon>&nbsp;&nbsp;\r\n <span>\r\n <p>Account</p>\r\n <p>{userInfo ? userInfo.email : \"...\"}</p>\r\n </span>\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </NavLink>\r\n </li>\r\n <li>\r\n <NavLink to=\"/messages\" onClick={onClick}>\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>&nbsp;&nbsp;Messages\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </NavLink>\r\n </li>\r\n {/* <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"sliders-h\"></FontAwesomeIcon>&nbsp;&nbsp;Preferences\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li> */}\r\n <li>\r\n <a onClick={logout}>\r\n <FontAwesomeIcon icon=\"sign-out-alt\"></FontAwesomeIcon>&nbsp;&nbsp;Log out\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </li >\r\n )\r\n}\r\n\r\nexport default DropdownMenu"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\App.jsx\",\n _s = $RefreshSig$();\n\nimport React from \"react\";\nimport { Route, Switch, useHistory } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport { library } from '@fortawesome/fontawesome-svg-core';\nimport { fas } from '@fortawesome/free-solid-svg-icons';\nimport { OktaAuth, toRelativeUrl } from '@okta/okta-auth-js';\nimport { Security, SecureRoute, LoginCallback } from \"@okta/okta-react\";\nimport \"./style.css\";\nimport config from \"./config\"; //Components\n\nimport Login from \"./pages/login/Login\";\nimport Navbar from \"./components/navbar/Navbar\";\nimport Home from \"./pages/home/Home\";\nimport ReportForm from \"./pages/reportForm/ReportForm\";\nimport ProjectOverview from \"./pages/project/projectOverview/ProjectOverview\";\nimport ProjectInfo from \"./pages/project/projectInfo/ProjectInfo\";\nimport TeamOverview from \"./pages/team/teamOverview/TeamOverview\";\nimport TeamInfo from \"./pages/team/teamInfo/TeamInfo\";\nimport Messages from \"./pages/Messages/Messages\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nlibrary.add(fas);\nconst oktaAuth = new OktaAuth(config.oidc);\nconst CALLBACK_PATH = '/login/callback';\n\nconst App = () => {\n _s();\n\n const history = useHistory();\n const {\n authState\n } = oktaAuth.isAuthenticated;\n\n const restoreOriginalUri = async (_oktaAuth, originalUri) => {\n history.replace(toRelativeUrl(originalUri || '/', window.location.origin));\n };\n\n if (!authState) {\n console.log(\"Is logged in\");\n }\n\n return /*#__PURE__*/_jsxDEV(Security, {\n oktaAuth: oktaAuth,\n restoreOriginalUri: restoreOriginalUri,\n children: [/*#__PURE__*/_jsxDEV(Navbar, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 40,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(Switch, {\n children: [/*#__PURE__*/_jsxDEV(Route, {\n path: \"/\",\n exact: true,\n component: Login\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(Route, {\n path: CALLBACK_PATH,\n component: LoginCallback\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/home\",\n component: Home\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/reportissue\",\n component: ReportForm\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/projects\",\n component: ProjectOverview\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/ReactApp\",\n component: ProjectInfo\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/teams\",\n component: TeamOverview\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/HenriksMemeMachine\",\n component: TeamInfo\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/messages\",\n component: Messages\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 39,\n columnNumber: 5\n }, this);\n};\n\n_s(App, \"9cZfZ04734qoCGIctmKX7+sX6eU=\", false, function () {\n return [useHistory];\n});\n\n_c = App;\nexport default App;\n\nvar _c;\n\n$RefreshReg$(_c, \"App\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/App.jsx"],"names":["React","Route","Switch","useHistory","useOktaAuth","library","fas","OktaAuth","toRelativeUrl","Security","SecureRoute","LoginCallback","config","Login","Navbar","Home","ReportForm","ProjectOverview","ProjectInfo","TeamOverview","TeamInfo","Messages","add","oktaAuth","oidc","CALLBACK_PATH","App","history","authState","isAuthenticated","restoreOriginalUri","_oktaAuth","originalUri","replace","window","location","origin","console","log"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,KAAT,EAAgBC,MAAhB,EAAwBC,UAAxB,QAA0C,kBAA1C;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,SAASC,OAAT,QAAwB,mCAAxB;AACA,SAASC,GAAT,QAAoB,mCAApB;AACA,SAASC,QAAT,EAAmBC,aAAnB,QAAwC,oBAAxC;AACA,SAASC,QAAT,EAAmBC,WAAnB,EAAgCC,aAAhC,QAAqD,kBAArD;AACA,OAAO,aAAP;AACA,OAAOC,MAAP,MAAmB,UAAnB,C,CAEA;;AACA,OAAOC,KAAP,MAAkB,qBAAlB;AACA,OAAOC,MAAP,MAAmB,4BAAnB;AACA,OAAOC,IAAP,MAAiB,mBAAjB;AACA,OAAOC,UAAP,MAAuB,+BAAvB;AACA,OAAOC,eAAP,MAA4B,iDAA5B;AACA,OAAOC,WAAP,MAAwB,yCAAxB;AACA,OAAOC,YAAP,MAAyB,wCAAzB;AACA,OAAOC,QAAP,MAAqB,gCAArB;AACA,OAAOC,QAAP,MAAqB,2BAArB;;AAEAhB,OAAO,CAACiB,GAAR,CAAYhB,GAAZ;AAEA,MAAMiB,QAAQ,GAAG,IAAIhB,QAAJ,CAAaK,MAAM,CAACY,IAApB,CAAjB;AACA,MAAMC,aAAa,GAAG,iBAAtB;;AAEA,MAAMC,GAAG,GAAG,MAAM;AAAA;;AAChB,QAAMC,OAAO,GAAGxB,UAAU,EAA1B;AACA,QAAM;AAA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,EAAC,QAAlB;AAA2B,QAAA,SAAS,EAAEC;AAAtC;AAAA;AAAA;AAAA;AAAA,cAPF,eAQE,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,qBAAlB;AAAwC,QAAA,SAAS,EAAEC;AAAnD;AAAA;AAAA;AAAA;AAAA,cARF,eASE,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,WAAlB;AAA8B,QAAA,SAAS,EAAEC;AAAzC;AAAA;AAAA;AAAA;AAAA,cATF;AAAA;AAAA;AAAA;AAAA;AAAA,YAFF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAgBD,CA3BD;;GAAMK,G;UACYvB,U;;;KADZuB,G;AA6BN,eAAeA,GAAf","sourcesContent":["import React from \"react\"\r\nimport { Route, Switch, useHistory } from \"react-router-dom\"\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport { library } from '@fortawesome/fontawesome-svg-core'\r\nimport { fas } from '@fortawesome/free-solid-svg-icons'\r\nimport { OktaAuth, toRelativeUrl } from '@okta/okta-auth-js';\r\nimport { Security, SecureRoute, LoginCallback } from \"@okta/okta-react\"\r\nimport \"./style.css\"\r\nimport config from \"./config\"\r\n\r\n//Components\r\nimport Login from \"./pages/login/Login\"\r\nimport Navbar from \"./components/navbar/Navbar\"\r\nimport Home from \"./pages/home/Home\"\r\nimport ReportForm from \"./pages/reportForm/ReportForm\"\r\nimport ProjectOverview from \"./pages/project/projectOverview/ProjectOverview\"\r\nimport ProjectInfo from \"./pages/project/projectInfo/ProjectInfo\"\r\nimport TeamOverview from \"./pages/team/teamOverview/TeamOverview\"\r\nimport TeamInfo from \"./pages/team/teamInfo/TeamInfo\"\r\nimport Messages from \"./pages/Messages/Messages\"\r\n\r\nlibrary.add(fas)\r\n\r\nconst oktaAuth = new OktaAuth(config.oidc);\r\nconst CALLBACK_PATH = '/login/callback';\r\n\r\nconst App = () => {\r\n const history = useHistory()\r\n const { authState } = oktaAuth.isAuthenticated\r\n const restoreOriginalUri = async (_oktaAuth, originalUri) => {\r\n history.replace(toRelativeUrl(originalUri || '/', window.location.origin))\r\n }\r\n\r\n if (!authState) {\r\n console.log(\"Is logged in\")\r\n }\r\n\r\n return (\r\n <Security oktaAuth={oktaAuth} restoreOriginalUri={restoreOriginalUri}>\r\n <Navbar />\r\n <Switch>\r\n <Route path=\"/\" exact component={Login} />\r\n <Route path={CALLBACK_PATH} component={LoginCallback} />\r\n <SecureRoute path=\"/home\" component={Home} />\r\n <SecureRoute path=\"/reportissue\" component={ReportForm} />\r\n <SecureRoute path=\"/projects\" component={ProjectOverview} />\r\n <SecureRoute path=\"/ReactApp\" component={ProjectInfo} />\r\n <SecureRoute path=\"/teams\" component={TeamOverview} />\r\n <SecureRoute path=\"/HenriksMemeMachine\" component={TeamInfo} />\r\n <SecureRoute path=\"/messages\" component={Messages} />\r\n </Switch>\r\n </Security>\r\n )\r\n}\r\n\r\nexport default App"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\navbar\\\\dropdownMenu\\\\NavbarDropdownMenu.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useRef, useState, useEffect } from 'react';\nimport { NavLink } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./NavbarDropdownMenu.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst DropdownMenu = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const dropdownRef = useRef(null);\n const [isActive, setIsActive] = useState(false);\n\n const onClick = () => setIsActive(!isActive);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\n setIsActive(!isActive);\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (isActive) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [isActive]);\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const logout = () => {\n oktaAuth.signOut();\n };\n\n return /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"navbar-user-dropdown-container\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: `user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`,\n onClick: onClick,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"user-icon\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"down-arrow\",\n icon: \"angle-down\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n ref: dropdownRef,\n className: `user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`,\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"menu-item\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"item-text-top\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"upper-row\",\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n className: \"menu-item-link\",\n children: \"Account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"bottom-row\",\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n className: \"menu-item-link-bottom\",\n children: userInfo ? userInfo.email : \"...\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 69,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"item-icon-top\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"menu-item\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"item-text\",\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n className: \"menu-item-link\",\n children: \"Messages\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 82,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"item-icon\",\n icon: \"envelope\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 81,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 80,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 102,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 5\n }, this);\n};\n\n_s(DropdownMenu, \"fSJPYre4v1rGcIZdck7wMJJU1dU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = DropdownMenu;\nexport default DropdownMenu;\n\nvar _c;\n\n$RefreshReg$(_c, \"DropdownMenu\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/navbar/dropdownMenu/NavbarDropdownMenu.jsx"],"names":["React","useRef","useState","useEffect","NavLink","useOktaAuth","FontAwesomeIcon","DropdownMenu","authState","oktaAuth","userInfo","setUserInfo","dropdownRef","isActive","setIsActive","onClick","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","isAuthenticated","getUser","then","info","logout","signOut","email"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,MAAhB,EAAwBC,QAAxB,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,0BAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAGA,MAAMC,YAAY,GAAG,MAAM;AAAA;;AACzB,QAAM;AAAEC,IAAAA,SAAF;A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IAAI,EAAC;AAAhD;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,sBAbF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBAFF,eAsBE;AAAA,mCACE;AAAK,cAAA,SAAS,EAAC,WAAf;AAAA,sCACE;AAAK,gBAAA,SAAS,EAAC,WAAf;AAAA,uCACE,QAAC,OAAD;AAAS,kBAAA,EAAE,EAAC,UAAZ;AAAuB,kBAAA,SAAS,EAAC,gBAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,sBADF,eAME;AAAA,uCACE,QAAC,eAAD;AAAiB,kBAAA,SAAS,EAAC,WAA3B;AAAuC,kBAAA,IAAI,EAAC;AAA5C;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,sBANF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBAtBF,eA4CE;AAAA;AAAA;AAAA;AAAA,kBA5CF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cANF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AA+DD,CAxGD;;GAAMvB,Y;UAC4BF,W;;;KAD5BE,Y;AA0GN,eAAeA,YAAf","sourcesContent":["import React, { useRef, useState, useEffect } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./NavbarDropdownMenu.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\n\r\nconst DropdownMenu = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [isActive]);\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const logout = () => {\r\n oktaAuth.signOut()\r\n }\r\n\r\n return (\r\n <li>\r\n <div className=\"navbar-user-dropdown-container\">\r\n <button className={`user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"user-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n {/* show submenu?*/}\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n\r\n <li>\r\n <div className=\"menu-item\">\r\n <div className=\"item-text-top\">\r\n <div className=\"upper-row\">\r\n <NavLink to=\"/account\" className=\"menu-item-link\">\r\n Account\r\n </NavLink>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <NavLink to=\"/account\" className=\"menu-item-link-bottom\">\r\n {userInfo ? userInfo.email : \"...\"}\r\n </NavLink>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"item-icon-top\" icon=\"user-circle\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </li>\r\n\r\n <li>\r\n <div className=\"menu-item\">\r\n <div className=\"item-text\">\r\n <NavLink to=\"/account\" className=\"menu-item-link\">\r\n Messages\r\n </NavLink>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"item-icon\" icon=\"envelope\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n {/* <NavLink to=\"/messages\">\r\n \r\n </NavLink> */}\r\n </li>\r\n\r\n {/* <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"sliders-h\"></FontAwesomeIcon>&nbsp;&nbsp;Preferences\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"item-icon-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li> */}\r\n <li>\r\n {/* <a onClick={logout}>\r\n <FontAwesomeIcon icon=\"sign-out-alt\"></FontAwesomeIcon>&nbsp;&nbsp;Log out\r\n </a> */}\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </li >\r\n )\r\n}\r\n\r\nexport default DropdownMenu"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\navbar\\\\dropdownMenu\\\\NavbarDropdownMenu.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useRef, useState, useEffect } from 'react';\nimport { NavLink } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./NavbarDropdownMenu.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst DropdownMenu = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const dropdownRef = useRef(null);\n const [isActive, setIsActive] = useState(false);\n\n const onClick = () => setIsActive(!isActive);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\n setIsActive(!isActive);\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (isActive) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [isActive]);\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const logout = () => {\n oktaAuth.signOut();\n };\n\n return /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"navbar-user-dropdown-container\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: `user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`,\n onClick: onClick,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"user-icon\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"down-arrow\",\n icon: \"angle-down\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n ref: dropdownRef,\n className: `user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`,\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"accountLink\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"upper-row\",\n children: \"Account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 21\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"arrow-right-icon-top\",\n icon: \"chevron-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 21\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"bottom-row\",\n children: userInfo ? userInfo.email : \"...\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 21\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/messages\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"envelope\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Messages\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: logout,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-out-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Log out\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 5\n }, this);\n};\n\n_s(DropdownMenu, \"fSJPYre4v1rGcIZdck7wMJJU1dU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = DropdownMenu;\nexport default DropdownMenu;\n\nvar _c;\n\n$RefreshReg$(_c, \"DropdownMenu\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/navbar/dropdownMenu/NavbarDropdownMenu.jsx"],"names":["React","useRef","useState","useEffect","NavLink","useOktaAuth","FontAwesomeIcon","DropdownMenu","authState","oktaAuth","userInfo","setUserInfo","dropdownRef","isActive","setIsActive","onClick","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","isAuthenticated","getUser","then","info","logout","signOut","email"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,MAAhB,EAAwBC,QAAxB,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,0BAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAGA,MAAMC,YAAY,GAAG,MAAM;AAAA;;AACzB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BJ,WAAW,EAA3C;AACA,QAAM,CAACK,QAAD,EAAWC,WAAX,IAA0BT,QAAQ,CAAC,IAAD,CAAxC;AAEA,QAAMU,WAAW,GAAGX,MAAM,CAAC,IAAD,CAA1B;AACA,QAAM,CAACY,QAAD,EAAWC,WAAX,IAA0BZ,QAAQ,CAAC,KAAD,CAAxC;;AACA,QAAMa,OAAO,G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AA,mCACE;AAAG,cAAA,OAAO,EAAEF,MAAZ;AAAA,sCACE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBA5BF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cANF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AA+CD,CAxFD;;GAAMrB,Y;UAC4BF,W;;;KAD5BE,Y;AA0FN,eAAeA,YAAf","sourcesContent":["import React, { useRef, useState, useEffect } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./NavbarDropdownMenu.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\n\r\nconst DropdownMenu = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [isActive]);\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const logout = () => {\r\n oktaAuth.signOut()\r\n }\r\n\r\n return (\r\n <li>\r\n <div className=\"navbar-user-dropdown-container\">\r\n <button className={`user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"user-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n {/* show submenu?*/}\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <div >\r\n <NavLink to=\"/account\">\r\n <div className=\"accountLink\">\r\n <div className=\"upper-row\">\r\n Account\r\n </div>\r\n <FontAwesomeIcon className=\"arrow-right-icon-top\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n <div className=\"bottom-row\">\r\n {userInfo ? userInfo.email : \"...\"}\r\n </div>\r\n </div>\r\n </NavLink>\r\n </div>\r\n </li>\r\n <li>\r\n <NavLink to=\"/messages\">\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>&nbsp;&nbsp;Messages\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </NavLink>\r\n </li>\r\n {/* <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"sliders-h\"></FontAwesomeIcon>&nbsp;&nbsp;Preferences\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li> */}\r\n <li>\r\n <a onClick={logout}>\r\n <FontAwesomeIcon icon=\"sign-out-alt\"></FontAwesomeIcon>&nbsp;&nbsp;Log out\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </li >\r\n )\r\n}\r\n\r\nexport default DropdownMenu"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\navbar\\\\dropdownMenu\\\\NavbarDropdownMenu.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useRef, useState, useEffect } from 'react';\nimport { NavLink } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./NavbarDropdownMenu.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst DropdownMenu = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const dropdownRef = useRef(null);\n const [isActive, setIsActive] = useState(false);\n\n const onClick = () => setIsActive(!isActive);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\n setIsActive(!isActive);\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (isActive) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [isActive]);\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const logout = () => {\n oktaAuth.signOut();\n };\n\n return /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"navbar-user-dropdown-container\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: `user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`,\n onClick: onClick,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"user-icon\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"down-arrow\",\n icon: \"angle-down\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n ref: dropdownRef,\n className: `user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`,\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"accountLink\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"upper-row\",\n children: \"Account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 21\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"arrow-right-icon\",\n icon: \"chevron-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 21\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"bottom-row\",\n children: userInfo ? userInfo.email : \"...\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 21\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/messages\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"envelope\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Messages\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: logout,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-out-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Log out\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 5\n }, this);\n};\n\n_s(DropdownMenu, \"fSJPYre4v1rGcIZdck7wMJJU1dU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = DropdownMenu;\nexport default DropdownMenu;\n\nvar _c;\n\n$RefreshReg$(_c, \"DropdownMenu\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/navbar/dropdownMenu/NavbarDropdownMenu.jsx"],"names":["React","useRef","useState","useEffect","NavLink","useOktaAuth","FontAwesomeIcon","DropdownMenu","authState","oktaAuth","userInfo","setUserInfo","dropdownRef","isActive","setIsActive","onClick","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","isAuthenticated","getUser","then","info","logout","signOut","email"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,MAAhB,EAAwBC,QAAxB,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,0BAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAGA,MAAMC,YAAY,GAAG,MAAM;AAAA;;AACzB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BJ,WAAW,EAA3C;AACA,QAAM,CAACK,QAAD,EAAWC,WAAX,IAA0BT,QAAQ,CAAC,IAAD,CAAxC;AAEA,QAAMU,WAAW,GAAGX,MAAM,CAAC,IAAD,CAA1B;AACA,QAAM,CAACY,QAAD,EAAWC,WAAX,IAA0BZ,QAAQ,CAAC,KAAD,CAAxC;;AACA,QAAMa,OAAO,GAAG,MAAMD,WAAW,CAAC,CAACD,QAAF,CAAjC;;AAEAV,EAAAA,SAAS,CAAC,MAAM;AACd,UAAMa,cAAc,GAAIC,CAAD,IAAO;AAC5B,UAAIL,WAAW,CAACM,OAAZ,KAAwB,IAAxB,IAAgC,CAACN,WAAW,CAACM,OAAZ,CAAoBC,QAApB,CAA6BF,CAAC,CAACG,MAA/B,CAArC,EAA6E;AAC3EN,QAAAA,WAAW,CAAC,CAACD,QAAF,CAAX;AACD;AACF,KAJD,CADc,CAOd;;;AACA,QAAIA,QAAJ,EAAc;AACZQ,MAAAA,MAAM,CAACC,gBAAP,CAAwB,OAAxB,EAAiCN,cAAjC;AACD;;AAED,WAAO,MAAM;AACXK,MAAAA,MAAM,CAACE,mBAAP,CAA2B,OAA3B,EAAoCP,cAApC;AACD,KAFD;AAID,GAhBQ,EAgBN,CAACH,QAAD,CAhBM,CAAT;AAkBAV,EAAAA,SAAS,CAAC,MAAM;AACd,QAAI,CAACK,SAAS,CAACgB,eAAf,EAAgC;AAC9B;AACAb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BAAA,SAAS,EAAC,YAAf;AAAA,8BACGH,QAAQ,GAAGA,QAAQ,CAACoB,KAAZ,GAAoB;AAD/B;AAAA;AAAA;AAAA;AAAA,0BANF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBADF,eAiBE;AAAA,mCACE,QAAC,OAAD;AAAS,cAAA,EAAE,EAAC,WAAZ;AAAA,sCACE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBADF,mCAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC,eAAtB;AAAsC,gBAAA,SAAS,EAAC;AAAhD;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBAjBF,eA6BE;AAAA,mCACE;AAAG,cAAA,OAAO,EAAEF,MAAZ;AAAA,sCACE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBA7BF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cANF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAgDD,CAzFD;;GAAMrB,Y;UAC4BF,W;;;KAD5BE,Y;AA2FN,eAAeA,YAAf","sourcesContent":["import React, { useRef, useState, useEffect } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./NavbarDropdownMenu.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\n\r\nconst DropdownMenu = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [isActive]);\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const logout = () => {\r\n oktaAuth.signOut()\r\n }\r\n\r\n return (\r\n <li>\r\n <div className=\"navbar-user-dropdown-container\">\r\n <button className={`user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"user-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n {/* show submenu?*/}\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <div >\r\n <NavLink to=\"/account\">\r\n <div className=\"accountLink\">\r\n <div className=\"upper-row\">\r\n Account\r\n\r\n </div>\r\n <FontAwesomeIcon className=\"arrow-right-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n <div className=\"bottom-row\">\r\n {userInfo ? userInfo.email : \"...\"}\r\n </div>\r\n </div>\r\n </NavLink>\r\n </div>\r\n </li>\r\n <li>\r\n <NavLink to=\"/messages\">\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>&nbsp;&nbsp;Messages\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </NavLink>\r\n </li>\r\n {/* <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"sliders-h\"></FontAwesomeIcon>&nbsp;&nbsp;Preferences\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li> */}\r\n <li>\r\n <a onClick={logout}>\r\n <FontAwesomeIcon icon=\"sign-out-alt\"></FontAwesomeIcon>&nbsp;&nbsp;Log out\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </li >\r\n )\r\n}\r\n\r\nexport default DropdownMenu"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\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 './navLinks/NavLinks';\nimport Searchbar from './searchbar/Searchbar';\nimport NavbarDropdownMenu from './dropdownMenu/NavbarDropdownMenu';\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 if (!authState || !authState.isAuthenticated) {\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: 20,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(NavLinks, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 21,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 19,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"searchbar-profile-container\",\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n className: \"right-unstyled-navbar\",\n children: [/*#__PURE__*/_jsxDEV(Searchbar, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 25,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(NavbarDropdownMenu, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 26,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 24,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 23,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 18,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 17,\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/pages/navbar/Navbar.jsx"],"names":["React","useOktaAuth","Logo","NavLinks","Searchbar","NavbarDropdownMenu","Navbar","authState","oktaAuth","isAuthenticated"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,cAAP;AACA,OAAOC,IAAP,MAAiB,aAAjB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,SAAP,MAAsB,uBAAtB;AACA,OAAOC,kBAAP,MAA+B,mCAA/B;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BP,WAAW,EAA3C;;AAEA,MAAI,CAACM,SAAD,IAAc,CAACA,SAAS,CAACE,eAA7B,EAA8C;AAC5C,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,eAEE,QAAC,QAAD;AAAA;AAAA;AAAA;AAAA,gBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,cADF,eAKE;AAAK,QAAA,SAAS,EAAC,6BAAf;AAAA,+BACE;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;AADF;AAAA;AAAA;AAAA;AAAA,cALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAgBD,CAvBD;;GAAMH,M;UAC4BL,W;;;KAD5BK,M;AAyBN,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 './navLinks/NavLinks'\r\nimport Searchbar from './searchbar/Searchbar'\r\nimport NavbarDropdownMenu from './dropdownMenu/NavbarDropdownMenu'\r\n\r\nconst Navbar = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n\r\n if (!authState || !authState.isAuthenticated) {\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 <NavLinks />\r\n </div>\r\n <div className=\"searchbar-profile-container\">\r\n <ul className=\"right-unstyled-navbar\">\r\n <Searchbar />\r\n <NavbarDropdownMenu />\r\n </ul>\r\n </div>\r\n </div>\r\n </div >\r\n )\r\n}\r\n\r\nexport default Navbar"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\project\\\\projectInfo\\\\activitiesDisplay\\\\ActivitiesDisplay.jsx\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport React from 'react';\nimport \"./ActivitiesDisplay.css\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ActivitiesDisplay = () => {\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"activity-new-issues-display-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"new-issues-display-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"new-issues-display-header\",\n children: /*#__PURE__*/_jsxDEV(\"p\", {\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"inbox\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 12,\n columnNumber: 13\n }, this), \"\\xA0\\xA0New issue reports\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 11,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 10,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"new-issues-display-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"new-issue-report-entry\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"entry-text\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"upper-row\",\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n children: \"[Severity] [type]\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 20,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 19,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"bottom-row\",\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n children: \"[project] [time]\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 25,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 24,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 18,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"entry-icon\",\n icon: \"chevron-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 30,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 17,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 16,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 9,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"activity-display-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"activity-display-header\",\n children: /*#__PURE__*/_jsxDEV(\"p\", {\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sticky-note\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 40,\n columnNumber: 13\n }, this), \"\\xA0\\xA0Recent Team activities\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 39,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"activity-display-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"new-issue-report-entry\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"entry-text\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"upper-row\",\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n children: \"[Name] [action]\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"bottom-row\",\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n children: \"[project] [time]\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"entry-icon\",\n icon: \"chevron-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 37,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 7,\n columnNumber: 5\n }, this);\n};\n\n_c = ActivitiesDisplay;\nexport default ActivitiesDisplay;\n\nvar _c;\n\n$RefreshReg$(_c, \"ActivitiesDisplay\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/project/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f;AAAA,+BACE;AAAA,kCACE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cADF,eAOE;AAAK,QAAA,SAAS,EAAC,0BAAf;AAAA,+BACE;AAAK,UAAA,SAAS,EAAC,wBAAf;AAAA,kCACE;AAAK,YAAA,SAAS,EAAC,YAAf;AAAA,oCACE;AAAK,cAAA,SAAS,EAAC,WAAf;AAAA,qCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,oBADF,eAME;AAAK,cAAA,SAAS,EAAC,YAAf;AAAA,qCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,oBANF;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF,eAaE;AAAA,mCACE,QAAC,eAAD;AAAiB,cAAA,SAAS,EAAC,YAA3B;AAAwC,cAAA,IAAI,EAAC;AAA7C;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBAbF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAPF;AAAA;AAAA;AAAA;AAAA;AAAA,YA9BF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA4DD,CA7DD;;KAAMA,iB;AA+DN,eAAeA,iBAAf","sourcesContent":["import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport React from 'react'\r\nimport \"./ActivitiesDisplay.css\"\r\n\r\nconst ActivitiesDisplay = () => {\r\n return (\r\n <div className=\"activity-new-issues-display-container\">\r\n\r\n <div className=\"new-issues-display-container\">\r\n <div className=\"new-issues-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"inbox\"></FontAwesomeIcon>\r\n &nbsp;&nbsp;New issue reports\r\n </p>\r\n </div>\r\n <div className=\"new-issues-display-content\">\r\n <div className=\"new-issue-report-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [Severity] [type]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [project] [time]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"activity-display-container\">\r\n <div className=\"activity-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"sticky-note\"></FontAwesomeIcon>\r\n &nbsp;&nbsp;Recent Team activities\r\n </p>\r\n </div>\r\n <div className=\"activity-display-content\">\r\n <div className=\"new-issue-report-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [Name] [action]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [project] [time]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ActivitiesDisplay"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\navbar\\\\dropdownMenu\\\\NavbarDropdownMenu.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useRef, useState, useEffect } from 'react';\nimport { NavLink } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./NavbarDropdownMenu.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst DropdownMenu = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const dropdownRef = useRef(null);\n const [isActive, setIsActive] = useState(false);\n\n const onClick = () => setIsActive(!isActive);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\n setIsActive(!isActive);\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (isActive) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [isActive]);\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const logout = () => {\n oktaAuth.signOut();\n };\n\n return /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"navbar-user-dropdown-container\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: `user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`,\n onClick: onClick,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"user-icon\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"down-arrow\",\n icon: \"angle-down\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n ref: dropdownRef,\n className: `user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`,\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"accountLink\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"upper-row\",\n children: \"Account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 21\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"arrow-right-icon\",\n icon: \"chevron-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 21\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"bottom-row\",\n children: userInfo ? userInfo.email : \"...\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 21\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/messages\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"envelope\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Messages\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: logout,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-out-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Log out\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 5\n }, this);\n};\n\n_s(DropdownMenu, \"fSJPYre4v1rGcIZdck7wMJJU1dU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = DropdownMenu;\nexport default DropdownMenu;\n\nvar _c;\n\n$RefreshReg$(_c, \"DropdownMenu\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/navbar/dropdownMenu/NavbarDropdownMenu.jsx"],"names":["React","useRef","useState","useEffect","NavLink","useOktaAuth","FontAwesomeIcon","DropdownMenu","authState","oktaAuth","userInfo","setUserInfo","dropdownRef","isActive","setIsActive","onClick","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","isAuthenticated","getUser","then","info","logout","signOut","email"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,MAAhB,EAAwBC,QAAxB,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,0BAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAGA,MAAMC,YAAY,GAAG,MAAM;AAAA;;AACzB,QAAM;AAAEC,IAAAA,SAAF;AA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AiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBADF,mCAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC,eAAtB;AAAsC,gBAAA,SAAS,EAAC;AAAhD;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBAhBF,eA4BE;AAAA,mCACE;AAAG,cAAA,OAAO,EAAEF,MAAZ;AAAA,sCACE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBA5BF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cANF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AA+CD,CAxFD;;GAAMrB,Y;UAC4BF,W;;;KAD5BE,Y;AA0FN,eAAeA,YAAf","sourcesContent":["import React, { useRef, useState, useEffect } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./NavbarDropdownMenu.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\n\r\nconst DropdownMenu = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [isActive]);\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const logout = () => {\r\n oktaAuth.signOut()\r\n }\r\n\r\n return (\r\n <li>\r\n <div className=\"navbar-user-dropdown-container\">\r\n <button className={`user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"user-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n {/* show submenu?*/}\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <div >\r\n <NavLink to=\"/account\">\r\n <div className=\"accountLink\">\r\n <div className=\"upper-row\">\r\n Account\r\n </div>\r\n <FontAwesomeIcon className=\"arrow-right-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n <div className=\"bottom-row\">\r\n {userInfo ? userInfo.email : \"...\"}\r\n </div>\r\n </div>\r\n </NavLink>\r\n </div>\r\n </li>\r\n <li>\r\n <NavLink to=\"/messages\">\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>&nbsp;&nbsp;Messages\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </NavLink>\r\n </li>\r\n {/* <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"sliders-h\"></FontAwesomeIcon>&nbsp;&nbsp;Preferences\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li> */}\r\n <li>\r\n <a onClick={logout}>\r\n <FontAwesomeIcon icon=\"sign-out-alt\"></FontAwesomeIcon>&nbsp;&nbsp;Log out\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </li >\r\n )\r\n}\r\n\r\nexport default DropdownMenu"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\navbar\\\\dropdownMenu\\\\NavbarDropdownMenu.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useRef, useState, useEffect } from 'react';\nimport { NavLink } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./NavbarDropdownMenu.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst DropdownMenu = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const dropdownRef = useRef(null);\n const [isActive, setIsActive] = useState(false);\n\n const onClick = () => setIsActive(!isActive);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\n setIsActive(!isActive);\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (isActive) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [isActive]);\n\n const logout = () => {\n oktaAuth.signOut();\n };\n\n return /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"navbar-user-dropdown-container\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: `user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`,\n onClick: onClick,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"user-icon\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"down-arrow\",\n icon: \"angle-down\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 40,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n ref: dropdownRef,\n className: `user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`,\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Account\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/messages\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"envelope\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Messages\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: logout,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-out-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Log out\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 39,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 5\n }, this);\n};\n\n_s(DropdownMenu, \"K/H+pngTJ7UqSrk/MkDOYkpAmdU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = DropdownMenu;\nexport default DropdownMenu;\n\nvar _c;\n\n$RefreshReg$(_c, \"DropdownMenu\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/navbar/dropdownMenu/NavbarDropdownMenu.jsx"],"names":["React","useRef","useState","useEffect","NavLink","useOktaAuth","FontAwesomeIcon","DropdownMenu","authState","oktaAuth","dropdownRef","isActive","setIsActive","onClick","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","logout","signOut"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,MAAhB,EAAwBC,QAAxB,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,0BAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAGA,MAAMC,YAAY,G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y;UAC4BF,W;;;KAD5BE,Y;AAqEN,eAAeA,YAAf","sourcesContent":["import React, { useRef, useState, useEffect } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./NavbarDropdownMenu.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\n\r\nconst DropdownMenu = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [isActive]);\r\n\r\n const logout = () => {\r\n oktaAuth.signOut()\r\n }\r\n\r\n return (\r\n <li>\r\n <div className=\"navbar-user-dropdown-container\">\r\n <button className={`user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"user-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n {/* show submenu?*/}\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <NavLink to=\"/account\">\r\n <FontAwesomeIcon icon=\"user\"></FontAwesomeIcon>&nbsp;&nbsp;Account\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </NavLink>\r\n </li>\r\n <li>\r\n <NavLink to=\"/messages\">\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>&nbsp;&nbsp;Messages\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </NavLink>\r\n </li>\r\n {/* <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"sliders-h\"></FontAwesomeIcon>&nbsp;&nbsp;Preferences\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li> */}\r\n <li>\r\n <a onClick={logout}>\r\n <FontAwesomeIcon icon=\"sign-out-alt\"></FontAwesomeIcon>&nbsp;&nbsp;Log out\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </li >\r\n )\r\n}\r\n\r\nexport default DropdownMenu"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\App.jsx\",\n _s = $RefreshSig$();\n\nimport React from \"react\";\nimport { Route, Switch, useHistory } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport { library } from '@fortawesome/fontawesome-svg-core';\nimport { fas } from '@fortawesome/free-solid-svg-icons';\nimport { OktaAuth, toRelativeUrl } from '@okta/okta-auth-js';\nimport { Security, SecureRoute, LoginCallback } from \"@okta/okta-react\";\nimport \"./style.css\";\nimport config from \"./config\"; //Components\n\nimport Login from \"./pages/login/Login\";\nimport Navbar from \"./components/navbar/Navbar\";\nimport Home from \"./pages/home/Home\";\nimport ReportForm from \"./pages/reportForm/ReportForm\";\nimport ProjectOverview from \"./pages/project/projectOverview/ProjectOverview\";\nimport ProjectInfo from \"./pages/project/projectInfo/ProjectInfo\";\nimport TeamOverview from \"./pages/team/teamOverview/TeamOverview\";\nimport TeamInfo from \"./pages/team/teamInfo/TeamInfo\";\nimport Messages from \"./pages/Messages/Messages\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nlibrary.add(fas);\nconst oktaAuth = new OktaAuth(config.oidc);\nconst CALLBACK_PATH = '/login/callback';\n\nconst App = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const history = useHistory();\n\n const restoreOriginalUri = async (_oktaAuth, originalUri) => {\n history.replace(toRelativeUrl(originalUri || '/', window.location.origin));\n };\n\n return /*#__PURE__*/_jsxDEV(Security, {\n oktaAuth: oktaAuth,\n restoreOriginalUri: restoreOriginalUri,\n children: [/*#__PURE__*/_jsxDEV(Navbar, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 36,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(Switch, {\n children: [/*#__PURE__*/_jsxDEV(Route, {\n path: \"/\",\n exact: true,\n component: !authState.isAuthenticated ? Login : Home\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(Route, {\n path: CALLBACK_PATH,\n component: LoginCallback\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 39,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/home\",\n component: Home\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 40,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/reportissue\",\n component: ReportForm\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/projects\",\n component: ProjectOverview\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/ReactApp\",\n component: ProjectInfo\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/teams\",\n component: TeamOverview\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/HenriksMemeMachine\",\n component: TeamInfo\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(SecureRoute, {\n path: \"/messages\",\n component: Messages\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 37,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 5\n }, this);\n};\n\n_s(App, \"gN2vl07t+HjO0zaRWUqe1tMASe8=\", false, function () {\n return [useOktaAuth, useHistory];\n});\n\n_c = App;\nexport default App;\n\nvar _c;\n\n$RefreshReg$(_c, \"App\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/App.jsx"],"names":["React","Route","Switch","useHistory","useOktaAuth","library","fas","OktaAuth","toRelativeUrl","Security","SecureRoute","LoginCallback","config","Login","Navbar","Home","ReportForm","ProjectOverview","ProjectInfo","TeamOverview","TeamInfo","Messages","add","oktaAuth","oidc","CALLBACK_PATH","App","authState","history","restoreOriginalUri","_oktaAuth","originalUri","replace","window","location","origin","isAuthenticated"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,KAAT,EAAgBC,MAAhB,EAAwBC,UAAxB,QAA0C,kBAA1C;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,SAASC,OAAT,QAAwB,mCAAxB;AACA,SAASC,GAAT,QAAoB,mCAApB;AACA,SAASC,QAAT,EAAmBC,aAAnB,QAAwC,oBAAxC;AACA,SAASC,QAAT,EAAmBC,WAAnB,EAAgCC,aAAhC,QAAqD,kBAArD;AACA,OAAO,aAAP;AACA,OAAOC,MAAP,MAAmB,UAAnB,C,CAEA;;AACA,OAAOC,KAAP,MAAkB,qBAA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A;AAAA;AAAA,cAFF,eAGE,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,OAAlB;AAA0B,QAAA,SAAS,EAAEI;AAArC;AAAA;AAAA;AAAA;AAAA,cAHF,eAIE,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,cAAlB;AAAiC,QAAA,SAAS,EAAEC;AAA5C;AAAA;AAAA;AAAA;AAAA,cAJF,eAKE,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,WAAlB;AAA8B,QAAA,SAAS,EAAEC;AAAzC;AAAA;AAAA;AAAA;AAAA,cALF,eAME,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,WAAlB;AAA8B,QAAA,SAAS,EAAEC;AAAzC;AAAA;AAAA;AAAA;AAAA,cANF,eAOE,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,QAAlB;AAA2B,QAAA,SAAS,EAAEC;AAAtC;AAAA;AAAA;AAAA;AAAA,cAPF,eAQE,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,qBAAlB;AAAwC,QAAA,SAAS,EAAEC;AAAnD;AAAA;AAAA;AAAA;AAAA,cARF,eASE,QAAC,WAAD;AAAa,QAAA,IAAI,EAAC,WAAlB;AAA8B,QAAA,SAAS,EAAEC;AAAzC;AAAA;AAAA;AAAA;AAAA,cATF;AAAA;AAAA;AAAA;AAAA;AAAA,YAFF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAgBD,CAvBD;;GAAMK,G;UAC4BtB,W,EAChBD,U;;;KAFZuB,G;AAyBN,eAAeA,GAAf","sourcesContent":["import React from \"react\"\r\nimport { Route, Switch, useHistory } from \"react-router-dom\"\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport { library } from '@fortawesome/fontawesome-svg-core'\r\nimport { fas } from '@fortawesome/free-solid-svg-icons'\r\nimport { OktaAuth, toRelativeUrl } from '@okta/okta-auth-js';\r\nimport { Security, SecureRoute, LoginCallback } from \"@okta/okta-react\"\r\nimport \"./style.css\"\r\nimport config from \"./config\"\r\n\r\n//Components\r\nimport Login from \"./pages/login/Login\"\r\nimport Navbar from \"./components/navbar/Navbar\"\r\nimport Home from \"./pages/home/Home\"\r\nimport ReportForm from \"./pages/reportForm/ReportForm\"\r\nimport ProjectOverview from \"./pages/project/projectOverview/ProjectOverview\"\r\nimport ProjectInfo from \"./pages/project/projectInfo/ProjectInfo\"\r\nimport TeamOverview from \"./pages/team/teamOverview/TeamOverview\"\r\nimport TeamInfo from \"./pages/team/teamInfo/TeamInfo\"\r\nimport Messages from \"./pages/Messages/Messages\"\r\n\r\nlibrary.add(fas)\r\n\r\nconst oktaAuth = new OktaAuth(config.oidc);\r\nconst CALLBACK_PATH = '/login/callback';\r\n\r\nconst App = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const history = useHistory()\r\n const restoreOriginalUri = async (_oktaAuth, originalUri) => {\r\n history.replace(toRelativeUrl(originalUri || '/', window.location.origin))\r\n }\r\n\r\n return (\r\n <Security oktaAuth={oktaAuth} restoreOriginalUri={restoreOriginalUri}>\r\n <Navbar />\r\n <Switch>\r\n <Route path=\"/\" exact component={!authState.isAuthenticated ? Login : Home} />\r\n <Route path={CALLBACK_PATH} component={LoginCallback} />\r\n <SecureRoute path=\"/home\" component={Home} />\r\n <SecureRoute path=\"/reportissue\" component={ReportForm} />\r\n <SecureRoute path=\"/projects\" component={ProjectOverview} />\r\n <SecureRoute path=\"/ReactApp\" component={ProjectInfo} />\r\n <SecureRoute path=\"/teams\" component={TeamOverview} />\r\n <SecureRoute path=\"/HenriksMemeMachine\" component={TeamInfo} />\r\n <SecureRoute path=\"/messages\" component={Messages} />\r\n </Switch>\r\n </Security>\r\n )\r\n}\r\n\r\nexport default App"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\navbar\\\\dropdownMenu\\\\NavbarDropdownMenu.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useRef, useState, useEffect } from 'react';\nimport { NavLink } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./NavbarDropdownMenu.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst DropdownMenu = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const dropdownRef = useRef(null);\n const [isActive, setIsActive] = useState(false);\n\n const onClick = () => setIsActive(!isActive);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\n setIsActive(!isActive);\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (isActive) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [isActive]);\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const logout = () => {\n oktaAuth.signOut();\n };\n\n return /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"navbar-user-dropdown-container\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: `user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`,\n onClick: onClick,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"user-icon\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"down-arrow\",\n icon: \"angle-down\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n ref: dropdownRef,\n className: `user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`,\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"menu-item\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"arrow-right\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"item-text\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"upper-row\",\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n className: \"menu-item-link\",\n children: \"Account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"bottom-row\",\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n className: \"menu-item-link-bottom\",\n children: userInfo ? userInfo.email : \"...\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"arrow-right\",\n icon: \"chevron-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"menu-item\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"envelope\",\n className: \"item-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 85,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"item-text\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"upper-row\",\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n className: \"menu-item-link\",\n children: \"Messages\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"bottom-row\",\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n className: \"menu-item-link-bottom\",\n children: userInfo ? userInfo.email : \"...\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 95,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 94,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"arrow-right\",\n icon: \"chevron-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 101,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 100,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 115,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 5\n }, this);\n};\n\n_s(DropdownMenu, \"fSJPYre4v1rGcIZdck7wMJJU1dU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = DropdownMenu;\nexport default DropdownMenu;\n\nvar _c;\n\n$RefreshReg$(_c, \"DropdownMenu\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/navbar/dropdownMenu/NavbarDropdownMenu.jsx"],"names":["React","useRef","useState","useEffect","NavLink","useOktaAuth","FontAwesomeIcon","DropdownMenu","authState","oktaAuth","userInfo","setUserInfo","dropdownRef","isActive","setIsActive","onClick","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","isAuthenticated","getUser","then","info","logout","signOut","email"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,MAAhB,EAAwBC,QAAxB,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,0BAAP;AACA,SAASC,eAAT,QA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9C;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,sBAhBF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBAzBF,eAyDE;AAAA;AAAA;AAAA;AAAA,kBAzDF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cANF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AA4ED,CArHD;;GAAMvB,Y;UAC4BF,W;;;KAD5BE,Y;AAuHN,eAAeA,YAAf","sourcesContent":["import React, { useRef, useState, useEffect } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./NavbarDropdownMenu.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\n\r\nconst DropdownMenu = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [isActive]);\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const logout = () => {\r\n oktaAuth.signOut()\r\n }\r\n\r\n return (\r\n <li>\r\n <div className=\"navbar-user-dropdown-container\">\r\n <button className={`user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"user-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n {/* show submenu?*/}\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n\r\n <li>\r\n <div className=\"menu-item\">\r\n <div>\r\n <FontAwesomeIcon className=\"arrow-right\" icon=\"user-circle\"></FontAwesomeIcon>\r\n </div>\r\n <div className=\"item-text\">\r\n <div className=\"upper-row\">\r\n <NavLink to=\"/account\" className=\"menu-item-link\">\r\n Account\r\n </NavLink>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <NavLink to=\"/account\" className=\"menu-item-link-bottom\">\r\n {userInfo ? userInfo.email : \"...\"}\r\n </NavLink>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"arrow-right\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </li>\r\n\r\n <li>\r\n <div className=\"menu-item\">\r\n <div>\r\n <FontAwesomeIcon icon=\"envelope\" className=\"item-icon\"></FontAwesomeIcon>\r\n </div>\r\n <div className=\"item-text\">\r\n <div className=\"upper-row\">\r\n <NavLink to=\"/account\" className=\"menu-item-link\">\r\n Messages\r\n </NavLink>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <NavLink to=\"/account\" className=\"menu-item-link-bottom\">\r\n {userInfo ? userInfo.email : \"...\"}\r\n </NavLink>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"arrow-right\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n {/* <NavLink to=\"/messages\">\r\n \r\n </NavLink> */}\r\n </li>\r\n\r\n {/* <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"sliders-h\"></FontAwesomeIcon>&nbsp;&nbsp;Preferences\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li> */}\r\n <li>\r\n {/* <a onClick={logout}>\r\n <FontAwesomeIcon icon=\"sign-out-alt\"></FontAwesomeIcon>&nbsp;&nbsp;Log out\r\n </a> */}\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </li >\r\n )\r\n}\r\n\r\nexport default DropdownMenu"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\navbar\\\\dropdownMenu\\\\NavbarDropdownMenu.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useRef, useState, useEffect } from 'react';\nimport { NavLink } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./NavbarDropdownMenu.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst DropdownMenu = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const dropdownRef = useRef(null);\n const [isActive, setIsActive] = useState(false);\n\n const onClick = () => setIsActive(!isActive);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\n setIsActive(!isActive);\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (isActive) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [isActive]);\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const logout = () => {\n oktaAuth.signOut();\n };\n\n return /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"navbar-user-dropdown-container\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: `user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`,\n onClick: onClick,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"user-icon\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"down-arrow\",\n icon: \"angle-down\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n ref: dropdownRef,\n className: `user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`,\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n onClick: onClick,\n className: \"top-item\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user\",\n className: \"arrow-right-icon-top\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 19\n }, this), \"\\xA0\\xA0\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"item-top-text\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 21\n }, this), /*#__PURE__*/_jsxDEV(\"p\", {\n children: userInfo ? userInfo.email : \"...\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 21\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"arrow-right-icon-top\",\n children: /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/messages\",\n onClick: onClick,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"envelope\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Messages\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: logout,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-out-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Log out\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 5\n }, this);\n};\n\n_s(DropdownMenu, \"fSJPYre4v1rGcIZdck7wMJJU1dU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = DropdownMenu;\nexport default DropdownMenu;\n\nvar _c;\n\n$RefreshReg$(_c, \"DropdownMenu\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/navbar/dropdownMenu/NavbarDropdownMenu.jsx"],"names":["React","useRef","useState","useEffect","NavLink","useOktaAuth","FontAwesomeIcon","DropdownMenu","authState","oktaAuth","userInfo","setUserInfo","dropdownRef","isActive","setIsActive","onClick","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","isAuthenticated","getUser","then","info","logout","signOut","email"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,MAAhB,EAAwBC,QAAxB,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,0BAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAGA,MAAMC,YAAY,GAAG,MAAM;AAAA;;AACzB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BJ,WAAW,EAA3C;AACA,QAAM,CAACK,QAAD,EAAWC,WAAX,IAA0BT,QAAQ,CAAC,IAAD,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AA;AAAA;AAAA,kBADF,eAiBE;AAAA,mCACE,QAAC,OAAD;AAAS,cAAA,EAAE,EAAC,WAAZ;AAAwB,cAAA,OAAO,EAAEf,OAAjC;AAAA,sCACE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBADF,mCAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC,eAAtB;AAAsC,gBAAA,SAAS,EAAC;AAAhD;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBAjBF,eA6BE;AAAA,mCACE;AAAG,cAAA,OAAO,EAAEa,MAAZ;AAAA,sCACE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBA7BF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cANF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAgDD,CAzFD;;GAAMrB,Y;UAC4BF,W;;;KAD5BE,Y;AA2FN,eAAeA,YAAf","sourcesContent":["import React, { useRef, useState, useEffect } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./NavbarDropdownMenu.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\n\r\nconst DropdownMenu = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [isActive]);\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const logout = () => {\r\n oktaAuth.signOut()\r\n }\r\n\r\n return (\r\n <li>\r\n <div className=\"navbar-user-dropdown-container\">\r\n <button className={`user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"user-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n {/* show submenu?*/}\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <NavLink to=\"/account\" onClick={onClick} className=\"top-item\">\r\n <div>\r\n <FontAwesomeIcon icon=\"user\" className=\"arrow-right-icon-top\"></FontAwesomeIcon>&nbsp;&nbsp;\r\n </div>\r\n <div className=\"item-top-text\">\r\n <span>\r\n <p>Account</p>\r\n <p>{userInfo ? userInfo.email : \"...\"}</p>\r\n </span>\r\n </div>\r\n <div className=\"arrow-right-icon-top\">\r\n <FontAwesomeIcon icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </NavLink>\r\n </li>\r\n <li>\r\n <NavLink to=\"/messages\" onClick={onClick}>\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>&nbsp;&nbsp;Messages\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </NavLink>\r\n </li>\r\n {/* <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"sliders-h\"></FontAwesomeIcon>&nbsp;&nbsp;Preferences\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li> */}\r\n <li>\r\n <a onClick={logout}>\r\n <FontAwesomeIcon icon=\"sign-out-alt\"></FontAwesomeIcon>&nbsp;&nbsp;Log out\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </li >\r\n )\r\n}\r\n\r\nexport default DropdownMenu"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\navbar\\\\dropdownMenu\\\\NavbarDropdownMenu.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useRef, useState, useEffect } from 'react';\nimport { NavLink } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./NavbarDropdownMenu.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst DropdownMenu = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const dropdownRef = useRef(null);\n const [isActive, setIsActive] = useState(false);\n\n const onClick = () => setIsActive(!isActive);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\n setIsActive(!isActive);\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (isActive) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [isActive]);\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const logout = () => {\n oktaAuth.signOut();\n };\n\n return /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"navbar-user-dropdown-container\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: `user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`,\n onClick: onClick,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"user-icon\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"down-arrow\",\n icon: \"angle-down\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n ref: dropdownRef,\n className: `user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`,\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n className: \"accountLink\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"upper-row\",\n children: \"Account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 21\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"bottom-row\",\n children: userInfo ? userInfo.email : \"...\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 21\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"arrow-right-icon\",\n icon: \"chevron-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/messages\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"envelope\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Messages\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 80,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: logout,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-out-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Log out\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 5\n }, this);\n};\n\n_s(DropdownMenu, \"fSJPYre4v1rGcIZdck7wMJJU1dU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = DropdownMenu;\nexport default DropdownMenu;\n\nvar _c;\n\n$RefreshReg$(_c, \"DropdownMenu\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/navbar/dropdownMenu/NavbarDropdownMenu.jsx"],"names":["React","useRef","useState","useEffect","NavLink","useOktaAuth","FontAwesomeIcon","DropdownMenu","authState","oktaAuth","userInfo","setUserInfo","dropdownRef","isActive","setIsActive","onClick","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","isAuthenticated","getUser","then","info","logout","signOut","email"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,MAAhB,EAAwBC,QAAxB,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,0BAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAGA,MAAMC,YAAY,GAAG,MAAM;AAAA;;AACzB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BJ,WAAW,EAA3C;AACA,QAAM,CAACK,QAAD,EAAWC,WAAX,IAA0BT,QAAQ,CAAC,IAAD,CAAxC;AAEA,QAAMU,WAAW,GAAGX,MAAM,CAAC,IAAD,CAA1B;AACA,QAAM,CAACY,QAAD,EAAWC,WAAX,IAA0BZ,QAAQ,CAAC,KAAD,CAAxC;;AACA,QAAMa,OAAO,GAAG,MAAMD,WAAW,CAAC,CAACD,QAAF,CAAjC;;A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E;AAAA,mCACE;AAAG,cAAA,OAAO,EAAEF,MAAZ;AAAA,sCACE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBA/BF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cANF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAkDD,CA3FD;;GAAMrB,Y;UAC4BF,W;;;KAD5BE,Y;AA6FN,eAAeA,YAAf","sourcesContent":["import React, { useRef, useState, useEffect } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./NavbarDropdownMenu.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\n\r\nconst DropdownMenu = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [isActive]);\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const logout = () => {\r\n oktaAuth.signOut()\r\n }\r\n\r\n return (\r\n <li>\r\n <div className=\"navbar-user-dropdown-container\">\r\n <button className={`user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"user-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n {/* show submenu?*/}\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <div >\r\n <NavLink to=\"/account\" className=\"accountLink\">\r\n <div >\r\n <div className=\"upper-row\">\r\n Account\r\n </div>\r\n\r\n <div className=\"bottom-row\">\r\n {userInfo ? userInfo.email : \"...\"}\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"arrow-right-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </NavLink>\r\n </div>\r\n </li>\r\n <li>\r\n <NavLink to=\"/messages\">\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>&nbsp;&nbsp;Messages\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </NavLink>\r\n </li>\r\n {/* <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"sliders-h\"></FontAwesomeIcon>&nbsp;&nbsp;Preferences\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li> */}\r\n <li>\r\n <a onClick={logout}>\r\n <FontAwesomeIcon icon=\"sign-out-alt\"></FontAwesomeIcon>&nbsp;&nbsp;Log out\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </li >\r\n )\r\n}\r\n\r\nexport default DropdownMenu"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\navbar\\\\dropdownMenu\\\\NavbarDropdownMenu.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useRef, useState, useEffect } from 'react';\nimport { NavLink } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./NavbarDropdownMenu.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst DropdownMenu = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const dropdownRef = useRef(null);\n const [isActive, setIsActive] = useState(false);\n\n const onClick = () => setIsActive(!isActive);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\n setIsActive(!isActive);\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (isActive) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [isActive]);\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const logout = () => {\n oktaAuth.signOut();\n };\n\n return /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"navbar-user-dropdown-container\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: `user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`,\n onClick: onClick,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"user-icon\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"down-arrow\",\n icon: \"angle-down\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n ref: dropdownRef,\n className: `user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`,\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"entry-text\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"upper-row\",\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/account\",\n children: \"[project] [new issues] [issues fixed]\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"bottom-row\",\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n children: \"[team] [time]\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"entry-icon\",\n icon: \"chevron-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 73,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/messages\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"envelope\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Messages\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: logout,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-out-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Log out\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 5\n }, this);\n};\n\n_s(DropdownMenu, \"fSJPYre4v1rGcIZdck7wMJJU1dU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = DropdownMenu;\nexport default DropdownMenu;\n\nvar _c;\n\n$RefreshReg$(_c, \"DropdownMenu\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/navbar/dropdownMenu/NavbarDropdownMenu.jsx"],"names":["React","useRef","useState","useEffect","NavLink","useOktaAuth","FontAwesomeIcon","DropdownMenu","authState","oktaAuth","userInfo","setUserInfo","dropdownRef","isActive","setIsActive","onClick","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","isAuthenticated","getUser","then","info","logout","signOut"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,MAAhB,EAAwBC,QAAxB,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,0BAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAGA,MAAMC,YAAY,GAAG,MAAM;AAAA;;AACzB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BJ,WAAW,EAA3C;AACA,QAAM,CAACK,QAAD,EAAWC,WAAX,IAA0BT,QAAQ,CAAC,IAAD,CAAxC;AAEA,QAAMU,WAAW,GAAGX,MAAM,CAAC,IAAD,CAA1B;AACA,QAAM,CAACY,QAAD,EAAWC,WAAX,IAA0BZ,QAAQ,CAAC,KAAD,CAAxC;;AACA,QAAMa,OAAO,GAAG,MAAMD,WAAW,CAAC,CAACD,QAAF,CAAjC;;AAEAV,EAAAA,SAAS,CAAC,MAAM;AACd,UAAMa,cAAc,GAAIC,CAAD,IAAO;AAC5B,UAAIL,WAAW,CAACM,OAAZ,KAAwB,IAAxB,IAAgC,CAACN,WAAW,CAACM,OAAZ,CAAoBC,QAApB,CAA6BF,CAAC,CAACG,MAA/B,CAArC,EAA6E;AAC3EN,QAAAA,WAAW,CAAC,CAACD,QAAF,CAAX;AACD;AACF,KAJD,CADc,CAOd;;;AACA,QAAIA,QAAJ,EAAc;AACZQ,MAAAA,MAAM,CAACC,gBAAP,CAAwB,OAAxB,EAAiCN,cAAjC;AACD;;AAED,WAAO,MAAM;AACXK,MAAAA,MAAM,CAACE,mBAAP,CAA2B,OAA3B,EAAoCP,cAApC;AACD,KAFD;AAID,GAhBQ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AAA,sBADF,eAME;AAAK,gBAAA,SAAS,EAAC,YAAf;AAAA,uCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,sBANF;AAAA;AAAA;AAAA;AAAA;AAAA,oBADF,eAaE;AAAA,qCACE,QAAC,eAAD;AAAiB,gBAAA,SAAS,EAAC,YAA3B;AAAwC,gBAAA,IAAI,EAAC;AAA7C;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,oBAbF;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF,eAkBE;AAAA,mCACE,QAAC,OAAD;AAAS,cAAA,EAAE,EAAC,WAAZ;AAAA,sCACE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBADF,mCAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC,eAAtB;AAAsC,gBAAA,SAAS,EAAC;AAAhD;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBAlBF,eA8BE;AAAA,mCACE;AAAG,cAAA,OAAO,EAAEe,MAAZ;AAAA,sCACE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBA9BF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cANF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAiDD,CA1FD;;GAAMrB,Y;UAC4BF,W;;;KAD5BE,Y;AA4FN,eAAeA,YAAf","sourcesContent":["import React, { useRef, useState, useEffect } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./NavbarDropdownMenu.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\n\r\nconst DropdownMenu = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [isActive]);\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const logout = () => {\r\n oktaAuth.signOut()\r\n }\r\n\r\n return (\r\n <li>\r\n <div className=\"navbar-user-dropdown-container\">\r\n <button className={`user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"user-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n {/* show submenu?*/}\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <NavLink to=\"/account\">\r\n [project] [new issues] [issues fixed]\r\n </NavLink>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [team] [time]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </li>\r\n <li>\r\n <NavLink to=\"/messages\">\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>&nbsp;&nbsp;Messages\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </NavLink>\r\n </li>\r\n {/* <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"sliders-h\"></FontAwesomeIcon>&nbsp;&nbsp;Preferences\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li> */}\r\n <li>\r\n <a onClick={logout}>\r\n <FontAwesomeIcon icon=\"sign-out-alt\"></FontAwesomeIcon>&nbsp;&nbsp;Log out\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </li >\r\n )\r\n}\r\n\r\nexport default DropdownMenu"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment