Fix lint errors
This commit is contained in:
@@ -90,7 +90,7 @@ export default function MizikBadjMeni({teks}) {
|
||||
>
|
||||
<Paper>
|
||||
<ClickAwayListener onClickAway={handleClose}>
|
||||
<MenuList autoFocusItem={open} id='menu-list-grow' onKeyDown={handleListKeyDown}>
|
||||
<MenuList autoFocusItem={open} id='menu-list-grow' onKeyDown={() => handleListKeyDown()}>
|
||||
{teks.map(t => <MenuItem key={t._id} onClick={() => handleClick(t.slug)}>{t.tit}</MenuItem>)}
|
||||
</MenuList>
|
||||
</ClickAwayListener>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import {useState, useEffect, useRef} from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import {useSession} from 'next-auth/client'
|
||||
import Koneksyon from '../sesyon/koneksyon'
|
||||
|
||||
import {
|
||||
IconButton,
|
||||
@@ -17,8 +16,9 @@ import {
|
||||
makeStyles
|
||||
} from '@material-ui/core'
|
||||
import AddCommentIcon from '@material-ui/icons/AddComment'
|
||||
import KomanteList from './komante-list'
|
||||
import {useRouter} from 'next/router'
|
||||
import Koneksyon from '../sesyon/koneksyon'
|
||||
import KomanteList from './komante-list'
|
||||
import EkriKomante from './ekri-komante'
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
|
||||
@@ -34,7 +34,7 @@ function Dekoneksyon({chimen, tooltipPlacement, ...props}) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Link href='/api/auth/signout'>
|
||||
<Link passHref href='/api/auth/signout'>
|
||||
<DekoneksonTooltip title='Dékoneksyon' placement={tooltipPlacement} TransitionComponent={Zoom}>
|
||||
<Fab
|
||||
className={classes.dekoneksyon}
|
||||
|
||||
@@ -12,7 +12,7 @@ export default function LoginProvider({id, title, icon, callbackUrl}) {
|
||||
}
|
||||
|
||||
return (
|
||||
<Link href='/api/auth/signin'>
|
||||
<Link passHref href='/api/auth/signin'>
|
||||
<Button
|
||||
variant='contained'
|
||||
color='primary'
|
||||
|
||||
@@ -260,7 +260,7 @@ function EkriTeks({session}) {
|
||||
{loading && <LinearProgress size={24} style={{width: '100%', marginBlock: '1em'}} />}
|
||||
</div>
|
||||
{success && (
|
||||
<Snackbar open={open} autoHideDuration={10000} onClose={handleClose}>
|
||||
<Snackbar open={open} autoHideDuration={10_000} onClose={handleClose}>
|
||||
<Alert severity='success' onClose={handleClose}>
|
||||
<strong>{success}</strong>
|
||||
</Alert>
|
||||
|
||||
@@ -19,20 +19,37 @@ const kouteyAchteyIcons = {
|
||||
|
||||
function RannIframe({boutik, url, isMobile}) {
|
||||
let src = ''
|
||||
if (boutik === 'Tidal') {
|
||||
switch (boutik) {
|
||||
case 'Tidal': {
|
||||
const trackArray = url.split('/')
|
||||
const trackId = trackArray[trackArray.length - 1]
|
||||
src = `https://embed.tidal.com/tracks/${trackId}?disableAnalytics=true`
|
||||
} else if (boutik === 'Deezer') {
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
case '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') {
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
case 'Spotify': {
|
||||
const trackArray = url.split('/')
|
||||
const trackId = trackArray[trackArray.length - 1]
|
||||
src = `https://open.spotify.com/embed/track/${trackId}`
|
||||
} else if (boutik === 'Soundcloud') {
|
||||
|
||||
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 (
|
||||
{!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 {
|
||||
const kouteyAchteyActions = kouteyAchtey.map(({boutik, url}) => ({
|
||||
icon: kouteyAchteyIcons[boutik],
|
||||
name: boutik,
|
||||
link: url
|
||||
}
|
||||
})
|
||||
}))
|
||||
|
||||
const vweyActions = lyen.map(({url, sit}) => {
|
||||
return {
|
||||
const vweyActions = lyen.map(({url, sit}) => ({
|
||||
icon: vweyIcons[sit],
|
||||
name: sit,
|
||||
link: url
|
||||
}
|
||||
})
|
||||
}))
|
||||
|
||||
const handleOpen = () => {
|
||||
meteOuve(true)
|
||||
|
||||
+3
-3
@@ -1,3 +1,3 @@
|
||||
export const formatJsonString = stringToFormat => {
|
||||
return stringToFormat.split('\n').map((string, index) => <div key={index}>{`${string}`}<br /></div>) // eslint-disable-line react/no-array-index-key
|
||||
}
|
||||
export const formatJsonString = stringToFormat =>
|
||||
stringToFormat.split('\n').map((string, index) => <div key={index}>{`${string}`}<br /></div>) // eslint-disable-line react/no-array-index-key
|
||||
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
import PropTypes from 'prop-types'
|
||||
import Image from 'next/image'
|
||||
import {Box, Container, Grid, Typography, Button} from '@material-ui/core'
|
||||
import {makeStyles} from '@material-ui/core/styles'
|
||||
import {Container, Grid, Typography, Button} from '@material-ui/core'
|
||||
import GroupIcon from '@material-ui/icons/Group'
|
||||
import MusicNoteIcon from '@material-ui/icons/MusicNote'
|
||||
import {Pleroma, Peertube, Paypal} from '@icons-pack/react-simple-icons'
|
||||
|
||||
@@ -2,8 +2,7 @@ import {jwennSlugs} from '../lib/oki-api'
|
||||
|
||||
const url = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost'
|
||||
|
||||
const createSitemap = teks => {
|
||||
return (
|
||||
const createSitemap = teks => (
|
||||
`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
@@ -19,18 +18,15 @@ const createSitemap = teks => {
|
||||
<priority>0.6</priority>
|
||||
</url>
|
||||
${teks
|
||||
.map(m => {
|
||||
return `
|
||||
.map(m => `
|
||||
<url>
|
||||
<loc>${`${url}/teks/${m}`}</loc>
|
||||
</url>
|
||||
`
|
||||
})
|
||||
`)
|
||||
.join('')}
|
||||
</urlset>
|
||||
`
|
||||
)
|
||||
}
|
||||
|
||||
export default function Sitemap() {
|
||||
return null
|
||||
|
||||
@@ -5,9 +5,7 @@ import {jwennTeksEpiSlug, jwennTeks, jwennKomanteEpiTeksId} from '../../lib/oki-
|
||||
import TeksDrawer from '../../components/teks/teks-drawer'
|
||||
import HeadLayout from '../../components/head-layout'
|
||||
|
||||
const jwennAwtis = awtis => {
|
||||
return awtis.map(a => a.alias).join(', ')
|
||||
}
|
||||
const jwennAwtis = awtis => awtis.map(a => a.alias).join(', ')
|
||||
|
||||
export default function SlugTeks({teks, anTeks, slug, komante}) {
|
||||
const awtis = anTeks.awtis.length === 1 ? anTeks.awtis[0].alias : jwennAwtis(anTeks.awtis)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const express = require('express')
|
||||
const next = require('next')
|
||||
const compression = require('compression')
|
||||
const path = require('path')
|
||||
|
||||
const port = process.env.PORT || 3000
|
||||
const dev = process.env.NODE_ENV !== 'production'
|
||||
@@ -26,13 +25,9 @@ app.prepare().then(() => {
|
||||
})
|
||||
})
|
||||
|
||||
server.get('*', (request, response) => {
|
||||
return handle(request, response)
|
||||
})
|
||||
server.get('*', (request, response) => handle(request, response))
|
||||
|
||||
server.post('*', (request, response) => {
|
||||
return handle(request, response)
|
||||
})
|
||||
server.post('*', (request, response) => handle(request, response))
|
||||
|
||||
server.listen(port, error => {
|
||||
if (error) {
|
||||
|
||||
Reference in New Issue
Block a user