GoScrobble/web/node_modules/.cache/babel-loader/3295ebce1d6fe82d49ad5321fa0c9350.json

1 line
13 KiB
JSON

{"ast":null,"code":"var _jsxFileName = \"/app/src/Pages/Artist.js\",\n _s = $RefreshSig$();\n\nimport React, { useContext, useState, useEffect } from 'react';\nimport '../App.css';\nimport './Artist.css';\nimport ScaleLoader from 'react-spinners/ScaleLoader';\nimport { getArtist } from '../Api/index';\nimport TracksForRecordTable from '../Components/TracksForRecordTable';\nimport TopUserTable from '../Components/TopUserTable';\nimport AuthContext from '../Contexts/AuthContext';\nimport { Link } from 'react-router-dom';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst Artist = route => {\n _s();\n\n const [loading, setLoading] = useState(true);\n const [artist, setArtist] = useState({});\n const {\n user\n } = useContext(AuthContext);\n let artistUUID = false;\n\n if (route && route.match && route.match.params && route.match.params.uuid) {\n artistUUID = route.match.params.uuid;\n } else {\n artistUUID = false;\n }\n\n useEffect(() => {\n if (!artistUUID) {\n return false;\n }\n\n getArtist(artistUUID).then(data => {\n setArtist(data);\n setLoading(false);\n });\n }, [artistUUID]);\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 (!artistUUID || !artist) {\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageWrapper\",\n children: \"Unable to fetch artist\"\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: [artist.name, \" \", user && /*#__PURE__*/_jsxDEV(Link, {\n to: \"/artist/\" + artist.uuid + \"/edit\",\n children: \"edit\"\n }, \"editbuttonomg\", false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 32\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/\" + artist.uuid + \"_full.jpg\",\n alt: artist.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: [artist.mbid && /*#__PURE__*/_jsxDEV(\"a\", {\n rel: \"noreferrer\",\n target: \"_blank\",\n href: \"https://musicbrainz.org/artist/\" + artist.mbid,\n children: [\"Open on MusicBrainz\", /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 141\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 31\n }, this), artist.spotify_id && /*#__PURE__*/_jsxDEV(\"a\", {\n rel: \"noreferrer\",\n target: \"_blank\",\n href: \"https://open.spotify.com/artist/\" + artist.spotify_id,\n children: [\"Open on Spotify\", /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 150\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 37\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 artistuuid: artist.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 artistuuid: artist.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(Artist, \"YRvs/jfcHPCVseI5zSgXVJkkcrU=\");\n\n_c = Artist;\nexport default Artist;\n\nvar _c;\n\n$RefreshReg$(_c, \"Artist\");","map":{"version":3,"sources":["/app/src/Pages/Artist.js"],"names":["React","useContext","useState","useEffect","ScaleLoader","getArtist","TracksForRecordTable","TopUserTable","AuthContext","Link","Artist","route","loading","setLoading","artist","setArtist","user","artistUUID","match","params","uuid","then","data","margin","name","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,cAAP;AACA,OAAOC,WAAP,MAAwB,4BAAxB;AACA,SAASC,SAAT,QAA0B,cAA1B;AACA,OAAOC,oBAAP,MAAiC,oCAAjC;AACA,OAAOC,YAAP,MAAyB,4BAAzB;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,SAASC,IAAT,QAAqB,kBAArB;;;AAEA,MAAMC,MAAM,GAAIC,KAAD,IAAW;AAAA;;AACxB,QAAM,CAACC,OAAD,EAAUC,UAAV,IAAwBX,QAAQ,CAAC,IAAD,CAAtC;AACA,QAAM,CAACY,MAAD,EAASC,SAAT,IAAsBb,QAAQ,CAAC,EAAD,CAApC;AACA,QAAM;AAAEc,IAAAA;AAAF,MAAWf,UAAU,CAACO,WAAD,CAA3B;AAEA,MAAIS,UAAU,GAAG,KAAjB;;AACA,MAAIN,KAAK,IAAIA,KAAK,CAACO,KAAf,IAAwBP,KAAK,CAACO,KAAN,CAAYC,MAApC,IAA8CR,KAAK,CAACO,KAAN,CAAYC,MAAZ,CAAmBC,IAArE,EAA2E;AACzEH,IAAAA,UAAU,GAAGN,KAAK,CAACO,KAAN,CAAYC,MAAZ,CAAmBC,IAAhC;AACD,GAFD,MAEO;AACLH,IAAAA,UAAU,GAAG,KAAb;AACD;;AAEDd,EAAAA,SAAS,CAAC,MAAM;AACd,QAAI,CAACc,UAAL,EAAiB;AACf,aAAO,KAAP;AACD;;AAEDZ,IAAAA,SAAS,CAACY,UAAD,CAAT,CACGI,IADH,CACQC,IAAI,IAAI;AACZP,MAAAA,SAAS,CAACO,IAAD,CAAT;AACAT,MAAAA,UAAU,CAAC,KAAD,CAAV;AACD,KAJH;AAKD,GAVQ,EAUN,C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,eAgBE,QAAC,oBAAD;AAAsB,QAAA,UAAU,EAAEN,MAAM,CAACM;AAAzC;AAAA;AAAA;AAAA;AAAA,cAhBF;AAAA;AAAA;AAAA;AAAA;AAAA,YAPF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA4BD,CApED;;GAAMV,M;;KAAAA,M;AAsEN,eAAeA,MAAf","sourcesContent":["import React, { useContext, useState, useEffect } from 'react';\nimport '../App.css';\nimport './Artist.css';\nimport ScaleLoader from 'react-spinners/ScaleLoader';\nimport { getArtist } from '../Api/index'\nimport TracksForRecordTable from '../Components/TracksForRecordTable';\nimport TopUserTable from '../Components/TopUserTable';\nimport AuthContext from '../Contexts/AuthContext';\nimport { Link } from 'react-router-dom';\n\nconst Artist = (route) => {\n const [loading, setLoading] = useState(true);\n const [artist, setArtist] = useState({});\n const { user } = useContext(AuthContext);\n\n let artistUUID = false;\n if (route && route.match && route.match.params && route.match.params.uuid) {\n artistUUID = route.match.params.uuid;\n } else {\n artistUUID = false;\n }\n\n useEffect(() => {\n if (!artistUUID) {\n return false;\n }\n\n getArtist(artistUUID)\n .then(data => {\n setArtist(data);\n setLoading(false);\n })\n }, [artistUUID])\n\n if (loading) {\n return (\n <div className=\"pageWrapper\">\n <ScaleLoader color=\"#6AD7E5\" />\n </div>\n )\n }\n\n if (!artistUUID || !artist) {\n return (\n <div className=\"pageWrapper\">\n Unable to fetch artist\n </div>\n )\n }\n\n return (\n <div className=\"pageWrapper\">\n <h1 style={{margin: 0}}>\n {artist.name} {user && <Link\n key=\"editbuttonomg\"\n to={\"/artist/\" + artist.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/\" + artist.uuid + \"_full.jpg\"} alt={artist.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 {artist.mbid && <a rel=\"noreferrer\" target=\"_blank\" href={\"https://musicbrainz.org/artist/\" + artist.mbid}>Open on MusicBrainz<br/></a>}\n {artist.spotify_id && <a rel=\"noreferrer\" target=\"_blank\" href={\"https://open.spotify.com/artist/\" + artist.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 artistuuid={artist.uuid}/>\n </div>\n </div>\n <TracksForRecordTable artistuuid={artist.uuid}/>\n </div>\n </div>\n );\n}\n\nexport default Artist;"]},"metadata":{},"sourceType":"module"}