Add slug to HeadLayout

This commit is contained in:
2020-12-24 13:39:07 +01:00
parent e4e72a9cfd
commit e3b91fd93c
4 changed files with 14 additions and 9 deletions
+6 -4
View File
@@ -5,9 +5,9 @@ import {jwennTeksEpiSlug, jwennTeks} from '../../lib/oki-api'
import TeksDrawer from '../../components/teks/teks-drawer'
import HeadLayout from '../../components/head-layout'
export default function SlugTeks({teks, anTeks}) {
export default function SlugTeks({teks, anTeks, slug}) {
return (
<HeadLayout title={`Tèks | ${anTeks.tit}`} tab={2}>
<HeadLayout title={`Tèks | ${anTeks.tit}`} tab={2} slug={`teks/${slug}`}>
<TeksDrawer teks={teks} anTeks={anTeks} />
</HeadLayout>
)
@@ -25,12 +25,14 @@ export async function getServerSideProps({query}) {
return {
props: {
teks,
anTeks
anTeks,
slug
}
}
}
SlugTeks.propTypes = {
teks: PropTypes.array.isRequired,
anTeks: PropTypes.object.isRequired
anTeks: PropTypes.object.isRequired,
slug: PropTypes.string.isRequired
}