Fix lint errors
This commit is contained in:
@@ -19,20 +19,37 @@ const kouteyAchteyIcons = {
|
||||
|
||||
function RannIframe({boutik, url, isMobile}) {
|
||||
let src = ''
|
||||
if (boutik === 'Tidal') {
|
||||
const trackArray = url.split('/')
|
||||
const trackId = trackArray[trackArray.length - 1]
|
||||
src = `https://embed.tidal.com/tracks/${trackId}?disableAnalytics=true`
|
||||
} else if (boutik === 'Deezer') {
|
||||
const trackArray = url.split('/')
|
||||
const trackId = trackArray[trackArray.length - 1]
|
||||
src = `https://widget.deezer.com/widget/auto/track/${trackId}?tracklist=false`
|
||||
} else if (boutik === 'Spotify') {
|
||||
const trackArray = url.split('/')
|
||||
const trackId = trackArray[trackArray.length - 1]
|
||||
src = `https://open.spotify.com/embed/track/${trackId}`
|
||||
} else if (boutik === 'Soundcloud') {
|
||||
src = `https://w.soundcloud.com/player/?url=${url}`
|
||||
switch (boutik) {
|
||||
case 'Tidal': {
|
||||
const trackArray = url.split('/')
|
||||
const trackId = trackArray[trackArray.length - 1]
|
||||
src = `https://embed.tidal.com/tracks/${trackId}?disableAnalytics=true`
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
case 'Deezer': {
|
||||
const trackArray = url.split('/')
|
||||
const trackId = trackArray[trackArray.length - 1]
|
||||
src = `https://widget.deezer.com/widget/auto/track/${trackId}?tracklist=false`
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
case 'Spotify': {
|
||||
const trackArray = url.split('/')
|
||||
const trackId = trackArray[trackArray.length - 1]
|
||||
src = `https://open.spotify.com/embed/track/${trackId}`
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
case 'Soundcloud': {
|
||||
src = `https://w.soundcloud.com/player/?url=${url}`
|
||||
|
||||
break
|
||||
}
|
||||
// No default
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -108,13 +125,11 @@ function EntegreMizik({anTeks, isMobile}) {
|
||||
Écouter
|
||||
</Typography>
|
||||
|
||||
{!okiMizikID && filteredKouteyAchtey.map(({_id, boutik, url}) => {
|
||||
return (
|
||||
<IconButton key={_id} aria-label='player' onClick={() => handleClick(boutik, url)}>
|
||||
{kouteyAchteyIcons[boutik]}
|
||||
</IconButton>
|
||||
)
|
||||
})}
|
||||
{!okiMizikID && filteredKouteyAchtey.map(({_id, boutik, url}) => (
|
||||
<IconButton key={_id} aria-label='player' onClick={() => handleClick(boutik, url)}>
|
||||
{kouteyAchteyIcons[boutik]}
|
||||
</IconButton>
|
||||
))}
|
||||
|
||||
{chwaMizik && (
|
||||
<RannIframe boutik={chwaMizik.boutik} url={chwaMizik.url} isMobile={isMobile} />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, {useState} from 'react'
|
||||
import {useState} from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
import {makeStyles} from '@material-ui/core/styles'
|
||||
|
||||
@@ -28,6 +28,7 @@ import MenuIcon from '@material-ui/icons/Menu'
|
||||
|
||||
import {makeStyles, useTheme} from '@material-ui/core/styles'
|
||||
|
||||
import MuiAlert from '@material-ui/lab/Alert'
|
||||
import {formatJsonString} from '../../lib/utils/format'
|
||||
|
||||
import VweKomante from '../komante/vwe-komante'
|
||||
@@ -40,8 +41,6 @@ import OkiMizik from './oki-mizik'
|
||||
import Pataje from './pataje'
|
||||
import EntegreMizik from './entegre-mizik'
|
||||
|
||||
import MuiAlert from '@material-ui/lab/Alert'
|
||||
|
||||
function Alert(props) {
|
||||
return <MuiAlert elevation={6} variant='filled' {...props} />
|
||||
}
|
||||
@@ -228,7 +227,7 @@ export default function TeksDrawer({teks, anTeks, komante}) {
|
||||
</IconButton>
|
||||
{anTeks ? (
|
||||
<>
|
||||
<Link href='/teks'>
|
||||
<Link passHref href='/teks'>
|
||||
<IconButton aria-label='return' size='medium'>
|
||||
<KeyboardBackspaceIcon style={{fontSize: '1.5em'}} />
|
||||
</IconButton>
|
||||
|
||||
@@ -51,21 +51,17 @@ export default function VweKouteAchte({anTeks, niVideyo, niOdyo}) {
|
||||
const [ouve, meteOuve] = useState(false)
|
||||
const {kouteyAchtey, lyen} = anTeks
|
||||
|
||||
const kouteyAchteyActions = kouteyAchtey.map(({boutik, url}) => {
|
||||
return {
|
||||
icon: kouteyAchteyIcons[boutik],
|
||||
name: boutik,
|
||||
link: url
|
||||
}
|
||||
})
|
||||
const kouteyAchteyActions = kouteyAchtey.map(({boutik, url}) => ({
|
||||
icon: kouteyAchteyIcons[boutik],
|
||||
name: boutik,
|
||||
link: url
|
||||
}))
|
||||
|
||||
const vweyActions = lyen.map(({url, sit}) => {
|
||||
return {
|
||||
icon: vweyIcons[sit],
|
||||
name: sit,
|
||||
link: url
|
||||
}
|
||||
})
|
||||
const vweyActions = lyen.map(({url, sit}) => ({
|
||||
icon: vweyIcons[sit],
|
||||
name: sit,
|
||||
link: url
|
||||
}))
|
||||
|
||||
const handleOpen = () => {
|
||||
meteOuve(true)
|
||||
|
||||
Reference in New Issue
Block a user