Fix teks image error
This commit is contained in:
+14
-3
@@ -12,12 +12,23 @@ const jwennAwtis = awtis => {
|
||||
export default function SlugTeks({teks, anTeks, slug}) {
|
||||
const awtis = anTeks.awtis.length === 1 ? anTeks.awtis[0].alias : jwennAwtis(anTeks.awtis)
|
||||
const {kouveti} = anTeks
|
||||
const formatKouveti = () => {
|
||||
if (!kouveti) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (kouveti && kouveti.formats && kouveti.formats.small) {
|
||||
return kouveti.formats.small
|
||||
}
|
||||
|
||||
return kouveti
|
||||
}
|
||||
|
||||
return (
|
||||
<HeadLayout
|
||||
imageWidth={kouveti ? kouveti.formats.small.width : null}
|
||||
imageHeight={kouveti ? kouveti.formats.small.height : null}
|
||||
imageUrl={kouveti ? kouveti.formats.small.url : null}
|
||||
imageUrl={formatKouveti() ? formatKouveti().url : null}
|
||||
imageWidth={formatKouveti() ? formatKouveti().width : null}
|
||||
imageHeight={formatKouveti() ? formatKouveti().height : null}
|
||||
title={`${awtis} - ${anTeks.tit}`} tab={2} slug={`teks/${slug}`}
|
||||
>
|
||||
<TeksDrawer teks={teks} anTeks={anTeks} />
|
||||
|
||||
Reference in New Issue
Block a user