feat: optimize cover in search
This commit is contained in:
@@ -51,7 +51,7 @@ export default function AwtisDetay({anAwtis}) {
|
||||
</Box>
|
||||
<Box sx={{justifyContent: 'center', display: 'flex', marginBottom: 2}}>
|
||||
<Avatar
|
||||
src={`${photo?.url ? `${IMAGE_URL}${photo?.url}` : noImageUrl}`}
|
||||
src={photo?.url ? `${IMAGE_URL}${photo?.formats?.small?.url || photo?.formats?.thumbnail?.url || photo?.url}` : noImageUrl}
|
||||
alt={`Photo ${alias}`}
|
||||
sx={{width: 200, height: 200, border: `2px solid ${green[500]}`}}
|
||||
/>
|
||||
@@ -88,7 +88,7 @@ export default function AwtisDetay({anAwtis}) {
|
||||
<AccordionDetails sx={{paddingInline: 0}}>
|
||||
{sortedTeks.map(anPawol => {
|
||||
const {couverture} = anPawol
|
||||
const kuvetiFormat = formatKuveti(couverture)
|
||||
const kuvetiFormat = couverture?.formats?.thumbnail || formatKuveti(couverture)
|
||||
|
||||
return (
|
||||
<Box key={anPawol.id} sx={{paddingBlock: 0.5}}>
|
||||
@@ -105,7 +105,7 @@ export default function AwtisDetay({anAwtis}) {
|
||||
<Box>
|
||||
<Typography gutterBottom textalign='center' variant='body1' component='h2'><strong>Parole</strong></Typography>
|
||||
<Paper sx={{height: '100%', paddingBlock: 2}}>
|
||||
<MizikLyen anPawol={paroles[0]} kuveti={formatKuveti(paroles[0].couverture)} />
|
||||
<MizikLyen anPawol={paroles[0]} kuveti={paroles[0].couverture?.formats?.thumbnail || formatKuveti(paroles[0].couverture)} />
|
||||
</Paper>
|
||||
</Box>
|
||||
)
|
||||
|
||||
@@ -79,7 +79,7 @@ export default function ChecheAwtis() {
|
||||
<Avatar
|
||||
style={{ marginRight: 8 }}
|
||||
alt={option?.alias}
|
||||
src={`${IMAGE_URL}${option?.photo?.formats?.thumbnail?.url}`}
|
||||
src={`${IMAGE_URL}${option?.photo?.formats?.thumbnail?.url || option?.photo?.url || ''}`}
|
||||
/>
|
||||
{option?.alias}
|
||||
</li>
|
||||
|
||||
@@ -34,7 +34,7 @@ export default function MizikLis({niAwtis, paroles, meteEsMobilOuve}) {
|
||||
itemContent={index => {
|
||||
const anPawol = pawol[index]
|
||||
const {couverture} = anPawol
|
||||
const kuvetiFormat = formatKuveti(couverture)
|
||||
const kuvetiFormat = couverture?.formats?.thumbnail || formatKuveti(couverture)
|
||||
|
||||
return (
|
||||
<MizikLyen niAwtis={niAwtis} anPawol={anPawol} kuveti={kuvetiFormat} slug={params.slug} meteEsMobilOuve={meteEsMobilOuve} />
|
||||
|
||||
Reference in New Issue
Block a user