mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-29 03:45:15 +00:00
1 line
8.5 KiB
JSON
1 line
8.5 KiB
JSON
{"ast":null,"code":"var _jsxFileName = \"/app/src/Components/HomeBanner.js\",\n _s = $RefreshSig$();\n\nimport React, { useEffect, useState } from 'react';\nimport '../App.css';\nimport './HomeBanner.css';\nimport { getStats } from '../Api/index';\nimport ClipLoader from 'react-spinners/ClipLoader';\nimport { Link } from 'react-router-dom';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst HomeBanner = () => {\n _s();\n\n let [bannerData, setBannerData] = useState({});\n let [isLoading, setIsLoading] = useState(true);\n useEffect(() => {\n getStats().then(data => {\n if (data.users !== undefined) {\n setBannerData(data);\n setIsLoading(false);\n }\n });\n }, []);\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"homeBanner\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"homeBannerItem\",\n children: /*#__PURE__*/_jsxDEV(Link, {\n to: \"/recent\",\n className: \"homeBannerItemLink\",\n children: [isLoading ? /*#__PURE__*/_jsxDEV(ClipLoader, {\n color: \"#6AD7E5\",\n size: 34\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 27,\n columnNumber: 15\n }, this) : /*#__PURE__*/_jsxDEV(\"span\", {\n className: \"homeBannerItemCount\",\n children: bannerData.scrobbles\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 28,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 11\n }, this), \"Scrobbles\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 25,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 24,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"homeBannerItem\",\n children: [isLoading ? /*#__PURE__*/_jsxDEV(ClipLoader, {\n color: \"#6AD7E5\",\n size: 34\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 36,\n columnNumber: 13\n }, this) : /*#__PURE__*/_jsxDEV(\"span\", {\n className: \"homeBannerItemCount\",\n children: bannerData.users\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 37,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 39,\n columnNumber: 9\n }, this), \"Users\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 34,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"homeBannerItem\",\n children: [isLoading ? /*#__PURE__*/_jsxDEV(ClipLoader, {\n color: \"#6AD7E5\",\n size: 34\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 13\n }, this) : /*#__PURE__*/_jsxDEV(\"span\", {\n className: \"homeBannerItemCount\",\n children: bannerData.tracks\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 9\n }, this), \"Tracks\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"homeBannerItem\",\n children: [isLoading ? /*#__PURE__*/_jsxDEV(ClipLoader, {\n color: \"#6AD7E5\",\n size: 34\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 13\n }, this) : /*#__PURE__*/_jsxDEV(\"span\", {\n className: \"homeBannerItemCount\",\n children: bannerData.artists\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 9\n }, this), \"Artists\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 23,\n columnNumber: 5\n }, this);\n};\n\n_s(HomeBanner, \"AmlffXNT4+lOwkG6/RFDQPAijWY=\");\n\n_c = HomeBanner;\nexport default HomeBanner;\n\nvar _c;\n\n$RefreshReg$(_c, \"HomeBanner\");","map":{"version":3,"sources":["/app/src/Components/HomeBanner.js"],"names":["React","useEffect","useState","getStats","ClipLoader","Link","HomeBanner","bannerData","setBannerData","isLoading","setIsLoading","then","data","users","undefined","scrobbles","tracks","artists"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,QAA3B,QAA2C,OAA3C;AACA,OAAO,YAAP;AACA,OAAO,kBAAP;AACA,SAASC,QAAT,QAAyB,cAAzB;AACA,OAAOC,UAAP,MAAuB,2BAAvB;AACA,SAASC,IAAT,QAAqB,kBAArB;;;AAEA,MAAMC,UAAU,GAAG,MAAM;AAAA;;AACvB,MAAI,CAACC,UAAD,EAAaC,aAAb,IAA8BN,QAAQ,CAAC,EAAD,CAA1C;AACA,MAAI,CAACO,SAAD,EAAYC,YAAZ,IAA4BR,QAAQ,CAAC,IAAD,CAAxC;AAEAD,EAAAA,SAAS,CAAC,MAAM;AACdE,IAAAA,QAAQ,GACLQ,IADH,CACQC,IAAI,IAAI;AACZ,UAAIA,IAAI,CAACC,KAAL,KAAeC,SAAnB,EAA8B;AAC5BN,QAAAA,aAAa,CAACI,IAAD,CAAb;AACAF,QAAAA,YAAY,CAAC,KAAD,CAAZ;AACD;AACF,KANH;AAOD,GARQ,EAQN,EARM,CAAT;AAUA,sBACE;AAAK,IAAA,SAAS,EAAC,YAAf;AAAA,4BACE;AAAK,MAAA,SAAS,EAAC,gBAAf;AAAA,6BACE,QAAC,IAAD;AAAM,QAAA,EAAE,EAAC,SAAT;AAAmB,QAAA,SAAS,EAAC,oBA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BAAhB;AAAA,kBAAuCF,UAAU,CAACU;AAAlD;AAAA;AAAA;AAAA;AAAA,cAHN,eAKE;AAAA;AAAA;AAAA;AAAA,cALF;AAAA;AAAA;AAAA;AAAA;AAAA,YAzBF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAmCD,CAjDD;;GAAMX,U;;KAAAA,U;AAmDN,eAAeA,UAAf","sourcesContent":["import React, { useEffect, useState } from 'react';\nimport '../App.css';\nimport './HomeBanner.css';\nimport { getStats } from '../Api/index';\nimport ClipLoader from 'react-spinners/ClipLoader'\nimport { Link } from 'react-router-dom';\n\nconst HomeBanner = () => {\n let [bannerData, setBannerData] = useState({});\n let [isLoading, setIsLoading] = useState(true);\n\n useEffect(() => {\n getStats()\n .then(data => {\n if (data.users !== undefined) {\n setBannerData(data);\n setIsLoading(false);\n }\n })\n }, [])\n\n return (\n <div className=\"homeBanner\">\n <div className=\"homeBannerItem\">\n <Link to=\"/recent\" className=\"homeBannerItemLink\">\n {isLoading\n ? <ClipLoader color=\"#6AD7E5\" size={34} />\n : <span className=\"homeBannerItemCount\">{bannerData.scrobbles}</span>\n \n }\n <br/>Scrobbles\n </Link>\n </div>\n <div className=\"homeBannerItem\">\n {isLoading\n ? <ClipLoader color=\"#6AD7E5\" size={34} />\n : <span className=\"homeBannerItemCount\">{bannerData.users}</span>\n }\n <br/>Users\n </div>\n <div className=\"homeBannerItem\">\n {isLoading\n ? <ClipLoader color=\"#6AD7E5\" size={34} />\n : <span className=\"homeBannerItemCount\">{bannerData.tracks}</span>\n }\n <br/>Tracks\n </div>\n <div className=\"homeBannerItem\">\n {isLoading\n ? <ClipLoader color=\"#6AD7E5\" size={34} />\n : <span className=\"homeBannerItemCount\">{bannerData.artists}</span>\n }\n <br/>Artists\n </div>\n </div>\n );\n}\n\nexport default HomeBanner;\n"]},"metadata":{},"sourceType":"module"} |