fix: corriger toutes les erreurs de lint restantes (263 -> 0)
This commit is contained in:
@@ -72,7 +72,8 @@ export default function AwtisDetay({anAwtis}) {
|
||||
position: 'relative',
|
||||
flexShrink: 0,
|
||||
mb: 2,
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
{photoUrl ? (
|
||||
<Image
|
||||
src={photoUrl}
|
||||
@@ -94,8 +95,8 @@ export default function AwtisDetay({anAwtis}) {
|
||||
|
||||
{rezoSosyal?.length > 0 && (
|
||||
<Box sx={{display: 'flex', gap: 0.75, flexWrap: 'wrap', justifyContent: 'center', mb: 1.5}}>
|
||||
{rezoSosyal.map((rezo, i) => (
|
||||
<SocialButton key={i} rezo={rezo} />
|
||||
{rezoSosyal.map(rezo => (
|
||||
<SocialButton key={rezo.url} rezo={rezo} />
|
||||
))}
|
||||
</Box>
|
||||
)}
|
||||
@@ -149,9 +150,9 @@ export default function AwtisDetay({anAwtis}) {
|
||||
<Link href={`/paroles/${titrePhare.slug}`} style={{display: 'block', height: '100%'}}>
|
||||
<Box sx={{position: 'relative', minHeight: 130, height: '100%'}}>
|
||||
<Image
|
||||
fill
|
||||
src={coverUrl}
|
||||
alt={titrePhare.titre}
|
||||
fill
|
||||
placeholder='blur'
|
||||
blurDataURL={BLUR_DATA_URL}
|
||||
sizes='200px'
|
||||
@@ -163,7 +164,7 @@ export default function AwtisDetay({anAwtis}) {
|
||||
)}
|
||||
<Grid size={{xs: 12, sm: coverUrl ? 8 : 12}}>
|
||||
<CardContent>
|
||||
<Typography variant='subtitle1' sx={{fontWeight: 700}} gutterBottom>
|
||||
<Typography gutterBottom variant='subtitle1' sx={{fontWeight: 700}}>
|
||||
<Link href={`/paroles/${titrePhare.slug}`} style={{color: 'inherit', textDecoration: 'none'}}>
|
||||
{titrePhare.titre}
|
||||
</Link>
|
||||
@@ -172,8 +173,8 @@ export default function AwtisDetay({anAwtis}) {
|
||||
Écouter sur
|
||||
</Typography>
|
||||
<Box sx={{display: 'flex', flexWrap: 'wrap', gap: 1}}>
|
||||
{titrePhare.streamAudio.map((lyen, i) => (
|
||||
<StreamButton key={i} lyen={lyen} />
|
||||
{titrePhare.streamAudio.map(lyen => (
|
||||
<StreamButton key={lyen.url} lyen={lyen} />
|
||||
))}
|
||||
</Box>
|
||||
</CardContent>
|
||||
@@ -202,7 +203,7 @@ export default function AwtisDetay({anAwtis}) {
|
||||
})}
|
||||
</AccordionDetails>
|
||||
</Accordion>
|
||||
) : paroles.length === 0 ? (
|
||||
) : (paroles.length === 0 ? (
|
||||
<Typography textAlign='center' variant='body1' color='text.secondary'>
|
||||
Aucune parole pour le moment
|
||||
</Typography>
|
||||
@@ -213,7 +214,7 @@ export default function AwtisDetay({anAwtis}) {
|
||||
<MizikLyen anPawol={paroles[0]} kuveti={formatKuveti(paroles[0].couverture, 'thumbnail')} />
|
||||
</Paper>
|
||||
</Box>
|
||||
)}
|
||||
))}
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import {formatKuveti} from '../../lib/kuveti'
|
||||
import AwtisBiyografi from './awtis-biyografi'
|
||||
|
||||
const PREFIX = 'awtis-kat'
|
||||
const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3001'
|
||||
const IMAGE_URL = process.env.NEXT_PUBLIC_API_URL_ROOT || 'http://localhost:1337'
|
||||
const EXCLUSIVE_LABEL = process.env.NEXT_PUBLIC_EXCLUSIVE_ARTIST_LABEL || 'OKI Exclusif'
|
||||
|
||||
@@ -84,7 +83,7 @@ export default function AwtisKat({artiste}) {
|
||||
component='img'
|
||||
alt={alias}
|
||||
image={`${photo?.url ? `${IMAGE_URL}${formatKuveti(photo, 'thumbnail')?.url}` : noImageUrl}`}
|
||||
loading='lazy'
|
||||
loading='lazy'
|
||||
title={alias}
|
||||
/>
|
||||
<CardContent>
|
||||
|
||||
@@ -5,7 +5,6 @@ import {useRouter} from 'next/navigation'
|
||||
import TextField from '@mui/material/TextField'
|
||||
import Autocomplete from '@mui/material/Autocomplete'
|
||||
import Avatar from '@mui/material/Avatar'
|
||||
import CircularProgress from '@mui/material/CircularProgress'
|
||||
import Container from '@mui/material/Container'
|
||||
|
||||
import {jwennToutAwtis} from '../../lib/oki-api'
|
||||
@@ -29,7 +28,7 @@ export default function ChecheAwtis() {
|
||||
(async () => {
|
||||
try {
|
||||
const {data} = await jwennToutAwtis()
|
||||
|
||||
|
||||
const filteredData = data.map(artiste => {
|
||||
const firstLetter = artiste.alias[0].toUpperCase()
|
||||
return {
|
||||
@@ -50,15 +49,13 @@ export default function ChecheAwtis() {
|
||||
}
|
||||
}, [loading])
|
||||
|
||||
const sortedOptions = useMemo(() => {
|
||||
return [...options].sort((a, b) =>
|
||||
-b.firstLetter.localeCompare(a.firstLetter)
|
||||
);
|
||||
}, [options]);
|
||||
const sortedOptions = useMemo(() => [...options].sort((a, b) =>
|
||||
-b.firstLetter.localeCompare(a.firstLetter)
|
||||
), [options])
|
||||
|
||||
return (
|
||||
<Container
|
||||
sx={{ display: 'flex', justifyContent: 'center', marginBottom: 3 }}
|
||||
sx={{display: 'flex', justifyContent: 'center', marginBottom: 3}}
|
||||
>
|
||||
<Autocomplete
|
||||
autoHighlight
|
||||
@@ -70,35 +67,35 @@ export default function ChecheAwtis() {
|
||||
noOptionsText='Aucun résultat'
|
||||
id='cheche-awtis'
|
||||
options={sortedOptions}
|
||||
groupBy={(option) => option?.firstLetter}
|
||||
getOptionLabel={(option) => option?.alias}
|
||||
renderOption={(props, option) => {
|
||||
const {key, ...rest} = props;
|
||||
groupBy={option => option?.firstLetter}
|
||||
getOptionLabel={option => option?.alias}
|
||||
renderOption={(optionProps, option) => {
|
||||
const {key, ...rest} = optionProps
|
||||
|
||||
return (
|
||||
<li key={key} {...rest}>
|
||||
<Avatar
|
||||
style={{ marginRight: 8 }}
|
||||
style={{marginRight: 8}}
|
||||
alt={option?.alias}
|
||||
src={`${IMAGE_URL}${formatKuveti(option?.photo, 'thumbnail')?.url || ''}`}
|
||||
/>
|
||||
{option?.alias}
|
||||
</li>
|
||||
);
|
||||
)
|
||||
}}
|
||||
sx={{ width: 300 }}
|
||||
renderInput={(params) => (
|
||||
sx={{width: 300}}
|
||||
renderInput={params => (
|
||||
<TextField
|
||||
{...params}
|
||||
label='Rechercher un artiste'
|
||||
slotProps={{
|
||||
...params.slotProps,
|
||||
htmlInput: { ...params.slotProps.htmlInput },
|
||||
htmlInput: {...params.slotProps.htmlInput},
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
onChange={(event, newValue) => {
|
||||
router.push(`/awtis/${newValue.slug}`);
|
||||
router.push(`/awtis/${newValue.slug}`)
|
||||
}}
|
||||
onOpen={() => setOpen(true)}
|
||||
onClose={() => setOpen(false)}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import PropTypes from 'prop-types'
|
||||
import Chip from '@mui/material/Chip'
|
||||
import IconButton from '@mui/material/IconButton'
|
||||
import Tooltip from '@mui/material/Tooltip'
|
||||
@@ -11,23 +12,23 @@ import {
|
||||
} from '@icons-pack/react-simple-icons'
|
||||
|
||||
const SOCIAL_CONFIG = {
|
||||
Mastodon: {label: 'Mastodon', bg: '#6364FF', color: '#fff', Icon: Mastodon},
|
||||
Peertube: {label: 'PeerTube', bg: '#F2690D', color: '#fff', Icon: Peertube},
|
||||
Pixelfed: {label: 'Pixelfed', bg: '#11D49D', color: '#fff', Icon: null},
|
||||
Funkwhale: {label: 'Funkwhale', bg: '#E01B60', color: '#fff', Icon: null},
|
||||
Bluesky: {label: 'Bluesky', bg: '#0085FF', color: '#fff', Icon: null},
|
||||
Instagram: {label: 'Instagram', bg: '#E4405F', color: '#fff', Icon: Instagram},
|
||||
Youtube: {label: 'YouTube', bg: '#FF0000', color: '#fff', Icon: Youtube},
|
||||
Tiktok: {label: 'TikTok', bg: '#000000', color: '#fff', Icon: Tiktok},
|
||||
Spotify: {label: 'Spotify', bg: '#1DB954', color: '#fff', Icon: Spotify},
|
||||
Deezer: {label: 'Deezer', bg: '#EF5466', color: '#fff', Icon: Deezer},
|
||||
Mastodon: {label: 'Mastodon', bg: '#6364FF', color: '#fff', Icon: Mastodon},
|
||||
Peertube: {label: 'PeerTube', bg: '#F2690D', color: '#fff', Icon: Peertube},
|
||||
Pixelfed: {label: 'Pixelfed', bg: '#11D49D', color: '#fff', Icon: null},
|
||||
Funkwhale: {label: 'Funkwhale', bg: '#E01B60', color: '#fff', Icon: null},
|
||||
Bluesky: {label: 'Bluesky', bg: '#0085FF', color: '#fff', Icon: null},
|
||||
Instagram: {label: 'Instagram', bg: '#E4405F', color: '#fff', Icon: Instagram},
|
||||
Youtube: {label: 'YouTube', bg: '#FF0000', color: '#fff', Icon: Youtube},
|
||||
Tiktok: {label: 'TikTok', bg: '#000000', color: '#fff', Icon: Tiktok},
|
||||
Spotify: {label: 'Spotify', bg: '#1DB954', color: '#fff', Icon: Spotify},
|
||||
Deezer: {label: 'Deezer', bg: '#EF5466', color: '#fff', Icon: Deezer},
|
||||
Applemusic: {label: 'Apple Music', bg: '#FC3C44', color: '#fff', Icon: Applemusic},
|
||||
Bandcamp: {label: 'Bandcamp', bg: '#1DA0C3', color: '#fff', Icon: Bandcamp},
|
||||
Soundcloud: {label: 'SoundCloud', bg: '#FF5500', color: '#fff', Icon: Soundcloud},
|
||||
Facebook: {label: 'Facebook', bg: '#1877F2', color: '#fff', Icon: Facebook},
|
||||
Twitter: {label: 'X / Twitter', bg: '#000000', color: '#fff', Icon: Twitter},
|
||||
Linktree: {label: 'Linktree', bg: '#43E660', color: '#000', Icon: null},
|
||||
SiteWeb: {label: 'Site web', bg: '#555555', color: '#fff', Icon: null},
|
||||
Bandcamp: {label: 'Bandcamp', bg: '#1DA0C3', color: '#fff', Icon: Bandcamp},
|
||||
Soundcloud: {label: 'SoundCloud', bg: '#FF5500', color: '#fff', Icon: Soundcloud},
|
||||
Facebook: {label: 'Facebook', bg: '#1877F2', color: '#fff', Icon: Facebook},
|
||||
Twitter: {label: 'X / Twitter', bg: '#000000', color: '#fff', Icon: Twitter},
|
||||
Linktree: {label: 'Linktree', bg: '#43E660', color: '#000', Icon: null},
|
||||
SiteWeb: {label: 'Site web', bg: '#555555', color: '#fff', Icon: null},
|
||||
}
|
||||
|
||||
export function SocialButton({rezo}) {
|
||||
@@ -59,15 +60,22 @@ export function SocialButton({rezo}) {
|
||||
return (
|
||||
<Tooltip title={rezo.url}>
|
||||
<Chip
|
||||
clickable
|
||||
label={config.label}
|
||||
component='a'
|
||||
href={rezo.url}
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
clickable
|
||||
size='small'
|
||||
sx={{bgcolor: config.bg, color: config.color, fontWeight: 600}}
|
||||
/>
|
||||
</Tooltip>
|
||||
)
|
||||
}
|
||||
|
||||
SocialButton.propTypes = {
|
||||
rezo: PropTypes.shape({
|
||||
plateforme: PropTypes.string.isRequired,
|
||||
url: PropTypes.string.isRequired
|
||||
}).isRequired
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user