mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
1 line
9.4 KiB
JSON
1 line
9.4 KiB
JSON
{"ast":null,"code":"var _jsxFileName = \"/app/src/Pages/Login.js\",\n _s = $RefreshSig$();\n\nimport React, { useContext } from 'react';\nimport '../App.css';\nimport './Login.css';\nimport { Button } from 'reactstrap';\nimport { Formik, Form, Field } from 'formik';\nimport ScaleLoader from 'react-spinners/ScaleLoader';\nimport AuthContext from '../Contexts/AuthContext';\nimport { useHistory } from \"react-router\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst Login = () => {\n _s();\n\n const history = useHistory();\n let boolTrue = true;\n let {\n Login,\n loading,\n user\n } = useContext(AuthContext);\n\n if (user) {\n history.push(\"/u/\" + user.username);\n }\n\n const redirectReset = () => {\n history.push(\"/reset\");\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageWrapper\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Login\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 25,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageBody\",\n children: /*#__PURE__*/_jsxDEV(Formik, {\n initialValues: {\n username: '',\n password: ''\n },\n onSubmit: values => Login(values),\n children: /*#__PURE__*/_jsxDEV(Form, {\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email / Username\", /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 29\n }, this), /*#__PURE__*/_jsxDEV(Field, {\n name: \"username\",\n type: \"text\",\n required: boolTrue,\n className: \"loginFields\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 36,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 34,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password\", /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 21\n }, this), /*#__PURE__*/_jsxDEV(Field, {\n name: \"password\",\n type: \"password\",\n className: \"loginFields\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 16\n }, this), /*#__PURE__*/_jsxDEV(Button, {\n color: \"primary\",\n type: \"submit\",\n className: \"loginButton\",\n disabled: loading,\n children: loading ? /*#__PURE__*/_jsxDEV(ScaleLoader, {\n color: \"#FFF\",\n size: 35\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 23\n }, this) : \"Login\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 16\n }, this), /*#__PURE__*/_jsxDEV(Button, {\n color: \"secondary\",\n type: \"button\",\n className: \"loginButton\",\n onClick: redirectReset,\n disabled: loading,\n children: \"Reset Password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 33,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 29,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 28,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 24,\n columnNumber: 5\n }, this);\n};\n\n_s(Login, \"sZ5sx6+YEbFCxIj1QE40QbHCviw=\", false, function () {\n return [useHistory];\n});\n\n_c = Login;\nexport default Login;\n\nvar _c;\n\n$RefreshReg$(_c, \"Login\");","map":{"version":3,"sources":["/app/src/Pages/Login.js"],"names":["React","useContext","Button","Formik","Form","Field","ScaleLoader","AuthContext","useHistory","Login","history","boolTrue","loading","user","push","username","redirectReset","password","values"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,UAAhB,QAAkC,OAAlC;AACA,OAAO,YAAP;AACA,OAAO,aAAP;AACA,SAASC,MAAT,QAAuB,YAAvB;AACA,SAASC,MAAT,EAAiBC,IAAjB,EAAuBC,KAAvB,QAAoC,QAApC;AACA,OAAOC,WAAP,MAAwB,4BAAxB;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,SAASC,UAAT,QAA2B,cAA3B;;;AAEA,MAAMC,KAAK,GAAG,MAAM;AAAA;;AAClB,QAAMC,OAAO,GAAGF,UAAU,EAA1B;AACA,MAAIG,QAAQ,GAAG,IAAf;AACA,MAAI;AAAEF,IAAAA,KAAF;AAASG,IAAAA,OAAT;AAAkBC,IAAAA;AAAlB,MAA2BZ,UAAU,CAACM,WAAD,CAAzC;;AAEA,MAAIM,IAAJ,EAAU;AACRH,IAAAA,OAAO,CAACI,IAAR,CAAa,QAAQD,IAAI,CAACE,QAA1B;AACD;;AAED,QAAMC,aAAa,GAAG,MAAM;AAC1BN,IAAAA,OAAO,CAACI,IAAR,CAAa,QAAb;AACD,GAFD;;AAIA,sBACE;AAAK,IAAA,SAAS,EAAC,aAAf;AAAA,4BACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YADF,eAIE;AA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;AAAA,kBA1BL,eA2BE,QAAC,MAAD;AACA,YAAA,KAAK,EAAC,WADN;AAEA,YAAA,IAAI,EAAC,QAFL;AAGA,YAAA,SAAS,EAAC,aAHV;AAIA,YAAA,OAAO,EAAEI,aAJT;AAKA,YAAA,QAAQ,EAAEJ,OALV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBA3BF;AAAA;AAAA;AAAA;AAAA;AAAA;AAJF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAJF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAiDD,CA9DD;;GAAMH,K;UACYD,U;;;KADZC,K;AAgEN,eAAeA,KAAf","sourcesContent":["import React, { useContext } from 'react';\nimport '../App.css';\nimport './Login.css';\nimport { Button } from 'reactstrap';\nimport { Formik, Form, Field } from 'formik';\nimport ScaleLoader from 'react-spinners/ScaleLoader';\nimport AuthContext from '../Contexts/AuthContext';\nimport { useHistory } from \"react-router\";\n\nconst Login = () => {\n const history = useHistory();\n let boolTrue = true;\n let { Login, loading, user } = useContext(AuthContext);\n\n if (user) {\n history.push(\"/u/\" + user.username);\n }\n\n const redirectReset = () => {\n history.push(\"/reset\")\n }\n\n return (\n <div className=\"pageWrapper\">\n <h1>\n Login\n </h1>\n <div className=\"pageBody\">\n <Formik\n initialValues={{ username: '', password: '' }}\n onSubmit={values => Login(values)}\n >\n <Form>\n <label>\n Email / Username<br/>\n <Field\n name=\"username\"\n type=\"text\"\n required={boolTrue}\n className=\"loginFields\"\n />\n </label>\n <br/>\n <label>\n Password<br/>\n <Field\n name=\"password\"\n type=\"password\"\n className=\"loginFields\"\n />\n </label>\n <br/><br/>\n <Button\n color=\"primary\"\n type=\"submit\"\n className=\"loginButton\"\n disabled={loading}\n >{loading ? <ScaleLoader color=\"#FFF\" size={35} /> : \"Login\"}</Button>\n <br/><br/>\n <Button\n color=\"secondary\"\n type=\"button\"\n className=\"loginButton\"\n onClick={redirectReset}\n disabled={loading}\n >Reset Password</Button>\n </Form>\n </Formik>\n </div>\n </div>\n );\n}\n\nexport default Login;\n"]},"metadata":{},"sourceType":"module"} |