Edit Index page, add RezoDialog and DenyeTeks components

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-05-08 23:49:37 +04:00
parent 6eea215541
commit 2af9027f8d
+28 -11
View File
@@ -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 Footer from '../components/footer'
import {rezoNou} from '../lib/rezo-lis'
import KatRezoNou from '../components/kat-rezo-nou'
import RezoDialog from '../components/rezo/rezo-dialog'
import DenyeTeks from '../components/teks/denye-teks'
import {jwennDenyeTeks} from '../lib/oki-api'
export default function Home() {
export default function Home({teks}) {
return (
<HeadLayout tab={0}>
<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'>
<Typography sx={{fontWeight: 'bold'}} variant='h6' component='h1'>
#OKi
@@ -22,16 +24,31 @@ export default function Home() {
</Typography>
</Container>
<Container align='center'>
<Typography gutterBottom variant='body' component='h4'>
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>
<RezoDialog />
</Container>
</Box>
<Container align='center'>
<Typography sx={{fontWeight: 'bold'}} variant='h6' component='h2'>
Derniers textes publiés
</Typography>
</Container>
<DenyeTeks {...teks} />
<Footer />
</Box>
</HeadLayout>
)
}
export async function getServerSideProps() {
const denyeTeks = await jwennDenyeTeks()
return {
props: {
teks: denyeTeks
}
}
}
Home.propTypes = {
teks: PropTypes.array.isRequired
}