Add slug to HeadLayout
This commit is contained in:
@@ -6,7 +6,8 @@ import Navigasyon from './navigasyon'
|
|||||||
export default function HeadLayout({
|
export default function HeadLayout({
|
||||||
children,
|
children,
|
||||||
title,
|
title,
|
||||||
tab
|
tab,
|
||||||
|
slug
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@@ -51,9 +52,11 @@ export default function HeadLayout({
|
|||||||
HeadLayout.propTypes = {
|
HeadLayout.propTypes = {
|
||||||
children: PropTypes.node.isRequired,
|
children: PropTypes.node.isRequired,
|
||||||
title: PropTypes.string,
|
title: PropTypes.string,
|
||||||
tab: PropTypes.number.isRequired
|
tab: PropTypes.number.isRequired,
|
||||||
|
slug: PropTypes.string
|
||||||
}
|
}
|
||||||
|
|
||||||
HeadLayout.defaultProps = {
|
HeadLayout.defaultProps = {
|
||||||
title: null
|
title: null,
|
||||||
|
slug: null
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ const AWTIS_POU_CHAK_PAJ = process.env.NEXT_PUBLIC_AWTIS_POU_CHAK_PAJ || 6
|
|||||||
|
|
||||||
export default function Awtis({pajTotal, awtisPouChakPaj, paj}) {
|
export default function Awtis({pajTotal, awtisPouChakPaj, paj}) {
|
||||||
return (
|
return (
|
||||||
<HeadLayout title='Awtis' tab={1}>
|
<HeadLayout title='Awtis' tab={1} slug='awtis'>
|
||||||
<Pajinasyon pajTotal={pajTotal} paj={paj} />
|
<Pajinasyon pajTotal={pajTotal} paj={paj} />
|
||||||
<Container>
|
<Container>
|
||||||
<Grid container spacing={4}>
|
<Grid container spacing={4}>
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import {jwennTeksEpiSlug, jwennTeks} from '../../lib/oki-api'
|
|||||||
import TeksDrawer from '../../components/teks/teks-drawer'
|
import TeksDrawer from '../../components/teks/teks-drawer'
|
||||||
import HeadLayout from '../../components/head-layout'
|
import HeadLayout from '../../components/head-layout'
|
||||||
|
|
||||||
export default function SlugTeks({teks, anTeks}) {
|
export default function SlugTeks({teks, anTeks, slug}) {
|
||||||
return (
|
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} />
|
<TeksDrawer teks={teks} anTeks={anTeks} />
|
||||||
</HeadLayout>
|
</HeadLayout>
|
||||||
)
|
)
|
||||||
@@ -25,12 +25,14 @@ export async function getServerSideProps({query}) {
|
|||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
teks,
|
teks,
|
||||||
anTeks
|
anTeks,
|
||||||
|
slug
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SlugTeks.propTypes = {
|
SlugTeks.propTypes = {
|
||||||
teks: PropTypes.array.isRequired,
|
teks: PropTypes.array.isRequired,
|
||||||
anTeks: PropTypes.object.isRequired
|
anTeks: PropTypes.object.isRequired,
|
||||||
|
slug: PropTypes.string.isRequired
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ import HeadLayout from '../../components/head-layout'
|
|||||||
|
|
||||||
export default function Teks({teks}) {
|
export default function Teks({teks}) {
|
||||||
return (
|
return (
|
||||||
<HeadLayout title='Tèks' tab={2}>
|
<HeadLayout title='Tèks' tab={2} slug='teks'>
|
||||||
<TeksDrawer teks={teks} />
|
<TeksDrawer teks={teks} />
|
||||||
</HeadLayout>
|
</HeadLayout>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user