mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
1 line
13 KiB
JSON
1 line
13 KiB
JSON
{"ast":null,"code":"var _jsxFileName = \"/app/src/Pages/Album.js\",\n _s = $RefreshSig$();\n\nimport React, { useContext, useState, useEffect } from 'react';\nimport '../App.css';\nimport './Album.css';\nimport ScaleLoader from 'react-spinners/ScaleLoader';\nimport { getAlbum } from '../Api/index';\nimport TopUserTable from '../Components/TopUserTable';\nimport TracksForRecordTable from '../Components/TracksForRecordTable';\nimport AuthContext from '../Contexts/AuthContext';\nimport { Link } from 'react-router-dom';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst Album = route => {\n _s();\n\n const [loading, setLoading] = useState(true);\n const [album, setAlbum] = useState({});\n const {\n user\n } = useContext(AuthContext);\n let albumUUID = false;\n\n if (route && route.match && route.match.params && route.match.params.uuid) {\n albumUUID = route.match.params.uuid;\n } else {\n albumUUID = false;\n }\n\n useEffect(() => {\n if (!albumUUID) {\n return false;\n }\n\n getAlbum(albumUUID).then(data => {\n setAlbum(data);\n setLoading(false);\n });\n }, [albumUUID]);\n\n if (loading) {\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageWrapper\",\n children: /*#__PURE__*/_jsxDEV(ScaleLoader, {\n color: \"#6AD7E5\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 37,\n columnNumber: 7\n }, this);\n }\n\n if (!albumUUID || !album) {\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageWrapper\",\n children: \"Unable to fetch album\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 7\n }, this);\n }\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageWrapper\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n style: {\n margin: 0\n },\n children: [album.name, \" \", user && user.mod && /*#__PURE__*/_jsxDEV(Link, {\n to: \"/album/\" + album.uuid + \"/edit\",\n children: \"edit\"\n }, \"editbuttonomg\", false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 43\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageBody\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n style: {\n display: `flex`,\n flexWrap: `wrap`,\n textAlign: `center`\n },\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n style: {\n width: `300px`,\n padding: `0 10px 10px 10px`,\n textAlign: `left`\n },\n children: /*#__PURE__*/_jsxDEV(\"img\", {\n src: process.env.REACT_APP_API_URL + \"/img/\" + album.uuid + \"_full.jpg\",\n alt: album.name,\n style: {\n maxWidth: `300px`,\n maxHeight: `300px`\n }\n }, void 0, false, {\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), /*#__PURE__*/_jsxDEV(\"div\", {\n style: {\n width: `290px`,\n padding: `0 10px 10px 10px`,\n margin: `0 5px 0 5px`,\n textAlign: `left`\n },\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n style: {\n fontSize: '14pt'\n },\n children: [album.mbid && /*#__PURE__*/_jsxDEV(\"a\", {\n rel: \"noreferrer\",\n target: \"_blank\",\n href: \"https://musicbrainz.org/album/\" + album.mbid,\n children: [\"Open on MusicBrainz\", /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 138\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 30\n }, this), album.spotify_id && /*#__PURE__*/_jsxDEV(\"a\", {\n rel: \"noreferrer\",\n target: \"_blank\",\n href: \"https://open.spotify.com/album/\" + album.spotify_id,\n children: [\"Open on Spotify\", /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 147\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 36\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n style: {\n width: `290px`,\n padding: `0 10px 10px 10px`\n },\n children: [/*#__PURE__*/_jsxDEV(\"h3\", {\n children: \"Top 10 Scrobblers\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(TopUserTable, {\n albumuuid: album.uuid\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(TracksForRecordTable, {\n albumuuid: album.uuid\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 5\n }, this);\n};\n\n_s(Album, \"Bav9kLIQfNV+Fdh6QLZzB1vtNYQ=\");\n\n_c = Album;\nexport default Album;\n\nvar _c;\n\n$RefreshReg$(_c, \"Album\");","map":{"version":3,"sources":["/app/src/Pages/Album.js"],"names":["React","useContext","useState","useEffect","ScaleLoader","getAlbum","TopUserTable","TracksForRecordTable","AuthContext","Link","Album","route","loading","setLoading","album","setAlbum","user","albumUUID","match","params","uuid","then","data","margin","name","mod","display","flexWrap","textAlign","width","padding","process","env","REACT_APP_API_URL","maxWidth","maxHeight","fontSize","mbid","spotify_id"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,UAAhB,EAA4BC,QAA5B,EAAsCC,SAAtC,QAAuD,OAAvD;AACA,OAAO,YAAP;AACA,OAAO,aAAP;AACA,OAAOC,WAAP,MAAwB,4BAAxB;AACA,SAASC,QAAT,QAAyB,cAAzB;AACA,OAAOC,YAAP,MAAyB,4BAAzB;AACA,OAAOC,oBAAP,MAAiC,oCAAjC;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,SAASC,IAAT,QAAqB,kBAArB;;;AAEA,MAAMC,KAAK,GAAIC,KAAD,IAAW;AAAA;;AACvB,QAAM,CAACC,OAAD,EAAUC,UAAV,IAAwBX,QAAQ,CAAC,IAAD,CAAtC;AACA,QAAM,CAACY,KAAD,EAAQC,QAAR,IAAoBb,QAAQ,CAAC,EAAD,CAAlC;AACA,QAAM;AAAEc,IAAAA;AAAF,MAAWf,UAAU,CAACO,WAAD,CAA3B;AAEA,MAAIS,SAAS,GAAG,KAAhB;;AACA,MAAIN,KAAK,IAAIA,KAAK,CAACO,KAAf,IAAwBP,KAAK,CAACO,KAAN,CAAYC,MAApC,IAA8CR,KAAK,CAACO,KAAN,CAAYC,MAAZ,CAAmBC,IAArE,EAA2E;AACzEH,IAAAA,SAAS,GAAGN,KAAK,CAACO,KAAN,CAAYC,MAAZ,CAAmBC,IAA/B;AACD,GAFD,MAEO;AACLH,IAAAA,SAAS,GAAG,KAAZ;AACD;;AAEDd,EAAAA,SAAS,CAAC,MAAM;AACd,QAAI,CAACc,SAAL,EAAgB;AACd,aAAO,KAAP;AACD;;AAEDZ,IAAAA,QAAQ,CAACY,SAAD,CAAR,CACGI,IADH,CACQC,IAAI,IAAI;AACZP,MAAAA,QAAQ,CAACO,IAAD,CAAR;AACAT,MAAAA,UAAU,CAAC,KAAD,CAAV;AACD,KAJH;AAKD,GAVQ,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BAVF;AAAA;AAAA;AAAA;AAAA;AAAA,cADF,eAgBE,QAAC,oBAAD;AAAsB,QAAA,SAAS,EAAEN,KAAK,CAACM;AAAvC;AAAA;AAAA;AAAA;AAAA,cAhBF;AAAA;AAAA;AAAA;AAAA;AAAA,YAPF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA4BD,CApED;;GAAMV,K;;KAAAA,K;AAsEN,eAAeA,KAAf","sourcesContent":["import React, { useContext, useState, useEffect } from 'react';\nimport '../App.css';\nimport './Album.css';\nimport ScaleLoader from 'react-spinners/ScaleLoader';\nimport { getAlbum } from '../Api/index'\nimport TopUserTable from '../Components/TopUserTable';\nimport TracksForRecordTable from '../Components/TracksForRecordTable';\nimport AuthContext from '../Contexts/AuthContext';\nimport { Link } from 'react-router-dom';\n\nconst Album = (route) => {\n const [loading, setLoading] = useState(true);\n const [album, setAlbum] = useState({});\n const { user } = useContext(AuthContext);\n\n let albumUUID = false;\n if (route && route.match && route.match.params && route.match.params.uuid) {\n albumUUID = route.match.params.uuid;\n } else {\n albumUUID = false;\n }\n\n useEffect(() => {\n if (!albumUUID) {\n return false;\n }\n\n getAlbum(albumUUID)\n .then(data => {\n setAlbum(data);\n setLoading(false);\n })\n }, [albumUUID])\n\n if (loading) {\n return (\n <div className=\"pageWrapper\">\n <ScaleLoader color=\"#6AD7E5\" />\n </div>\n )\n }\n\n if (!albumUUID || !album) {\n return (\n <div className=\"pageWrapper\">\n Unable to fetch album\n </div>\n )\n }\n\n return (\n <div className=\"pageWrapper\">\n <h1 style={{margin: 0}}>\n {album.name} {user && user.mod && <Link\n key=\"editbuttonomg\"\n to={\"/album/\" + album.uuid + \"/edit\"}\n >edit</Link>}\n </h1>\n <div className=\"pageBody\">\n <div style={{display: `flex`, flexWrap: `wrap`, textAlign: `center`}}>\n <div style={{width: `300px`, padding: `0 10px 10px 10px`, textAlign: `left`}}>\n <img src={process.env.REACT_APP_API_URL + \"/img/\" + album.uuid + \"_full.jpg\"} alt={album.name} style={{maxWidth: `300px`, maxHeight: `300px`}}/>\n </div>\n <div style={{width: `290px`, padding: `0 10px 10px 10px`, margin: `0 5px 0 5px`, textAlign: `left`}}>\n <span style={{fontSize: '14pt'}}>\n {album.mbid && <a rel=\"noreferrer\" target=\"_blank\" href={\"https://musicbrainz.org/album/\" + album.mbid}>Open on MusicBrainz<br/></a>}\n {album.spotify_id && <a rel=\"noreferrer\" target=\"_blank\" href={\"https://open.spotify.com/album/\" + album.spotify_id}>Open on Spotify<br/></a>}\n </span>\n </div>\n <div style={{width: `290px`, padding: `0 10px 10px 10px`}}>\n <h3>Top 10 Scrobblers</h3>\n <TopUserTable albumuuid={album.uuid}/>\n </div>\n </div>\n <TracksForRecordTable albumuuid={album.uuid}/>\n </div>\n </div>\n );\n}\n\nexport default Album;"]},"metadata":{},"sourceType":"module"} |