Change DenyeTeks commonent : add Skeleton feature
This commit is contained in:
+11
-21
@@ -1,4 +1,4 @@
|
||||
import PropTypes from 'prop-types'
|
||||
import {useState} from 'react'
|
||||
import {Container, Typography, Box, Divider, Chip} from '@mui/material'
|
||||
import ArrowCircleDownIcon from '@mui/icons-material/ArrowCircleDown'
|
||||
|
||||
@@ -6,9 +6,10 @@ import HeadLayout from '../components/head-layout'
|
||||
import Footer from '../components/footer'
|
||||
import RezoDialog from '../components/rezo/rezo-dialog'
|
||||
import DenyeTeks from '../components/teks/denye-teks'
|
||||
import {jwennDenyeTeks} from '../lib/oki-api'
|
||||
|
||||
export default function Home({teks}) {
|
||||
export default function Home() {
|
||||
const [error, setError] = useState(null)
|
||||
|
||||
return (
|
||||
<HeadLayout tab={0}>
|
||||
<Box sx={{display: 'flex', flexDirection: 'column', minHeight: '100vh'}}>
|
||||
@@ -28,11 +29,13 @@ export default function Home({teks}) {
|
||||
<RezoDialog />
|
||||
</Container>
|
||||
</Box>
|
||||
<Container>
|
||||
<Divider variant='middle' sx={{marginBottom: 1}}>
|
||||
<Chip sx={{fontWeight: 'bold'}} color='primary' icon={<ArrowCircleDownIcon />} label='Derniers textes publiés ' variant='outlined' />
|
||||
</Divider>
|
||||
<DenyeTeks {...teks} />
|
||||
<Container sx={{flexGrow: 300}}>
|
||||
{!error && (
|
||||
<Divider variant='middle' sx={{marginBottom: 1}}>
|
||||
<Chip sx={{fontWeight: 'bold'}} color='primary' icon={<ArrowCircleDownIcon />} label='Derniers textes publiés ' variant='outlined' />
|
||||
</Divider>
|
||||
)}
|
||||
<DenyeTeks error={error} setError={setError} />
|
||||
</Container>
|
||||
<Footer />
|
||||
</Box>
|
||||
@@ -40,16 +43,3 @@ export default function Home({teks}) {
|
||||
)
|
||||
}
|
||||
|
||||
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