Edit Index page, add RezoDialog and DenyeTeks components
This commit is contained in:
+28
-11
@@ -1,15 +1,17 @@
|
|||||||
import {Container, Typography, Box, Grid} from '@mui/material'
|
import PropTypes from 'prop-types'
|
||||||
|
import {Container, Typography, Box} from '@mui/material'
|
||||||
|
|
||||||
import HeadLayout from '../components/head-layout'
|
import HeadLayout from '../components/head-layout'
|
||||||
import Footer from '../components/footer'
|
import Footer from '../components/footer'
|
||||||
import {rezoNou} from '../lib/rezo-lis'
|
import RezoDialog from '../components/rezo/rezo-dialog'
|
||||||
import KatRezoNou from '../components/kat-rezo-nou'
|
import DenyeTeks from '../components/teks/denye-teks'
|
||||||
|
import {jwennDenyeTeks} from '../lib/oki-api'
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home({teks}) {
|
||||||
return (
|
return (
|
||||||
<HeadLayout tab={0}>
|
<HeadLayout tab={0}>
|
||||||
<Box sx={{display: 'flex', flexDirection: 'column', minHeight: '100vh'}}>
|
<Box sx={{display: 'flex', flexDirection: 'column', minHeight: '100vh'}}>
|
||||||
<Box sx={{flexGrow: 1, marginTop: 1}}>
|
<Box sx={{flexGrow: 1, marginBottom: 3}}>
|
||||||
<Container sx={{marginBottom: 3}} align='center'>
|
<Container sx={{marginBottom: 3}} align='center'>
|
||||||
<Typography sx={{fontWeight: 'bold'}} variant='h6' component='h1'>
|
<Typography sx={{fontWeight: 'bold'}} variant='h6' component='h1'>
|
||||||
#OKi
|
#OKi
|
||||||
@@ -22,16 +24,31 @@ export default function Home() {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Container>
|
</Container>
|
||||||
<Container align='center'>
|
<Container align='center'>
|
||||||
<Typography gutterBottom variant='body' component='h4'>
|
<RezoDialog />
|
||||||
⬇️ Nos réseaux ! ⬇️
|
|
||||||
</Typography>
|
|
||||||
<Grid container rowSpacing={1} columnSpacing={{xs: 1, sm: 2, md: 3}}>
|
|
||||||
{rezoNou.map(({tit, img, soutit, ko, lyen}) => <KatRezoNou key={tit} tit={tit} img={img} soutit={soutit} ko={ko} lyen={lyen} />)}
|
|
||||||
</Grid>
|
|
||||||
</Container>
|
</Container>
|
||||||
</Box>
|
</Box>
|
||||||
|
<Container align='center'>
|
||||||
|
<Typography sx={{fontWeight: 'bold'}} variant='h6' component='h2'>
|
||||||
|
⬇️ Derniers textes publiés ⬇️
|
||||||
|
</Typography>
|
||||||
|
</Container>
|
||||||
|
<DenyeTeks {...teks} />
|
||||||
<Footer />
|
<Footer />
|
||||||
</Box>
|
</Box>
|
||||||
</HeadLayout>
|
</HeadLayout>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getServerSideProps() {
|
||||||
|
const denyeTeks = await jwennDenyeTeks()
|
||||||
|
|
||||||
|
return {
|
||||||
|
props: {
|
||||||
|
teks: denyeTeks
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Home.propTypes = {
|
||||||
|
teks: PropTypes.array.isRequired
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user