refactor: rename isOKIAwtis to isExclusiveArtist
This commit is contained in:
@@ -28,18 +28,19 @@ import AwtisBiyografi from './awtis-biyografi'
|
||||
import MizikLyen from './mizik-lyen'
|
||||
|
||||
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'
|
||||
const BLUR_DATA_URL = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNsYAAAAAYAAjCB0C8AAAAASUVORK5CYII='
|
||||
|
||||
const sortTeks = paroles => paroles.sort((a, b) => a.titre.localeCompare(b.titre, 'fr', {sensitivity: 'base'}))
|
||||
|
||||
export default function AwtisDetay({anAwtis}) {
|
||||
const [esByografiOuve, meteEsByografiOuve] = useState(false)
|
||||
const {alias, biographie, paroles, photo, isOKIAwtis, titrePhare} = anAwtis
|
||||
const {alias, biographie, paroles, photo, isExclusiveArtist, titrePhare} = anAwtis
|
||||
const sortedTeks = sortTeks(paroles)
|
||||
const gwanBiyo = biographie && biographie.length > 100
|
||||
const biyo = gwanBiyo ? `${biographie.slice(0, 100)}...` : biographie
|
||||
|
||||
const hasStreaming = isOKIAwtis && titrePhare?.streamAudio?.length > 0
|
||||
const hasStreaming = isExclusiveArtist && titrePhare?.streamAudio?.length > 0
|
||||
const coverUrl = titrePhare?.couverture
|
||||
? `${IMAGE_URL}${titrePhare.couverture.formats?.small?.url || titrePhare.couverture.formats?.thumbnail?.url || titrePhare.couverture.url}`
|
||||
: null
|
||||
@@ -81,11 +82,11 @@ export default function AwtisDetay({anAwtis}) {
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
{isOKIAwtis && (
|
||||
{isExclusiveArtist && (
|
||||
<Box sx={{display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 0.75, mb: 2}}>
|
||||
<Chip
|
||||
icon={<VerifiedIcon sx={{fontSize: 16}} />}
|
||||
label='Artiste OKI Exclusif'
|
||||
label={`Artiste ${EXCLUSIVE_LABEL}`}
|
||||
size='small'
|
||||
sx={{bgcolor: '#FFD700', color: '#000', fontWeight: 700, '& .MuiChip-icon': {color: '#000'}}}
|
||||
/>
|
||||
|
||||
@@ -20,6 +20,7 @@ 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'
|
||||
|
||||
const classes = {
|
||||
root: `${PREFIX}-root`,
|
||||
@@ -57,16 +58,16 @@ export default function AwtisKat({artiste}) {
|
||||
const router = useRouter()
|
||||
const [esByografiOuve, meteEsByografiOuve] = useState(false)
|
||||
|
||||
const {alias, biographie, paroles, photo, slug, isOKIAwtis} = artiste
|
||||
const {alias, biographie, paroles, photo, slug, isExclusiveArtist} = artiste
|
||||
|
||||
return (
|
||||
<Grid size={{xs: 12, sm: 6, md: 4}}>
|
||||
<Kat>
|
||||
<Card sx={{maxWidth: 340, position: 'relative', ...(isOKIAwtis && {outline: '2px solid #FFD700'})}}>
|
||||
{isOKIAwtis && (
|
||||
<Card sx={{maxWidth: 340, position: 'relative', ...(isExclusiveArtist && {outline: '2px solid #FFD700'})}}>
|
||||
{isExclusiveArtist && (
|
||||
<Chip
|
||||
icon={<VerifiedIcon sx={{fontSize: 14}} />}
|
||||
label='OKI Exclusif'
|
||||
label={EXCLUSIVE_LABEL}
|
||||
size='small'
|
||||
sx={{
|
||||
position: 'absolute', top: 8, left: 8, zIndex: 1,
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ export async function jwennAwtisPajinasyon(paj) {
|
||||
const start = AWTIS_POU_CHAK_PAJ * (paj - 1)
|
||||
const query = qs.stringify({
|
||||
populate: ['paroles', 'photo'],
|
||||
sort: ['isOKIAwtis:desc', 'createdAt:desc'],
|
||||
sort: ['isExclusiveArtist:desc', 'createdAt:desc'],
|
||||
pagination: {
|
||||
start,
|
||||
limit: AWTIS_POU_CHAK_PAJ
|
||||
|
||||
Reference in New Issue
Block a user