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

refactoring

parent 473a37b4
This diff is collapsed.
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\updateUserData\\\\UpdateUserData.js\",\n _s = $RefreshSig$();\n\nimport React, { useEffect, useState } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useOktaAuth } from '@okta/okta-react';\nimport UpdateUserDataModal from '../../components/updateUserData/updateUserDataModal/UpdateUserDataModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst UpdateUserData = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const [name, setName] = useState('');\n const [email, setEmail] = useState('');\n const [updateUserDataModalState, setUpdateUserDataModalState] = useState(false);\n\n const toggleUpdateUserDataModalState = () => setUpdateUserDataModalState(!updateUserDataModalState);\n\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else if (authState.isAuthenticated && updateUserDataModalState == false) {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth, updateUserDataModalState]); // Update if authState changes\n\n useEffect(() => {\n userInfo && setName(userInfo.name);\n userInfo && setEmail(userInfo.email);\n }, [userInfo]);\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"personal-information-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-circle\",\n className: \"user-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 40,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Personal information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n onClick: toggleUpdateUserDataModalState,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"pen\",\n className: \"pen-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 11\n }, this), \"Edit\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 39,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Name:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? name : \"Fetching name\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? email : \"Fetching email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${updateUserDataModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(UpdateUserDataModal, {\n removeModal: () => setUpdateUserDataModalState(false)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 5\n }, this);\n};\n\n_s(UpdateUserData, \"TVJKyWZdBHB4T7R5lFB40t17n2E=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = UpdateUserData;\nexport default UpdateUserData;\n\nvar _c;\n\n$RefreshReg$(_c, \"UpdateUserData\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/updateUserData/UpdateUserData.js"],"names":["React","useEffect","useState","FontAwesomeIcon","useOktaAuth","UpdateUserDataModal","UpdateUserData","authState","oktaAuth","userInfo","setUserInfo","name","setName","email","setEmail","updateUserDataModalState","setUpdateUserDataModalState","toggleUpdateUserDataModalState","isAuthenticated","getUser","then","info"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,QAA3B,QAA2C,OAA3C;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAOC,mBAAP,MAAgC,yEAAhC;;;AAEA,MAAMC,cAAc,GAAG,MAAM;AAAA;;AAC3B,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BJ,WAAW,EAA3C;AACA,QAAM,CAACK,QAAD,EAAWC,WAAX,IAA0BR,QAAQ,CAAC,IAAD,CAAxC;AAEA,QAAM,CAACS,IAAD,EAAOC,OAAP,IAAkBV,QAAQ,CAAC,EAAD,CAAhC;AACA,QAAM,CAACW,KAAD,EAAQC,QAAR,IAAoBZ,QAAQ,CAAC,EAAD,CAAlC;AAEA,QAAM,CAACa,wBAAD,EAA2BC,2BAA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,EAAC,SAAf;AAAA,6BACE;AAAA,gCACE;AAAA,iCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,gBADF,eAIE;AAAA,oBACGR,QAAQ,GAAGE,IAAH,GAAU;AADrB;AAAA;AAAA;AAAA;AAAA,gBAJF,eAOE;AAAA,iCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,gBAPF,eAUE;AAAA,oBACGF,QAAQ,GAAGI,KAAH,GAAW;AADtB;AAAA;AAAA;AAAA;AAAA,gBAVF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YATF,eAyBE;AAAK,MAAA,SAAS,EAAG,SAAQE,wBAAwB,GAAG,QAAH,GAAc,UAAW,EAA1E;AAAA,6BACE,QAAC,mBAAD;AAAqB,QAAA,WAAW,EAAE,MAAMC,2BAA2B,CAAC,KAAD;AAAnE;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAzBF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA+BD,CA9DD;;GAAMV,c;UAC4BF,W;;;KAD5BE,c;AAgEN,eAAeA,cAAf","sourcesContent":["import React, { useEffect, useState } from 'react'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport UpdateUserDataModal from '../../components/updateUserData/updateUserDataModal/UpdateUserDataModal';\r\n\r\nconst UpdateUserData = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const [name, setName] = useState('')\r\n const [email, setEmail] = useState('');\r\n\r\n const [updateUserDataModalState, setUpdateUserDataModalState] = useState(false)\r\n const toggleUpdateUserDataModalState = () => setUpdateUserDataModalState(!updateUserDataModalState)\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 if (authState.isAuthenticated && updateUserDataModalState == false) {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth, updateUserDataModalState]); // Update if authState changes\r\n\r\n useEffect(() => {\r\n userInfo && (\r\n setName(userInfo.name)\r\n )\r\n\r\n userInfo && (\r\n setEmail(userInfo.email)\r\n )\r\n }, [userInfo])\r\n\r\n return (\r\n <div className=\"personal-information-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"user-circle\" className=\"user-icon\"></FontAwesomeIcon>\r\n <h5>Personal information</h5>\r\n <button onClick={toggleUpdateUserDataModalState}>\r\n <FontAwesomeIcon icon=\"pen\" className=\"pen-icon\"></FontAwesomeIcon>\r\n Edit\r\n </button>\r\n </div>\r\n <div className=\"content\">\r\n <ul>\r\n <li>\r\n <b>Name:</b>\r\n </li>\r\n <li>\r\n {userInfo ? name : \"Fetching name\"}\r\n </li>\r\n <li>\r\n <b>Email</b>\r\n </li>\r\n <li>\r\n {userInfo ? email : \"Fetching email\"}\r\n </li>\r\n </ul>\r\n </div>\r\n <div className={`modal ${updateUserDataModalState ? \"active\" : \"inactive\"}`}>\r\n <UpdateUserDataModal removeModal={() => setUpdateUserDataModalState(false)} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default UpdateUserData\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\account\\\\Account.jsx\";\n// rfce\nimport React, { useState, useEffect } from 'react';\nimport \"./Account.css\";\nimport ConfirmRemoveAccountModal from \"../../components/removeAccount/confirmRemoveAccountModal/ConfirmRemoveAccountModal\";\nimport ChangePassword from '../../components/changePassword/ChangePassword';\nimport RemoveAccount from '../../components/removeAccount/RemoveAccount';\nimport UpdateUserData from '../../components/updateUserData/UpdateUserData';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nfunction Account() {\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: \"Account information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 14,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 13,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"accountpage-content\",\n children: [/*#__PURE__*/_jsxDEV(ChangePassword, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 18,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(RemoveAccount, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 19,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(UpdateUserData, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 20,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 16,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 12,\n columnNumber: 5\n }, this);\n}\n\n_c = Account;\nexport default Account;\n\nvar _c;\n\n$RefreshReg$(_c, \"Account\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/account/Account.jsx"],"names":["React","useState","useEffect","ConfirmRemoveAccountModal","ChangePassword","RemoveAccount","UpdateUserData","Account"],"mappings":";AAAA;AACA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,OAAO,eAAP;AAEA,OAAOC,yBAAP,MAAsC,oFAAtC;AACA,OAAOC,cAAP,MAA2B,gDAA3B;AACA,OAAOC,aAAP,MAA0B,8CAA1B;AACA,OAAOC,cAAP,MAA2B,gDAA3B;;;AAEA,SAASC,OAAT,GAAmB;AACjB,sBACE;AAAK,IAAA,SAAS,EAAC,wBAAf;AAAA,4BACE;AAAK,MAAA,SAAS,EAAC,gBAAf;AAAA,6BACE;AAAI,QAAA,SAAS,EAAC,cAAd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YADF,eAIE;AAAK,MAAA,SAAS,EAAC,qBAAf;AAAA,8BAEE,QAAC,cAAD;AAAA;AAAA;AAAA;AAAA,cAFF,eAGE,QAAC,aAAD;AAAA;AAAA;AAAA;AAAA,cAHF,eAIE,QAAC,cAAD;AAAA;AAAA;AAAA;AAAA,cAJF;AAAA;AAAA;AAAA;AAAA;AAAA,YAJF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAcD;;KAfQA,O;AAiBT,eAAeA,OAAf","sourcesContent":["// rfce\r\nimport React, { useState, useEffect } from 'react'\r\nimport \"./Account.css\"\r\n\r\nimport ConfirmRemoveAccountModal from \"../../components/removeAccount/confirmRemoveAccountModal/ConfirmRemoveAccountModal\"\r\nimport ChangePassword from '../../components/changePassword/ChangePassword';\r\nimport RemoveAccount from '../../components/removeAccount/RemoveAccount';\r\nimport UpdateUserData from '../../components/updateUserData/UpdateUserData';\r\n\r\nfunction Account() {\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"welcome-text\">Account information</h2>\r\n </div>\r\n <div className=\"accountpage-content\">\r\n\r\n <ChangePassword />\r\n <RemoveAccount />\r\n <UpdateUserData />\r\n\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default Account\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\account\\\\Account.jsx\",\n _s = $RefreshSig$();\n\n// rfce\nimport React, { useState, useEffect } from 'react';\nimport \"./Account.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useOktaAuth } from '@okta/okta-react';\nimport ConfirmRemoveAccountModal from \"./confirmRemoveAccountModal/ConfirmRemoveAccountModal\";\nimport UpdateUserDataModal from './updateUserData/UpdateUserDataModal';\nimport ChangePassword from '../../components/changePassword/ChangePassword';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nfunction Account() {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const [name, setName] = useState('');\n const [email, setEmail] = useState('');\n const [updateUserDataModalState, setUpdateUserDataModalState] = useState(false);\n\n const toggleUpdateUserDataModalState = () => setUpdateUserDataModalState(!updateUserDataModalState);\n\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false);\n\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState);\n\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else if (authState.isAuthenticated && updateUserDataModalState == false) {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth, updateUserDataModalState]); // Update if authState changes\n\n useEffect(() => {\n userInfo && setName(userInfo.name);\n userInfo && setEmail(userInfo.email);\n }, [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: \"Account information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"accountpage-content\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"personal-information-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-circle\",\n className: \"user-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Personal information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n onClick: toggleUpdateUserDataModalState,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"pen\",\n className: \"pen-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 15\n }, this), \"Edit\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Name:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? name : \"Fetching name\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 69,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? email : \"Fetching email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(ChangePassword, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"deactivate-account-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"trash\",\n className: \"trash-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Delete account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 82,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Your account and all your data will be permanently deleted\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n onClick: toggleConfirmAccountRemoveModalState,\n children: [\"Delete\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"exclamation-triangle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 92,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 81,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${confirmAccountRemoveModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(ConfirmRemoveAccountModal, {\n removeModal: () => setConfirmAccountRemoveModalState(false)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 97,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${updateUserDataModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(UpdateUserDataModal, {\n removeModal: () => setUpdateUserDataModalState(false)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 101,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 100,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 5\n }, this);\n}\n\n_s(Account, \"mspcEj1apxAoqwV3paiS9+TXXfg=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = Account;\nexport default Account;\n\nvar _c;\n\n$RefreshReg$(_c, \"Account\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/account/Account.jsx"],"names":["React","useState","useEffect","FontAwesomeIcon","useOktaAuth","ConfirmRemoveAccountModal","UpdateUserDataModal","ChangePassword","Account","authState","oktaAuth","userInfo","setUserInfo","name","setName","email","setEmail","updateUserDataModalState","setUpdateUserDataModalState","toggleUpdateUserDataModalState","confirmAccountRemoveModalState","setConfirmAccountRemoveModalState","toggleConfirmAccountRemoveModalState","isAuthenticated","getUser","then","info"],"mappings":";;;AAAA;AACA,OAAOA,KAAP,I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EAA1E;AAAA,6BACE,QAAC,mBAAD;AAAqB,QAAA,WAAW,EAAE,MAAMC,2BAA2B,CAAC,KAAD;AAAnE;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAtDF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA4DD;;GA/FQV,O;UACyBJ,W;;;KADzBI,O;AAiGT,eAAeA,OAAf","sourcesContent":["// rfce\r\nimport React, { useState, useEffect } from 'react'\r\nimport \"./Account.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport ConfirmRemoveAccountModal from \"./confirmRemoveAccountModal/ConfirmRemoveAccountModal\"\r\nimport UpdateUserDataModal from './updateUserData/UpdateUserDataModal';\r\nimport ChangePassword from '../../components/changePassword/ChangePassword';\r\n\r\nfunction Account() {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const [name, setName] = useState('')\r\n const [email, setEmail] = useState('');\r\n\r\n const [updateUserDataModalState, setUpdateUserDataModalState] = useState(false)\r\n const toggleUpdateUserDataModalState = () => setUpdateUserDataModalState(!updateUserDataModalState)\r\n\r\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false)\r\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState)\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 if (authState.isAuthenticated && updateUserDataModalState == false) {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth, updateUserDataModalState]); // Update if authState changes\r\n\r\n useEffect(() => {\r\n userInfo && (\r\n setName(userInfo.name)\r\n )\r\n\r\n userInfo && (\r\n setEmail(userInfo.email)\r\n )\r\n }, [userInfo])\r\n\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"welcome-text\">Account information</h2>\r\n </div>\r\n <div className=\"accountpage-content\">\r\n\r\n <div className=\"personal-information-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"user-circle\" className=\"user-icon\"></FontAwesomeIcon>\r\n <h5>Personal information</h5>\r\n <button onClick={toggleUpdateUserDataModalState}>\r\n <FontAwesomeIcon icon=\"pen\" className=\"pen-icon\"></FontAwesomeIcon>\r\n Edit\r\n </button>\r\n </div>\r\n <div className=\"content\">\r\n <ul>\r\n <li>\r\n <b>Name:</b>\r\n </li>\r\n <li>\r\n {userInfo ? name : \"Fetching name\"}\r\n </li>\r\n <li>\r\n <b>Email</b>\r\n </li>\r\n <li>\r\n {userInfo ? email : \"Fetching email\"}\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n <ChangePassword />\r\n\r\n <div className=\"deactivate-account-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"trash\" className=\"trash-icon\"></FontAwesomeIcon>\r\n <h5>Delete account</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>\r\n Your account and all your data will be permanently deleted\r\n </p>\r\n <button onClick={toggleConfirmAccountRemoveModalState}>\r\n Delete&nbsp;\r\n <FontAwesomeIcon icon=\"exclamation-triangle\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div className={`modal ${confirmAccountRemoveModalState ? \"active\" : \"inactive\"}`}>\r\n <ConfirmRemoveAccountModal removeModal={() => setConfirmAccountRemoveModalState(false)} />\r\n </div>\r\n <div className={`modal ${updateUserDataModalState ? \"active\" : \"inactive\"}`}>\r\n <UpdateUserDataModal removeModal={() => setUpdateUserDataModalState(false)} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default Account\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\account\\\\Account.jsx\",\n _s = $RefreshSig$();\n\n// rfce\nimport React, { useState, useEffect } from 'react';\nimport \"./Account.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useOktaAuth } from '@okta/okta-react';\nimport ConfirmRemoveAccountModal from \"./confirmRemoveAccountModal/ConfirmRemoveAccountModal\";\nimport UpdateUserDataModal from './updateUserData/UpdateUserDataModal';\nimport ChangePassword from '../../components/changePassword/ChangePassword';\nimport RemoveAccount from '../../components/removeAccount/RemoveAccount';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nfunction Account() {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const [name, setName] = useState('');\n const [email, setEmail] = useState('');\n const [updateUserDataModalState, setUpdateUserDataModalState] = useState(false);\n\n const toggleUpdateUserDataModalState = () => setUpdateUserDataModalState(!updateUserDataModalState);\n\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else if (authState.isAuthenticated && updateUserDataModalState == false) {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth, updateUserDataModalState]); // Update if authState changes\n\n useEffect(() => {\n userInfo && setName(userInfo.name);\n userInfo && setEmail(userInfo.email);\n }, [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: \"Account information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"accountpage-content\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"personal-information-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-circle\",\n className: \"user-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Personal information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n onClick: toggleUpdateUserDataModalState,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"pen\",\n className: \"pen-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 15\n }, this), \"Edit\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Name:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? name : \"Fetching name\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? email : \"Fetching email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(ChangePassword, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(RemoveAccount, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${updateUserDataModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(UpdateUserDataModal, {\n removeModal: () => setUpdateUserDataModalState(false)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 81,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 80,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 5\n }, this);\n}\n\n_s(Account, \"TVJKyWZdBHB4T7R5lFB40t17n2E=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = Account;\nexport default Account;\n\nvar _c;\n\n$RefreshReg$(_c, \"Account\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/account/Account.jsx"],"names":["React","useState","useEffect","FontAwesomeIcon","useOktaAuth","ConfirmRemoveAccountModal","UpdateUserDataModal","ChangePassword","RemoveAccount","Account","authState","oktaAuth","userInfo","setUserInfo","name","setName","email","setEmail","updateUserDataMod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AA;AAAA;AAAA;AAAA,oBAPF,eAUE;AAAA,wBACGF,QAAQ,GAAGI,KAAH,GAAW;AADtB;AAAA;AAAA;AAAA;AAAA,oBAVF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,gBATF;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eA6BE,QAAC,cAAD;AAAA;AAAA;AAAA;AAAA,cA7BF,eA8BE,QAAC,aAAD;AAAA;AAAA;AAAA;AAAA,cA9BF;AAAA;AAAA;AAAA;AAAA;AAAA,YAJF,eAoCE;AAAK,MAAA,SAAS,EAAG,SAAQE,wBAAwB,GAAG,QAAH,GAAc,UAAW,EAA1E;AAAA,6BACE,QAAC,mBAAD;AAAqB,QAAA,WAAW,EAAE,MAAMC,2BAA2B,CAAC,KAAD;AAAnE;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YApCF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA0CD;;GA1EQV,O;UACyBL,W;;;KADzBK,O;AA4ET,eAAeA,OAAf","sourcesContent":["// rfce\r\nimport React, { useState, useEffect } from 'react'\r\nimport \"./Account.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport ConfirmRemoveAccountModal from \"./confirmRemoveAccountModal/ConfirmRemoveAccountModal\"\r\nimport UpdateUserDataModal from './updateUserData/UpdateUserDataModal';\r\nimport ChangePassword from '../../components/changePassword/ChangePassword';\r\nimport RemoveAccount from '../../components/removeAccount/RemoveAccount';\r\n\r\nfunction Account() {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const [name, setName] = useState('')\r\n const [email, setEmail] = useState('');\r\n\r\n const [updateUserDataModalState, setUpdateUserDataModalState] = useState(false)\r\n const toggleUpdateUserDataModalState = () => setUpdateUserDataModalState(!updateUserDataModalState)\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 if (authState.isAuthenticated && updateUserDataModalState == false) {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth, updateUserDataModalState]); // Update if authState changes\r\n\r\n useEffect(() => {\r\n userInfo && (\r\n setName(userInfo.name)\r\n )\r\n\r\n userInfo && (\r\n setEmail(userInfo.email)\r\n )\r\n }, [userInfo])\r\n\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"welcome-text\">Account information</h2>\r\n </div>\r\n <div className=\"accountpage-content\">\r\n\r\n <div className=\"personal-information-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"user-circle\" className=\"user-icon\"></FontAwesomeIcon>\r\n <h5>Personal information</h5>\r\n <button onClick={toggleUpdateUserDataModalState}>\r\n <FontAwesomeIcon icon=\"pen\" className=\"pen-icon\"></FontAwesomeIcon>\r\n Edit\r\n </button>\r\n </div>\r\n <div className=\"content\">\r\n <ul>\r\n <li>\r\n <b>Name:</b>\r\n </li>\r\n <li>\r\n {userInfo ? name : \"Fetching name\"}\r\n </li>\r\n <li>\r\n <b>Email</b>\r\n </li>\r\n <li>\r\n {userInfo ? email : \"Fetching email\"}\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n <ChangePassword />\r\n <RemoveAccount />\r\n </div>\r\n <div className={`modal ${updateUserDataModalState ? \"active\" : \"inactive\"}`}>\r\n <UpdateUserDataModal removeModal={() => setUpdateUserDataModalState(false)} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default Account\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\account\\\\Account.jsx\",\n _s = $RefreshSig$();\n\n// rfce\nimport React, { useState, useEffect } from 'react';\nimport \"./Account.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useOktaAuth } from '@okta/okta-react';\nimport ConfirmRemoveAccountModal from \"./confirmRemoveAccountModal/ConfirmRemoveAccountModal\";\nimport UpdateUserDataModal from './updateUserData/UpdateUserDataModal';\nimport ChangePassword from '../../components/changePassword/ChangePassword';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nfunction Account() {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const [name, setName] = useState('');\n const [email, setEmail] = useState('');\n const [updateUserDataModalState, setUpdateUserDataModalState] = useState(false);\n\n const toggleUpdateUserDataModalState = () => setUpdateUserDataModalState(!updateUserDataModalState);\n\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false);\n\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState);\n\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else if (authState.isAuthenticated && updateUserDataModalState == false) {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth, updateUserDataModalState]); // Update if authState changes\n\n useEffect(() => {\n userInfo && setName(userInfo.name);\n userInfo && setEmail(userInfo.email);\n }, [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: \"Account information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"accountpage-content\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"personal-information-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-circle\",\n className: \"user-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Personal information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n onClick: toggleUpdateUserDataModalState,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"pen\",\n className: \"pen-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 15\n }, this), \"Edit\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Name:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? name : \"Fetching name\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 69,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? email : \"Fetching email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(ChangePassword, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"deactivate-account-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"trash\",\n className: \"trash-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Delete account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 82,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Your account and all your data will be permanently deleted\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n onClick: toggleConfirmAccountRemoveModalState,\n children: \"Delete\\xA0\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 81,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${confirmAccountRemoveModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(ConfirmRemoveAccountModal, {\n removeModal: () => setConfirmAccountRemoveModalState(false)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 97,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${updateUserDataModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(UpdateUserDataModal, {\n removeModal: () => setUpdateUserDataModalState(false)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 100,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 5\n }, this);\n}\n\n_s(Account, \"mspcEj1apxAoqwV3paiS9+TXXfg=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = Account;\nexport default Account;\n\nvar _c;\n\n$RefreshReg$(_c, \"Account\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/account/Account.jsx"],"names":["React","useState","useEffect","FontAwesomeIcon","useOktaAuth","ConfirmRemoveAccountModal","UpdateUserDataModal","ChangePassword","Account","authState","oktaAuth","userInfo","setUserInfo","name","setName","email","setEmail","updateUserDataModalState","setUpdateUserDataModalState","toggleUpdateUserDataModalState","confirmAccountRemoveModalState","setConfirmAccountRemoveModalState","toggleConfirmAccountRemoveModalState","isAuthenticated","getUser","then","info"],"mappings":";;;AAAA;AACA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,OAAO,eAAP;AACA,SAASC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AA;AAAA;AAAA;AAAA;AAAA,UADF;AA2DD;;GA9FQV,O;UACyBJ,W;;;KADzBI,O;AAgGT,eAAeA,OAAf","sourcesContent":["// rfce\r\nimport React, { useState, useEffect } from 'react'\r\nimport \"./Account.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport ConfirmRemoveAccountModal from \"./confirmRemoveAccountModal/ConfirmRemoveAccountModal\"\r\nimport UpdateUserDataModal from './updateUserData/UpdateUserDataModal';\r\nimport ChangePassword from '../../components/changePassword/ChangePassword';\r\n\r\nfunction Account() {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const [name, setName] = useState('')\r\n const [email, setEmail] = useState('');\r\n\r\n const [updateUserDataModalState, setUpdateUserDataModalState] = useState(false)\r\n const toggleUpdateUserDataModalState = () => setUpdateUserDataModalState(!updateUserDataModalState)\r\n\r\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false)\r\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState)\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 if (authState.isAuthenticated && updateUserDataModalState == false) {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth, updateUserDataModalState]); // Update if authState changes\r\n\r\n useEffect(() => {\r\n userInfo && (\r\n setName(userInfo.name)\r\n )\r\n\r\n userInfo && (\r\n setEmail(userInfo.email)\r\n )\r\n }, [userInfo])\r\n\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"welcome-text\">Account information</h2>\r\n </div>\r\n <div className=\"accountpage-content\">\r\n\r\n <div className=\"personal-information-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"user-circle\" className=\"user-icon\"></FontAwesomeIcon>\r\n <h5>Personal information</h5>\r\n <button onClick={toggleUpdateUserDataModalState}>\r\n <FontAwesomeIcon icon=\"pen\" className=\"pen-icon\"></FontAwesomeIcon>\r\n Edit\r\n </button>\r\n </div>\r\n <div className=\"content\">\r\n <ul>\r\n <li>\r\n <b>Name:</b>\r\n </li>\r\n <li>\r\n {userInfo ? name : \"Fetching name\"}\r\n </li>\r\n <li>\r\n <b>Email</b>\r\n </li>\r\n <li>\r\n {userInfo ? email : \"Fetching email\"}\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n <ChangePassword />\r\n\r\n <div className=\"deactivate-account-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"trash\" className=\"trash-icon\"></FontAwesomeIcon>\r\n <h5>Delete account</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>\r\n Your account and all your data will be permanently deleted\r\n </p>\r\n <button onClick={toggleConfirmAccountRemoveModalState}>\r\n Delete&nbsp;\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div className={`modal ${confirmAccountRemoveModalState ? \"active\" : \"inactive\"}`}>\r\n <ConfirmRemoveAccountModal removeModal={() => setConfirmAccountRemoveModalState(false)} />\r\n </div>\r\n <div className={`modal ${updateUserDataModalState ? \"active\" : \"inactive\"}`}>\r\n <UpdateUserDataModal removeModal={() => setUpdateUserDataModalState(false)} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default Account\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\updateUserData\\\\updateUserDataModal\\\\UpdateUserDataModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect } from 'react';\nimport \"./UpdateUserDataModal.css\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport config from '../../../config';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst UpdateUserDataModal = ({\n removeModal\n}) => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const accessToken = oktaAuth.getAccessToken();\n\n const stopProp = e => {\n e.stopPropagation();\n };\n\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 useEffect(() => {\n userInfo && setFirstname(userInfo.given_name);\n userInfo && setLastname(userInfo.family_name);\n userInfo && setUsername(userInfo.email);\n }, [userInfo]);\n const [firstname, setFirstname] = useState('');\n const [lastname, setLastname] = useState('');\n const [username, setUsername] = useState('');\n\n const handlefirstnameChange = e => {\n setFirstname(e.target.value);\n };\n\n const handlelastnameChange = e => {\n setLastname(e.target.value);\n };\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n const userInputData = JSON.stringify({\n firstname: `${firstname}`,\n lastname: `${lastname}`,\n email: `${username}`\n });\n const updateUserDataRequestOptions = {\n method: 'PUT',\n body: userInputData\n };\n\n const handleUpdateUserDataFormSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.updateUserDataURL, updateUserDataRequestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n removeModal();\n }\n });\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"updateUserDataModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Update information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n userDataSubmitForm: true,\n children: /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleUpdateUserDataFormSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"First name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"firstname\",\n type: \"text\",\n value: firstname,\n onChange: handlefirstnameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Last Name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"lastname\",\n type: \"text\",\n value: lastname,\n onChange: handlelastnameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 105,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 103,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"buttonContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: \"noButton\",\n onClick: e => removeModal(),\n children: \"Cancel\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 111,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"yesButton\",\n type: \"submit\",\n children: \"Update\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 110,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 85,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 5\n }, this);\n};\n\n_s(UpdateUserDataModal, \"AxzdzHC979Yq9E6/6HJDjeCl4CA=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = UpdateUserDataModal;\nexport default UpdateUserDataModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"UpdateUserDataModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/updateUserData/updateUserDataModal/UpdateUserDataModal.jsx"],"names":["React","useState","useEffect","useOktaAuth","config","UpdateUserDataModal","removeModal","authState","oktaAuth","userInfo","setUserInfo","accessToken","getAccessToken","stopProp","e","stopPropagation","isAuthenticated","getUser","then","info","setFirstname","given_name","setLastname","family_name","setUsername","email","firstname","lastname","username","handlefirstnameChange","target","value","handlelastnameChange","handleUsernameChange","userInputData","JSON","stringify","updateUserDataRequestOptions","method","body","handleUpdateUserDataFormSubmit","preventDefault","fetch","serviceAPI","updateUserDataURL","res","ok","window","alert","Promise","reject"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,OAAO,2BAAP;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,mBAAmB,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAqB;AAAA;;AAC/C,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BL,WAAW,EAA3C;AACA,QAAM,CAACM,QAAD,EAAWC,WAAX,IAA0BT,QAAQ,CAAC,IAAD,CAAxC;AACA,QAAMU,WAAW,GAAGH,QAAQ,CAACI,cAAT,EAApB;;AAEA,QAAMC,QAAQ,GAAGC,CAAC,IAAI;AACpBA,IA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AEE,cAAA,KAAK,EAAEF,QAFT;AAGE,cAAA,QAAQ,EAAEK;AAHZ;AAAA;AAAA;AAAA;AAAA,oBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,kBARF,eAeE;AAAA,8CAEE;AACE,cAAA,EAAE,EAAC,OADL;AACa,cAAA,IAAI,EAAC,MADlB;AAEE,cAAA,KAAK,EAAEJ,QAFT;AAGE,cAAA,QAAQ,EAAEK;AAHZ;AAAA;AAAA;AAAA;AAAA,oBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAfF,eAsBE;AAAK,YAAA,SAAS,EAAC,iBAAf;AAAA,oCACE;AAAQ,cAAA,SAAS,EAAC,UAAlB;AAA6B,cAAA,OAAO,EAAEnB,CAAC,IAAIR,WAAW,EAAtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBADF,eAIE;AAAQ,cAAA,SAAS,EAAC,WAAlB;AAA8B,cAAA,IAAI,EAAC,QAAnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAtBF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAwCD,CArHD;;GAAMD,mB;UAC4BF,W;;;KAD5BE,mB;AAuHN,eAAeA,mBAAf","sourcesContent":["import React, { useState, useEffect } from 'react'\r\nimport \"./UpdateUserDataModal.css\"\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport config from '../../../config';\r\n\r\nconst UpdateUserDataModal = ({ removeModal }) => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n const accessToken = oktaAuth.getAccessToken();\r\n\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\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 useEffect(() => {\r\n userInfo && (\r\n setFirstname(userInfo.given_name)\r\n )\r\n\r\n userInfo && (\r\n setLastname(userInfo.family_name)\r\n )\r\n\r\n userInfo && (\r\n setUsername(userInfo.email)\r\n )\r\n }, [userInfo])\r\n\r\n const [firstname, setFirstname] = useState('')\r\n const [lastname, setLastname] = useState('')\r\n const [username, setUsername] = useState('');\r\n\r\n const handlefirstnameChange = (e) => {\r\n setFirstname(e.target.value)\r\n }\r\n\r\n const handlelastnameChange = (e) => {\r\n setLastname(e.target.value)\r\n }\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const userInputData = JSON.stringify({\r\n firstname: `${firstname}`,\r\n lastname: `${lastname}`,\r\n email: `${username}`\r\n })\r\n\r\n const updateUserDataRequestOptions = {\r\n method: 'PUT',\r\n body: userInputData\r\n };\r\n\r\n const handleUpdateUserDataFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.updateUserDataURL, updateUserDataRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n removeModal()\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div className=\"modal-content\">\r\n <div className=\"updateUserDataModal\">\r\n <h2>Update information</h2>\r\n <div userDataSubmitForm>\r\n <form onSubmit={handleUpdateUserDataFormSubmit}>\r\n <label>\r\n First name:\r\n <input\r\n id=\"firstname\" type=\"text\"\r\n value={firstname}\r\n onChange={handlefirstnameChange} />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n id=\"lastname\" type=\"text\"\r\n value={lastname}\r\n onChange={handlelastnameChange} />\r\n </label>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <div className=\"buttonContainer\">\r\n <button className=\"noButton\" onClick={e => removeModal()}>\r\n Cancel\r\n </button>\r\n <button className=\"yesButton\" type=\"submit\">\r\n Update\r\n </button>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default UpdateUserDataModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\account\\\\confirmRemoveAccountModal\\\\ConfirmRemoveAccountModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useEffect, useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./ConfirmRemoveAccountModal.css\";\nimport config from '../../../config';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ConfirmRemoveAccountModal = ({\n removeModal,\n headerMessage,\n bodyMessage\n}) => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const accessToken = oktaAuth.getAccessToken();\n\n const stopProp = e => {\n e.stopPropagation();\n };\n\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 removeAccountRequestOptions = {\n method: 'DELETE',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: JSON.stringify({\n email: `${userInfo && userInfo.email}`\n })\n };\n\n const handleRemoveAccount = () => {\n console.log(removeAccountRequestOptions.body);\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions).then(res => {\n if (!res.ok) {\n console.log(res);\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n oktaAuth.signOut();\n }\n });\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"confirmRemoveAccountModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Delete account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Are you sure you want to delete your account?\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"buttonContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: \"noButton\",\n onClick: e => removeModal(),\n children: \"No\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"yesButton\",\n onClick: handleRemoveAccount,\n children: [\"Yes\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 5\n }, this);\n};\n\n_s(ConfirmRemoveAccountModal, \"/7FunoA1ejJNU8uKGTy1GZFqU2I=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = ConfirmRemoveAccountModal;\nexport default ConfirmRemoveAccountModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"ConfirmRemoveAccountModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/account/confirmRemoveAccountModal/ConfirmRemoveAccountModal.jsx"],"names":["React","useEffect","useState","useOktaAuth","config","ConfirmRemoveAccountModal","removeModal","headerMessage","bodyMessage","authState","oktaAuth","userInfo","setUserInfo","accessToken","getAccessToken","stopProp","e","stopPropagation","isAuthenticated","getUser","then","info","removeAccountRequestOptions","method","headers","Authorization","body","JSON","stringify","email","handleRemoveAccount","console","log","fetch","serviceAPI","removeAccountURL","res","ok","window","alert","Promise","reject","signOut"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,QAA3B,QAA2C,OAA3C;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,iCAAP;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,yBAAyB,GAAG,CAAC;AAAEC,EAAAA,WAAF;AAAeC,EAAAA,aAAf;AAA8BC,EAAAA;AAA9B,CAAD,KAAiD;AAAA;;AACjF,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BP,WAAW,EAA3C;AACA,QAAM,CAACQ,QAAD,EAAWC,WAAX,IAA0BV,QAAQ,CAAC,IAAD,CAAxC;AACA,QAAMW,WAAW,GAAGH,QAAQ,CAACI,cAAT,EAApB;;AAEA,QAAMC,QAAQ,GAAGC,CAAC,IAAI;AACpBA,IAAAA,CAAC,CAACC,eAAF;AACD,GAFD;;AAIAhB,EAAAA,SAAS,CAAC,MAAM;AACd,QAAI,CAACQ,SAAS,CAACS,eAAf,EAAgC;AAC9B;AACAN,MAAAA,WAAW,CAAC,IAAD,CAAX;AACD,KAHD,MAGO;AACLF,MAAAA,QAAQ,CAACS,OAAT,GAAmBC,IAAnB,CAAwBC,IAAI,IAAI;AAC9BT,QAAAA,WAAW,CAACS,IAAD,CAAX;AACD,OAFD;AAGD;AACF,GATQ,EASN,CAACZ,SAAD,EAAYC,QAAZ,CATM,CAAT,CATiF,CAkBtD;;AAE3B,QAAMY,2BAA2B,GAAG;AAClCC,IAAAA,MAAM,EAAE,QAD0B;AA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A;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,cALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAmBD,CAnED;;GAAMzB,yB;UAC4BF,W;;;KAD5BE,yB;AAqEN,eAAeA,yBAAf","sourcesContent":["import React, { useEffect, useState } from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./ConfirmRemoveAccountModal.css\"\r\nimport config from '../../../config';\r\n\r\nconst ConfirmRemoveAccountModal = ({ removeModal, headerMessage, bodyMessage }) => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n const accessToken = oktaAuth.getAccessToken();\r\n\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\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 removeAccountRequestOptions = {\r\n method: 'DELETE',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: JSON.stringify(\r\n {\r\n email: `${userInfo && userInfo.email}`,\r\n }\r\n )\r\n }\r\n\r\n const handleRemoveAccount = () => {\r\n console.log(removeAccountRequestOptions.body)\r\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n console.log(res)\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n oktaAuth.signOut()\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div className=\"modal-content\">\r\n <div className=\"confirmRemoveAccountModal\">\r\n <h2>Delete account</h2>\r\n <label>\r\n Are you sure you want to delete your account?\r\n </label>\r\n <div className=\"buttonContainer\">\r\n <button className=\"noButton\" onClick={e => removeModal()}>\r\n No\r\n </button>\r\n <button className=\"yesButton\" onClick={handleRemoveAccount}>\r\n Yes&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ConfirmRemoveAccountModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\removeAccount\\\\confirmRemoveAccountModal\\\\ConfirmRemoveAccountModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useEffect, useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./ConfirmRemoveAccountModal.css\";\nimport config from '../../../config';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ConfirmRemoveAccountModal = ({\n removeModal,\n headerMessage,\n bodyMessage\n}) => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const accessToken = oktaAuth.getAccessToken();\n\n const stopProp = e => {\n e.stopPropagation();\n };\n\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 removeAccountRequestOptions = {\n method: 'DELETE',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: JSON.stringify({\n email: `${userInfo && userInfo.email}`\n })\n };\n\n const handleRemoveAccount = () => {\n console.log(removeAccountRequestOptions.body);\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions).then(res => {\n if (!res.ok) {\n console.log(res);\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n oktaAuth.signOut();\n }\n });\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"confirmRemoveAccountModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Delete account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Are you sure you want to delete your account?\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"buttonContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: \"noButton\",\n onClick: e => removeModal(),\n children: \"No\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"yesButton\",\n onClick: handleRemoveAccount,\n children: \"Yes\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 5\n }, this);\n};\n\n_s(ConfirmRemoveAccountModal, \"/7FunoA1ejJNU8uKGTy1GZFqU2I=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = ConfirmRemoveAccountModal;\nexport default ConfirmRemoveAccountModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"ConfirmRemoveAccountModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/removeAccount/confirmRemoveAccountModal/ConfirmRemoveAccountModal.jsx"],"names":["React","useEffect","useState","useOktaAuth","config","ConfirmRemoveAccountModal","removeModal","headerMessage","bodyMessage","authState","oktaAuth","userInfo","setUserInfo","accessToken","getAccessToken","stopProp","e","stopPropagation","isAuthenticated","getUser","then","info","removeAccountRequestOptions","method","headers","Authorization","body","JSON","stringify","email","handleRemoveAccount","console","log","fetch","serviceAPI","removeAccountURL","res","ok","window","alert","Promise","reject","signOut"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,QAA3B,QAA2C,OAA3C;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,iCAAP;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,yBAAyB,GAAG,CAAC;AAAEC,EAAAA,WAAF;AAAeC,EAAAA,aAAf;AAA8BC,EAAAA;AAA9B,CAAD,KAAiD;AAAA;;AACjF,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BP,WAAW,EAA3C;AACA,QAAM,CAACQ,QAAD,EAAWC,WAAX,IAA0BV,QAAQ,CAAC,IAAD,CAAxC;AACA,QAAMW,WAAW,GAAGH,QAAQ,CAACI,cAAT,EAApB;;AAEA,QAAMC,QAAQ,GAAGC,CAAC,IAAI;AACpBA,IAAAA,CAAC,CAACC,eAAF;AACD,GAFD;;AAIAhB,EAAAA,SAAS,CAAC,MAAM;AACd,QAAI,CAACQ,SAAS,CAACS,eAAf,EAAgC;AAC9B;AACAN,MAAAA,WAAW,CAAC,IAAD,CAAX;AACD,KAHD,MAGO;AACLF,MAAAA,QAAQ,CAACS,OAAT,GAAmBC,IAAnB,CAAwBC,IAAI,IAAI;AAC9BT,QAAAA,WAAW,CAACS,IAAD,CAAX;AACD,OAFD;AAGD;AACF,GATQ,EASN,CAACZ,SAAD,EAAYC,QAAZ,CATM,CAAT,CATiF,CAkBtD;;AAE3B,QAAMY,2BAA2B,GAAG;AAClCC,IAAAA,MAAM,EAAE,QAD0B;AAElCC,IAAAA,OAAO,EAAE;AACPC,MAAAA,aAAa,EAAG,UAASZ,WAAY;AAD9B,KAFyB;AAKlCa,IAAAA,IAAI,EAAEC,IAAI,CAAC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,yB;AAoEN,eAAeA,yBAAf","sourcesContent":["import React, { useEffect, useState } from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./ConfirmRemoveAccountModal.css\"\r\nimport config from '../../../config';\r\n\r\nconst ConfirmRemoveAccountModal = ({ removeModal, headerMessage, bodyMessage }) => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n const accessToken = oktaAuth.getAccessToken();\r\n\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\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 removeAccountRequestOptions = {\r\n method: 'DELETE',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: JSON.stringify(\r\n {\r\n email: `${userInfo && userInfo.email}`,\r\n }\r\n )\r\n }\r\n\r\n const handleRemoveAccount = () => {\r\n console.log(removeAccountRequestOptions.body)\r\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n console.log(res)\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n oktaAuth.signOut()\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div className=\"modal-content\">\r\n <div className=\"confirmRemoveAccountModal\">\r\n <h2>Delete account</h2>\r\n <label>\r\n Are you sure you want to delete your account?\r\n </label>\r\n <div className=\"buttonContainer\">\r\n <button className=\"noButton\" onClick={e => removeModal()}>\r\n No\r\n </button>\r\n <button className=\"yesButton\" onClick={handleRemoveAccount}>\r\n Yes\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ConfirmRemoveAccountModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\account\\\\Account.jsx\",\n _s = $RefreshSig$();\n\n// rfce\nimport React, { useState, useEffect } from 'react';\nimport \"./Account.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useOktaAuth } from '@okta/okta-react';\nimport ConfirmRemoveAccountModal from \"./confirmRemoveAccountModal/ConfirmRemoveAccountModal\";\nimport UpdateUserDataModal from './updateUserData/UpdateUserDataModal';\nimport ChangePassword from '../../components/changePassword/ChangePassword';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nfunction Account() {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const [name, setName] = useState('');\n const [email, setEmail] = useState('');\n const [updateUserDataModalState, setUpdateUserDataModalState] = useState(false);\n\n const toggleUpdateUserDataModalState = () => setUpdateUserDataModalState(!updateUserDataModalState);\n\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false);\n\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState);\n\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else if (authState.isAuthenticated && updateUserDataModalState == false) {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth, updateUserDataModalState]); // Update if authState changes\n\n useEffect(() => {\n userInfo && setName(userInfo.name);\n userInfo && setEmail(userInfo.email);\n }, [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: \"Account information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"accountpage-content\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"personal-information-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-circle\",\n className: \"user-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Personal information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n onClick: toggleUpdateUserDataModalState,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"pen\",\n className: \"pen-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 15\n }, this), \"Edit\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Name:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? name : \"Fetching name\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"b\", {\n children: \"Email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 69,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: userInfo ? email : \"Fetching email\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(ChangePassword, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${updateUserDataModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(UpdateUserDataModal, {\n removeModal: () => setUpdateUserDataModalState(false)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 82,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 5\n }, this);\n}\n\n_s(Account, \"mspcEj1apxAoqwV3paiS9+TXXfg=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = Account;\nexport default Account;\n\nvar _c;\n\n$RefreshReg$(_c, \"Account\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/account/Account.jsx"],"names":["React","useState","useEffect","FontAwesomeIcon","useOktaAuth","ConfirmRemoveAccountModal","UpdateUserDataModal","ChangePassword","Account","authState","oktaAuth","userInfo","setUserInfo","name","setName","email","setEmail","updateUserDataModalState","setUpdateUserDataModalState","toggleUpdateUserDataModalState","confirmAccountRemoveModalState","setConfirmAccountRemoveModalState","toggleConfirmAccountRemoveModalState","isAuthenticated","getUser","then","info"],"mappings":";;;AAAA;AACA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,OAAO,eAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAOC,yBAAP,MAAsC,uDAAtC;AACA,OAAOC,mBAAP,MAAgC,sCAAhC;AACA,OAAOC,cAAP,MAA2B,gDAA3B;;;AAEA,SAASC,OAAT,GAAmB;AAAA;;AACjB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BN,WAAW,EAA3C;AACA,QAAM,CAACO,QAAD,EAAWC,WAAX,IAA0BX,QAAQ,CAAC,IAAD,CAAxC;AAEA,QAAM,CAACY,IAAD,EAAOC,OAAP,IAAkBb,QAAQ,CAAC,EAAD,CAAhC;AACA,QAAM,CAACc,KAAD,EAAQC,QAAR,IAAoBf,QAAQ,CAAC,EAAD,CAAlC;AAEA,QAAM,CAACgB,wBAAD,EAA2BC,2BAA3B,IAA0DjB,QAAQ,CAAC,KAAD,CAAxE;;AACA,QAAMkB,8BAA8B,GAAG,MAAMD,2BAA2B,CAAC,CAACD,wBAAF,CAAxE;;AAEA,QAAM,CAACG,8BAAD,EAAiCC,iCAAjC,IAAsEpB,QAAQ,CAAC,KAAD,CAApF;;AACA,QAAMqB,oCAAoC,GAAG,MAAMD,iCAAiC,CAAC,CAACD,8BAAF,CAApF;;AAEAlB,EAAAA,SAAS,CAAC,MAAM;AACd,QAAI,CAACO,SAAS,CAACc,eAAf,EAAgC;AAC9B;AACAX,MAAAA,WAAW,CAAC,IAAD,CAAX;AACD,KAHD,MAGO,IAAIH,SAAS,CAACc,eAAV,IAA6BN,wBAA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,qCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,oBADF,eAIE;AAAA,wBACGR,QAAQ,GAAGE,IAAH,GAAU;AADrB;AAAA;AAAA;AAAA;AAAA,oBAJF,eAOE;AAAA,qCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,oBAPF,eAUE;AAAA,wBACGF,QAAQ,GAAGI,KAAH,GAAW;AADtB;AAAA;AAAA;AAAA;AAAA,oBAVF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,gBATF;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eA6BE,QAAC,cAAD;AAAA;AAAA;AAAA;AAAA,cA7BF;AAAA;AAAA;AAAA;AAAA;AAAA,YAJF,eAoCE;AAAK,MAAA,SAAS,EAAG,SAAQE,wBAAwB,GAAG,QAAH,GAAc,UAAW,EAA1E;AAAA,6BACE,QAAC,mBAAD;AAAqB,QAAA,WAAW,EAAE,MAAMC,2BAA2B,CAAC,KAAD;AAAnE;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YApCF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA0CD;;GA7EQV,O;UACyBJ,W;;;KADzBI,O;AA+ET,eAAeA,OAAf","sourcesContent":["// rfce\r\nimport React, { useState, useEffect } from 'react'\r\nimport \"./Account.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport ConfirmRemoveAccountModal from \"./confirmRemoveAccountModal/ConfirmRemoveAccountModal\"\r\nimport UpdateUserDataModal from './updateUserData/UpdateUserDataModal';\r\nimport ChangePassword from '../../components/changePassword/ChangePassword';\r\n\r\nfunction Account() {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n\r\n const [name, setName] = useState('')\r\n const [email, setEmail] = useState('');\r\n\r\n const [updateUserDataModalState, setUpdateUserDataModalState] = useState(false)\r\n const toggleUpdateUserDataModalState = () => setUpdateUserDataModalState(!updateUserDataModalState)\r\n\r\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false)\r\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState)\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 if (authState.isAuthenticated && updateUserDataModalState == false) {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth, updateUserDataModalState]); // Update if authState changes\r\n\r\n useEffect(() => {\r\n userInfo && (\r\n setName(userInfo.name)\r\n )\r\n\r\n userInfo && (\r\n setEmail(userInfo.email)\r\n )\r\n }, [userInfo])\r\n\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"welcome-text\">Account information</h2>\r\n </div>\r\n <div className=\"accountpage-content\">\r\n\r\n <div className=\"personal-information-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"user-circle\" className=\"user-icon\"></FontAwesomeIcon>\r\n <h5>Personal information</h5>\r\n <button onClick={toggleUpdateUserDataModalState}>\r\n <FontAwesomeIcon icon=\"pen\" className=\"pen-icon\"></FontAwesomeIcon>\r\n Edit\r\n </button>\r\n </div>\r\n <div className=\"content\">\r\n <ul>\r\n <li>\r\n <b>Name:</b>\r\n </li>\r\n <li>\r\n {userInfo ? name : \"Fetching name\"}\r\n </li>\r\n <li>\r\n <b>Email</b>\r\n </li>\r\n <li>\r\n {userInfo ? email : \"Fetching email\"}\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n <ChangePassword />\r\n\r\n </div>\r\n <div className={`modal ${updateUserDataModalState ? \"active\" : \"inactive\"}`}>\r\n <UpdateUserDataModal removeModal={() => setUpdateUserDataModalState(false)} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default Account\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\changePassword\\\\ChangePassword.js\";\nimport React from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ChangePassword = () => {\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"change-password-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"lock\",\n className: \"lock-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 8,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Change password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 9,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 7,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Password requirements:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 12,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: \"At least 8 characters\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 14,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"No parts of username may be included\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 17,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"Your password cannot be any of the last 4 passwords\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 20,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 13,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"reset-password-form-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Old password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 27,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 30,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 26,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"New password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 33,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 36,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 32,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Confirm new password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 39,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"passwordResetSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 25,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 24,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 11,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 6,\n columnNumber: 5\n }, this);\n};\n\n_c = ChangePassword;\nexport default ChangePassword;\n\nvar _c;\n\n$RefreshReg$(_c, \"ChangePassword\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/changePassword/ChangePassword.js"],"names":["React","FontAwesomeIcon","ChangePassword"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAEA,MAAMC,cAAc,GAAG,MAAM;AAC3B,sBACE;AAAK,IAAA,SAAS,EAAC,2BAAf;AAAA,4BACE;AAAK,MAAA,SAAS,EAAC,kBAAf;AAAA,8BACE,QAAC,eAAD;AAAiB,QAAA,IAAI,EAAC,MAAtB;AAA6B,QAAA,SAAS,EAAC;AAAvC;AAAA;AAAA;AAAA;AAAA,cADF,eAEE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF;AAAA;AAAA;AAAA;AAAA;AAAA,YADF,eAKE;AAAK,MAAA,SAAS,EAAC,SAAf;AAAA,8BACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cADF,eAEE;AAAA,gCACE;AAAA;AAAA;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AAMA,c;AAqDN,eAAeA,cAAf","sourcesContent":["import React from 'react'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst ChangePassword = () => {\r\n return (\r\n <div className=\"change-password-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"lock\" className=\"lock-icon\"></FontAwesomeIcon>\r\n <h5>Change password</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>Password requirements:</p>\r\n <ul>\r\n <li>\r\n At least 8 characters\r\n </li>\r\n <li>\r\n No parts of username may be included\r\n </li>\r\n <li>\r\n Your password cannot be any of the last 4 passwords\r\n </li>\r\n </ul>\r\n <form>\r\n <div className=\"reset-password-form-container\">\r\n <div className=\"form-item\">\r\n <label>\r\n Old password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n New password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n Confirm new password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <button className=\"passwordResetSubmitButton\" type=\"submit\">\r\n Submit&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ChangePassword\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\removeAccount\\\\RemoveAccount.js\",\n _s = $RefreshSig$();\n\nimport React from 'react';\nimport ConfirmRemoveAccountModal from '../../pages/account/confirmRemoveAccountModal/ConfirmRemoveAccountModal';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nfunction RemoveAccount() {\n _s();\n\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false);\n\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState);\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"deactivate-account-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"trash\",\n className: \"trash-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 12,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Delete account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 13,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 11,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Your account and all your data will be permanently deleted\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 16,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n onClick: toggleConfirmAccountRemoveModalState,\n children: \"Delete\\xA0\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 19,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 15,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${confirmAccountRemoveModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(ConfirmRemoveAccountModal, {\n removeModal: () => setConfirmAccountRemoveModalState(false)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 24,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 23,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 10,\n columnNumber: 5\n }, this);\n}\n\n_s(RemoveAccount, \"XKJA7Na5EjeRgSbWm6h1M3CFd/k=\");\n\n_c = RemoveAccount;\nexport default RemoveAccount;\n\nvar _c;\n\n$RefreshReg$(_c, \"RemoveAccount\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/removeAccount/RemoveAccount.js"],"names":["React","ConfirmRemoveAccountModal","FontAwesomeIcon","RemoveAccount","confirmAccountRemoveModalState","setConfirmAccountRemoveModalState","useState","toggleConfirmAccountRemoveModalState"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,yBAAP,MAAsC,yEAAtC;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAEA,SAASC,aAAT,GAAyB;AAAA;;AACvB,QAAM,CAACC,8BAAD,EAAiCC,iCAAjC,IAAsEC,QAAQ,CAAC,KAAD,CAApF;;AACA,QAAMC,oCAAoC,GAAG,MAAMF,iCAAiC,CAAC,CAACD,8BAAF,CAApF;;AAEA,sBACE;AAAK,IAAA,SAAS,EAAC,8BAAf;AAAA,4BACE;AAAK,MAAA,SAAS,EAAC,kBAAf;AAAA,8BACE,QAAC,eAAD;AAAiB,QAAA,IAAI,EAAC,OAAtB;AAA8B,QAAA,SAAS,EAAC;AAAxC;AAAA;AAAA;AAAA;AAAA,cADF,eAEE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF;AAAA;AAAA;AAAA;AAAA;AAAA,YADF,eAKE;AAAK,MAAA,SAAS,EAAC,SAAf;AAAA,8BACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cADF,eAIE;AAAQ,QAAA,OAAO,EAAEG,oCAAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAJF;AAAA;AAAA;AAAA;AAAA;AAAA,YALF,eAaE;AAAK,MAAA,SAAS,EAAG,SAAQH,8BAA8B,GAAG,QAAH,GAAc,UAAW,EAAhF;AAAA,6BACE,QAAC,yBAAD;AAA2B,QAAA,WAAW,EAAE,MAAMC,iCAAiC,CAAC,KAAD;AAA/E;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAbF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAmBD;;GAvBQF,a;;KAAAA,a;AAyBT,eAAeA,aAAf","sourcesContent":["import React from 'react'\r\nimport ConfirmRemoveAccountModal from '../../pages/account/confirmRemoveAccountModal/ConfirmRemoveAccountModal'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nfunction RemoveAccount() {\r\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false)\r\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState)\r\n\r\n return (\r\n <div className=\"deactivate-account-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"trash\" className=\"trash-icon\"></FontAwesomeIcon>\r\n <h5>Delete account</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>\r\n Your account and all your data will be permanently deleted\r\n </p>\r\n <button onClick={toggleConfirmAccountRemoveModalState}>\r\n Delete&nbsp;\r\n </button>\r\n </div>\r\n <div className={`modal ${confirmAccountRemoveModalState ? \"active\" : \"inactive\"}`}>\r\n <ConfirmRemoveAccountModal removeModal={() => setConfirmAccountRemoveModalState(false)} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default RemoveAccount\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\account\\\\confirmRemoveAccountModal\\\\ConfirmRemoveAccountModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useEffect, useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./ConfirmRemoveAccountModal.css\";\nimport config from '../../../config';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ConfirmRemoveAccountModal = ({\n removeModal,\n headerMessage,\n bodyMessage\n}) => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const accessToken = oktaAuth.getAccessToken();\n\n const stopProp = e => {\n e.stopPropagation();\n };\n\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 removeAccountRequestOptions = {\n method: 'DELETE',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: JSON.stringify({\n email: `${userInfo && userInfo.email}`\n })\n };\n\n const handleRemoveAccount = () => {\n console.log(removeAccountRequestOptions.body);\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions).then(res => {\n if (!res.ok) {\n console.log(res);\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n oktaAuth.signOut();\n }\n });\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"confirmRemoveAccountModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Delete account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Are you sure you want to delete your account?\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"buttonContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: \"noButton\",\n onClick: e => removeModal(),\n children: \"No\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"yesButton\",\n onClick: handleRemoveAccount,\n children: [\"Yes\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"exclamation-triangle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 5\n }, this);\n};\n\n_s(ConfirmRemoveAccountModal, \"/7FunoA1ejJNU8uKGTy1GZFqU2I=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = ConfirmRemoveAccountModal;\nexport default ConfirmRemoveAccountModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"ConfirmRemoveAccountModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/account/confirmRemoveAccountModal/ConfirmRemoveAccountModal.jsx"],"names":["React","useEffect","useState","useOktaAuth","config","FontAwesomeIcon","ConfirmRemoveAccountModal","removeModal","headerMessage","bodyMessage","authState","oktaAuth","userInfo","setUserInfo","accessToken","getAccessToken","stopProp","e","stopPropagation","isAuthenticated","getUser","then","info","removeAccountRequestOptions","method","headers","Authorization","body","JSON","stringify","email","handleRemoveAccount","console","log","fetch","serviceAPI","removeAccountURL","res","ok","window","alert","Promise","reject","signOut"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,QAA3B,QAA2C,OAA3C;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,iCAAP;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAEA,MAAMC,yBAAyB,GAAG,CAAC;AAAEC,EAAAA,WAAF;AAAe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CAACC,GAAR,CAAYI,GAAZ;AACAE,QAAAA,MAAM,CAACC,KAAP,CAAa,OAAb;AACAC,QAAAA,OAAO,CAACC,MAAR,CAAe,EAAf;AACA;AACD;;AACD,UAAIL,GAAG,CAACC,EAAR,EAAY;AACV3B,QAAAA,QAAQ,CAACgC,OAAT;AACD;AACF,KAXH;AAYD,GAdD;;AAgBA,sBACE;AAAK,IAAA,SAAS,EAAC,eAAf;AAAA,2BACE;AAAK,MAAA,SAAS,EAAC,2BAAf;AAAA,8BACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cADF,eAEE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eAKE;AAAK,QAAA,SAAS,EAAC,iBAAf;AAAA,gCACE;AAAQ,UAAA,SAAS,EAAC,UAAlB;AAA6B,UAAA,OAAO,EAAE1B,CAAC,IAAIV,WAAW,EAAtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBADF,eAIE;AAAQ,UAAA,SAAS,EAAC,WAAlB;AAA8B,UAAA,OAAO,EAAEwB,mBAAvC;AAAA,6CAEE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,cALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAmBD,CAnED;;GAAMzB,yB;UAC4BH,W;;;KAD5BG,yB;AAqEN,eAAeA,yBAAf","sourcesContent":["import React, { useEffect, useState } from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./ConfirmRemoveAccountModal.css\"\r\nimport config from '../../../config';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\n\r\nconst ConfirmRemoveAccountModal = ({ removeModal, headerMessage, bodyMessage }) => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n const accessToken = oktaAuth.getAccessToken();\r\n\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\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 removeAccountRequestOptions = {\r\n method: 'DELETE',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: JSON.stringify(\r\n {\r\n email: `${userInfo && userInfo.email}`,\r\n }\r\n )\r\n }\r\n\r\n const handleRemoveAccount = () => {\r\n console.log(removeAccountRequestOptions.body)\r\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n console.log(res)\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n oktaAuth.signOut()\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div className=\"modal-content\">\r\n <div className=\"confirmRemoveAccountModal\">\r\n <h2>Delete account</h2>\r\n <label>\r\n Are you sure you want to delete your account?\r\n </label>\r\n <div className=\"buttonContainer\">\r\n <button className=\"noButton\" onClick={e => removeModal()}>\r\n No\r\n </button>\r\n <button className=\"yesButton\" onClick={handleRemoveAccount}>\r\n Yes&nbsp;\r\n <FontAwesomeIcon icon=\"exclamation-triangle\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ConfirmRemoveAccountModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\account\\\\confirmRemoveAccountModal\\\\ConfirmRemoveAccountModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useEffect, useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./ConfirmRemoveAccountModal.css\";\nimport config from '../../../config';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ConfirmRemoveAccountModal = ({\n removeModal,\n headerMessage,\n bodyMessage\n}) => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const accessToken = oktaAuth.getAccessToken();\n\n const stopProp = e => {\n e.stopPropagation();\n };\n\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 removeAccountRequestOptions = {\n method: 'DELETE',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: JSON.stringify({\n email: `${userInfo && userInfo.email}`\n })\n };\n\n const handleRemoveAccount = () => {\n console.log(removeAccountRequestOptions.body);\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions).then(res => {\n if (!res.ok) {\n console.log(res);\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n oktaAuth.signOut();\n }\n });\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"confirmRemoveAccountModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Delete account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Are you sure you want to delete your account?\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"buttonContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: \"noButton\",\n onClick: e => removeModal(),\n children: \"No\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"yesButton\",\n onClick: handleRemoveAccount,\n children: [\"Yes\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 5\n }, this);\n};\n\n_s(ConfirmRemoveAccountModal, \"/7FunoA1ejJNU8uKGTy1GZFqU2I=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = ConfirmRemoveAccountModal;\nexport default ConfirmRemoveAccountModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"ConfirmRemoveAccountModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/account/confirmRemoveAccountModal/ConfirmRemoveAccountModal.jsx"],"names":["React","useEffect","useState","useOktaAuth","config","FontAwesomeIcon","ConfirmRemoveAccountModal","removeModal","headerMessage","bodyMessage","authState","oktaAuth","userInfo","setUserInfo","accessToken","getAccessToken","stopProp","e","stopPropagation","isAuthenticated","getUser","then","info","removeAccountRequestOptions","method","headers","Authorization","body","JSON","stringify","email","handleRemoveAccount","console","log","fetch","serviceAPI","removeAccountURL","res","ok","window","alert","Promise","reject","signOut"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,QAA3B,QAA2C,OAA3C;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,iCAA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,CAAkBC,gBAAnB,EAAqCb,2BAArC,CAAL,CACGF,IADH,CACSgB,GAAD,IAAS;AACb,UAAI,CAACA,GAAG,CAACC,EAAT,EAAa;AACXN,QAAAA,OAAO,CAACC,GAAR,CAAYI,GAAZ;AACAE,QAAAA,MAAM,CAACC,KAAP,CAAa,OAAb;AACAC,QAAAA,OAAO,CAACC,MAAR,CAAe,EAAf;AACA;AACD;;AACD,UAAIL,GAAG,CAACC,EAAR,EAAY;AACV3B,QAAAA,QAAQ,CAACgC,OAAT;AACD;AACF,KAXH;AAYD,GAdD;;AAgBA,sBACE;AAAK,IAAA,SAAS,EAAC,eAAf;AAAA,2BACE;AAAK,MAAA,SAAS,EAAC,2BAAf;AAAA,8BACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cADF,eAEE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eAKE;AAAK,QAAA,SAAS,EAAC,iBAAf;AAAA,gCACE;AAAQ,UAAA,SAAS,EAAC,UAAlB;AAA6B,UAAA,OAAO,EAAE1B,CAAC,IAAIV,WAAW,EAAtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBADF,eAIE;AAAQ,UAAA,SAAS,EAAC,WAAlB;AAA8B,UAAA,OAAO,EAAEwB,mBAAvC;AAAA,6CAEE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,cALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAmBD,CAnED;;GAAMzB,yB;UAC4BH,W;;;KAD5BG,yB;AAqEN,eAAeA,yBAAf","sourcesContent":["import React, { useEffect, useState } from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./ConfirmRemoveAccountModal.css\"\r\nimport config from '../../../config';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\n\r\nconst ConfirmRemoveAccountModal = ({ removeModal, headerMessage, bodyMessage }) => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n const accessToken = oktaAuth.getAccessToken();\r\n\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\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 removeAccountRequestOptions = {\r\n method: 'DELETE',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: JSON.stringify(\r\n {\r\n email: `${userInfo && userInfo.email}`,\r\n }\r\n )\r\n }\r\n\r\n const handleRemoveAccount = () => {\r\n console.log(removeAccountRequestOptions.body)\r\n fetch(config.serviceAPI.removeAccountURL, removeAccountRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n console.log(res)\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n oktaAuth.signOut()\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div className=\"modal-content\">\r\n <div className=\"confirmRemoveAccountModal\">\r\n <h2>Delete account</h2>\r\n <label>\r\n Are you sure you want to delete your account?\r\n </label>\r\n <div className=\"buttonContainer\">\r\n <button className=\"noButton\" onClick={e => removeModal()}>\r\n No\r\n </button>\r\n <button className=\"yesButton\" onClick={handleRemoveAccount}>\r\n Yes&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ConfirmRemoveAccountModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\removeAccount\\\\RemoveAccount.js\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport ConfirmRemoveAccountModal from '../../pages/account/confirmRemoveAccountModal/ConfirmRemoveAccountModal';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nfunction RemoveAccount() {\n _s();\n\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false);\n\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState);\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"deactivate-account-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"trash\",\n className: \"trash-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 12,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Delete account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 13,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 11,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Your account and all your data will be permanently deleted\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 16,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n onClick: toggleConfirmAccountRemoveModalState,\n children: \"Delete\\xA0\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 19,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 15,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${confirmAccountRemoveModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(ConfirmRemoveAccountModal, {\n removeModal: () => setConfirmAccountRemoveModalState(false)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 24,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 23,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 10,\n columnNumber: 5\n }, this);\n}\n\n_s(RemoveAccount, \"XKJA7Na5EjeRgSbWm6h1M3CFd/k=\");\n\n_c = RemoveAccount;\nexport default RemoveAccount;\n\nvar _c;\n\n$RefreshReg$(_c, \"RemoveAccount\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/removeAccount/RemoveAccount.js"],"names":["React","useState","ConfirmRemoveAccountModal","FontAwesomeIcon","RemoveAccount","confirmAccountRemoveModalState","setConfirmAccountRemoveModalState","toggleConfirmAccountRemoveModalState"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,OAAOC,yBAAP,MAAsC,yEAAtC;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAEA,SAASC,aAAT,GAAyB;AAAA;;AACvB,QAAM,CAACC,8BAAD,EAAiCC,iCAAjC,IAAsEL,QAAQ,CAAC,KAAD,CAApF;;AACA,QAAMM,oCAAoC,GAAG,MAAMD,iCAAiC,CAAC,CAACD,8BAAF,CAApF;;AAEA,sBACE;AAAK,IAAA,SAAS,EAAC,8BAAf;AAAA,4BACE;AAAK,MAAA,SAAS,EAAC,kBAAf;AAAA,8BACE,QAAC,eAAD;AAAiB,QAAA,IAAI,EAAC,OAAtB;AAA8B,QAAA,SAAS,EAAC;AAAxC;AAAA;AAAA;AAAA;AAAA,cADF,eAEE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF;AAAA;AAAA;AAAA;AAAA;AAAA,YADF,eAKE;AAAK,MAAA,SAAS,EAAC,SAAf;AAAA,8BACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cADF,eAIE;AAAQ,QAAA,OAAO,EAAEE,oCAAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAJF;AAAA;AAAA;AAAA;AAAA;AAAA,YALF,eAaE;AAAK,MAAA,SAAS,EAAG,SAAQF,8BAA8B,GAAG,QAAH,GAAc,UAAW,EAAhF;AAAA,6BACE,QAAC,yBAAD;AAA2B,QAAA,WAAW,EAAE,MAAMC,iCAAiC,CAAC,KAAD;AAA/E;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAbF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAmBD;;GAvBQF,a;;KAAAA,a;AAyBT,eAAeA,aAAf","sourcesContent":["import React, { useState } from 'react'\r\nimport ConfirmRemoveAccountModal from '../../pages/account/confirmRemoveAccountModal/ConfirmRemoveAccountModal'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nfunction RemoveAccount() {\r\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false)\r\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState)\r\n\r\n return (\r\n <div className=\"deactivate-account-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"trash\" className=\"trash-icon\"></FontAwesomeIcon>\r\n <h5>Delete account</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>\r\n Your account and all your data will be permanently deleted\r\n </p>\r\n <button onClick={toggleConfirmAccountRemoveModalState}>\r\n Delete&nbsp;\r\n </button>\r\n </div>\r\n <div className={`modal ${confirmAccountRemoveModalState ? \"active\" : \"inactive\"}`}>\r\n <ConfirmRemoveAccountModal removeModal={() => setConfirmAccountRemoveModalState(false)} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default RemoveAccount\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\removeAccount\\\\RemoveAccount.js\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport ConfirmRemoveAccountModal from './confirmRemoveAccountModal/ConfirmRemoveAccountModal';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nfunction RemoveAccount() {\n _s();\n\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false);\n\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState);\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"deactivate-account-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"trash\",\n className: \"trash-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 12,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Delete account\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 13,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 11,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Your account and all your data will be permanently deleted\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 16,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n onClick: toggleConfirmAccountRemoveModalState,\n children: \"Delete\\xA0\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 19,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 15,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${confirmAccountRemoveModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(ConfirmRemoveAccountModal, {\n removeModal: () => setConfirmAccountRemoveModalState(false)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 24,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 23,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 10,\n columnNumber: 5\n }, this);\n}\n\n_s(RemoveAccount, \"XKJA7Na5EjeRgSbWm6h1M3CFd/k=\");\n\n_c = RemoveAccount;\nexport default RemoveAccount;\n\nvar _c;\n\n$RefreshReg$(_c, \"RemoveAccount\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/removeAccount/RemoveAccount.js"],"names":["React","useState","ConfirmRemoveAccountModal","FontAwesomeIcon","RemoveAccount","confirmAccountRemoveModalState","setConfirmAccountRemoveModalState","toggleConfirmAccountRemoveModalState"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,OAAOC,yBAAP,MAAsC,uDAAtC;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAEA,SAASC,aAAT,GAAyB;AAAA;;AACvB,QAAM,CAACC,8BAAD,EAAiCC,iCAAjC,IAAsEL,QAAQ,CAAC,KAAD,CAApF;;AACA,QAAMM,oCAAoC,GAAG,MAAMD,iCAAiC,CAAC,CAACD,8BAAF,CAApF;;AAEA,sBACE;AAAK,IAAA,SAAS,EAAC,8BAAf;AAAA,4BACE;AAAK,MAAA,SAAS,EAAC,kBAAf;AAAA,8BACE,QAAC,eAAD;AAAiB,QAAA,IAAI,EAAC,OAAtB;AAA8B,QAAA,SAAS,EAAC;AAAxC;AAAA;AAAA;AAAA;AAAA,cADF,eAEE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF;AAAA;AAAA;AAAA;AAAA;AAAA,YADF,eAKE;AAAK,MAAA,SAAS,EAAC,SAAf;AAAA,8BACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cADF,eAIE;AAAQ,QAAA,OAAO,EAAEE,oCAAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAJF;AAAA;AAAA;AAAA;AAAA;AAAA,YALF,eAaE;AAAK,MAAA,SAAS,EAAG,SAAQF,8BAA8B,GAAG,QAAH,GAAc,UAAW,EAAhF;AAAA,6BACE,QAAC,yBAAD;AAA2B,QAAA,WAAW,EAAE,MAAMC,iCAAiC,CAAC,KAAD;AAA/E;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAbF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAmBD;;GAvBQF,a;;KAAAA,a;AAyBT,eAAeA,aAAf","sourcesContent":["import React, { useState } from 'react'\r\nimport ConfirmRemoveAccountModal from './confirmRemoveAccountModal/ConfirmRemoveAccountModal'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nfunction RemoveAccount() {\r\n const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false)\r\n const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState)\r\n\r\n return (\r\n <div className=\"deactivate-account-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"trash\" className=\"trash-icon\"></FontAwesomeIcon>\r\n <h5>Delete account</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>\r\n Your account and all your data will be permanently deleted\r\n </p>\r\n <button onClick={toggleConfirmAccountRemoveModalState}>\r\n Delete&nbsp;\r\n </button>\r\n </div>\r\n <div className={`modal ${confirmAccountRemoveModalState ? \"active\" : \"inactive\"}`}>\r\n <ConfirmRemoveAccountModal removeModal={() => setConfirmAccountRemoveModalState(false)} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default RemoveAccount\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
import React from 'react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
const ChangePassword = () => {
return (
<div className="change-password-container">
<div className="container-header">
<FontAwesomeIcon icon="lock" className="lock-icon"></FontAwesomeIcon>
<h5>Change password</h5>
</div>
<div className="content">
<p>Password requirements:</p>
<ul>
<li>
At least 8 characters
</li>
<li>
No parts of username may be included
</li>
<li>
Your password cannot be any of the last 4 passwords
</li>
</ul>
<form>
<div className="reset-password-form-container">
<div className="form-item">
<label>
Old password
</label>
<input type="password"></input>
</div>
<div className="form-item">
<label>
New password
</label>
<input type="password"></input>
</div>
<div className="form-item">
<label>
Confirm new password
</label>
<input type="password"></input>
</div>
<div className="form-item">
<button className="passwordResetSubmitButton" type="submit">
Submit&nbsp;
<FontAwesomeIcon icon="arrow-right"></FontAwesomeIcon>
</button>
</div>
</div>
</form>
</div>
</div>
)
}
export default ChangePassword
import React, { useState } from 'react'
import ConfirmRemoveAccountModal from './confirmRemoveAccountModal/ConfirmRemoveAccountModal'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
function RemoveAccount() {
const [confirmAccountRemoveModalState, setConfirmAccountRemoveModalState] = useState(false)
const toggleConfirmAccountRemoveModalState = () => setConfirmAccountRemoveModalState(!confirmAccountRemoveModalState)
return (
<div className="deactivate-account-container">
<div className="container-header">
<FontAwesomeIcon icon="trash" className="trash-icon"></FontAwesomeIcon>
<h5>Delete account</h5>
</div>
<div className="content">
<p>
Your account and all your data will be permanently deleted
</p>
<button onClick={toggleConfirmAccountRemoveModalState}>
Delete&nbsp;
</button>
</div>
<div className={`modal ${confirmAccountRemoveModalState ? "active" : "inactive"}`}>
<ConfirmRemoveAccountModal removeModal={() => setConfirmAccountRemoveModalState(false)} />
</div>
</div>
)
}
export default RemoveAccount
Supports Markdown
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