mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
1 line
13 KiB
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
|