283f8cb046aeb49835fb3003841e4d63.json 6.29 KB
Newer Older
1
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\home\\\\Home.jsx\",\n    _s = $RefreshSig$();\n\nimport React, { useState, useEffect } from 'react';\nimport { NavLink } from 'react-router-dom';\nimport \"./Home.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport Updates from './updates/Updates';\nimport useMessages from '../../util/useMessages';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst Home = () => {\n  _s();\n\n  const [userInfo, setUserInfo] = useState(null);\n  const idToken = JSON.parse(localStorage.getItem('okta-token-storage')).idToken.claims;\n  const messages = useMessages();\n  useEffect(() => {\n    setUserInfo(idToken);\n  }, []);\n\n  if (userInfo) {\n    return /*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"page-content-container\",\n      children: [/*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"content-header\",\n        children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n          className: \"welcome-text\",\n          children: [\"Welcome \", userInfo.name, \"!\"]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 21,\n          columnNumber: 11\n        }, this), /*#__PURE__*/_jsxDEV(NavLink, {\n          to: \"/reportissue\",\n          children: /*#__PURE__*/_jsxDEV(\"button\", {\n            className: \"report-new-issue-button\",\n            children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n              icon: \"exclamation-triangle\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 24,\n              columnNumber: 15\n            }, this), \"\\xA0\\xA0Report issues\"]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 23,\n            columnNumber: 13\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 22,\n          columnNumber: 11\n        }, this)]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 20,\n        columnNumber: 9\n      }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"homepage-content\",\n        children: /*#__PURE__*/_jsxDEV(Updates, {}, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 30,\n          columnNumber: 11\n        }, this)\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 29,\n        columnNumber: 9\n      }, this)]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 19,\n      columnNumber: 7\n    }, this);\n  } else {\n    // Render a loading placeholder while user data gets loaded from localstorage\n    return /*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"homepage-container\",\n      children: /*#__PURE__*/_jsxDEV(\"h3\", {\n        children: \"...\"\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 40,\n        columnNumber: 9\n      }, this)\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 39,\n      columnNumber: 7\n    }, this);\n  }\n};\n\n_s(Home, \"hWAI/bNq0ggLUgA8loZKeLHJePQ=\", false, function () {\n  return [useMessages];\n});\n\n_c = Home;\nexport default Home;\n\nvar _c;\n\n$RefreshReg$(_c, \"Home\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/home/Home.jsx"],"names":["React","useState","useEffect","NavLink","FontAwesomeIcon","Updates","useMessages","Home","userInfo","setUserInfo","idToken","JSON","parse","localStorage","getItem","claims","messages","name"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAO,YAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,WAAP,MAAwB,wBAAxB;;;AAEA,MAAMC,IAAI,GAAG,MAAM;AAAA;;AACjB,QAAM,CAACC,QAAD,EAAWC,WAAX,IAA0BR,QAAQ,CAAC,IAAD,CAAxC;AACA,QAAMS,OAAO,GAAGC,IAAI,CAACC,KAAL,CAAWC,YAAY,CAACC,OAAb,CAAqB,oBAArB,CAAX,EAAuDJ,OAAvD,CAA+DK,MAA/E;AACA,QAAMC,QAAQ,GAAGV,WAAW,EAA5B;AAEAJ,EAAAA,SAAS,CAAC,MAAM;AACdO,IAAAA,WAAW,CAACC,OAAD,CAAX;AACD,GAFQ,EAEN,EAFM,CAAT;;AAIA,MAAIF,QAAJ,EAAc;AACZ,wBACE;AAAK,MAAA,SAAS,EAAC,wBAAf;AAAA,8BACE;AAAK,QAAA,SAAS,EAAC,gBAAf;AAAA,gCACE;AAAI,UAAA,SAAS,EAAC,cAAd;AAAA,iCAAsCA,QAAQ,CAACS,IAA/C;AAAA;AAAA;AAAA;AAAA;AAAA,gBADF,eAEE,QAAC,OAAD;AAAS,UAAA,EAAE,EAAC,cAAZ;AAAA,iCACE;AAAQ,YAAA,SAAS,EAAC,yBAAlB;AAAA,oCACE,QAAC,eAAD;AAAiB,cAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,oBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,gBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,cADF,eAUE;AAAK,QAAA,SAAS,EAAC,kBAAf;AAAA,+BACE,QAAC,OAAD;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAVF;AAAA;AAAA;AAAA;AAAA;AAAA,YADF;AAiBD,GAlBD,MAmBK;AACH;AACA,wBACE;AAAK,MAAA,SAAS,EAAC,oBAAf;AAAA,6BACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YADF;AAKD;AAGF,CAtCD;;GAAMV,I;UAGaD,W;;;KAHbC,I;AAwCN,eAAeA,IAAf","sourcesContent":["import React, { useState, useEffect } from 'react'\r\nimport { NavLink } from 'react-router-dom'\r\nimport \"./Home.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport Updates from './updates/Updates'\r\nimport useMessages from '../../util/useMessages'\r\n\r\nconst Home = () => {\r\n  const [userInfo, setUserInfo] = useState(null);\r\n  const idToken = JSON.parse(localStorage.getItem('okta-token-storage')).idToken.claims\r\n  const messages = useMessages()\r\n\r\n  useEffect(() => {\r\n    setUserInfo(idToken)\r\n  }, [])\r\n\r\n  if (userInfo) {\r\n    return (\r\n      <div className=\"page-content-container\">\r\n        <div className=\"content-header\">\r\n          <h2 className=\"welcome-text\">Welcome {userInfo.name}!</h2>\r\n          <NavLink to=\"/reportissue\">\r\n            <button className=\"report-new-issue-button\">\r\n              <FontAwesomeIcon icon=\"exclamation-triangle\"></FontAwesomeIcon>\r\n              &nbsp;&nbsp;Report issues\r\n            </button>\r\n          </NavLink>\r\n        </div>\r\n        <div className=\"homepage-content\">\r\n          <Updates />\r\n        </div>\r\n      </div>\r\n    )\r\n\r\n  }\r\n  else {\r\n    // Render a loading placeholder while user data gets loaded from localstorage\r\n    return (\r\n      <div className=\"homepage-container\">\r\n        <h3>...</h3>\r\n      </div>\r\n    )\r\n  }\r\n\r\n\r\n}\r\n\r\nexport default Home"]},"metadata":{},"sourceType":"module"}