Replace 'kombyen' by 'kantite'

This commit is contained in:
2020-12-18 22:01:47 +01:00
parent 90d4e9580b
commit 4e3f469896
2 changed files with 15 additions and 15 deletions
+3 -3
View File
@@ -27,7 +27,7 @@ const useStyles = makeStyles({
}
})
export default function KatKayLa({tit, kombyen, route}) {
export default function KatKayLa({tit, kantite, route}) {
const classes = useStyles()
const router = useRouter()
@@ -40,7 +40,7 @@ export default function KatKayLa({tit, kombyen, route}) {
{tit}
</Typography>
<Typography gutterBottom style={{fontWeight: 'bold'}} align='center' variant='h4' component='h2'>
{kombyen}
{kantite}
</Typography>
</CardContent>
</CardActionArea>
@@ -51,6 +51,6 @@ export default function KatKayLa({tit, kombyen, route}) {
KatKayLa.propTypes = {
tit: PropTypes.string.isRequired,
kombyen: PropTypes.number.isRequired,
kantite: PropTypes.number.isRequired,
route: PropTypes.string.isRequired
}
+12 -12
View File
@@ -9,15 +9,15 @@ import KatKayLa from '../components/kat-kay-la'
import HeadLayout from '../components/head-layout'
import Carousel from '../components/carousel'
export default function Home({konbyenAwtis, konbyenTeks}) {
export default function Home({kantiteAwtis, kantiteTeks}) {
const [handleOpen, setHandleOpen] = useState(false)
const handleClick = () => {
setHandleOpen(true)
}
const kombyen = [
{id: 1, tit: 'Konbyen Awtis', kombyen: konbyenAwtis, route: '/awtis?paj&paj=1'},
{id: 2, tit: 'Konbyen Tèks', kombyen: konbyenTeks, route: '/teks'}
const kantite = [
{id: 1, tit: 'Kantité Awtis', kantite: kantiteAwtis, route: '/awtis?paj&paj=1'},
{id: 2, tit: 'Kantité Tèks', kantite: kantiteTeks, route: '/teks'}
]
const matches = useMediaQuery('(max-width:600px)')
@@ -31,7 +31,7 @@ export default function Home({konbyenAwtis, konbyenTeks}) {
height={215}
src='/logo.png'
/>
<Typography variant='h3'>
<Typography variant='h3' component='h1'>
Organisation KA Internationale
</Typography>
<Typography variant='h4' component='h2' color='textSecondary'>
@@ -45,7 +45,7 @@ export default function Home({konbyenAwtis, konbyenTeks}) {
</Container>
<Container style={{marginTop: '5em'}}>
<Grid container spacing={3}>
{kombyen.map(k => <KatKayLa key={k.id} tit={k.tit} kombyen={k.kombyen} route={k.route} />)}
{kantite.map(k => <KatKayLa key={k.id} tit={k.tit} kantite={k.kantite} route={k.route} />)}
</Grid>
</Container>
<Container style={{marginTop: '5em', marginBottom: '5em'}} align='center'>
@@ -71,20 +71,20 @@ export default function Home({konbyenAwtis, konbyenTeks}) {
}
Home.propTypes = {
konbyenAwtis: PropTypes.number.isRequired,
konbyenTeks: PropTypes.number.isRequired
kantiteAwtis: PropTypes.number.isRequired,
kantiteTeks: PropTypes.number.isRequired
}
export async function getServerSideProps() {
const awtisResponse = await axios.get(`${process.env.API_URL}/awtis/count`)
const teksResponse = await axios.get(`${process.env.API_URL}/teks/count`)
const konbyenAwtis = awtisResponse.data
const konbyenTeks = teksResponse.data
const kantiteAwtis = awtisResponse.data
const kantiteTeks = teksResponse.data
return {
props: {
konbyenAwtis,
konbyenTeks
kantiteAwtis,
kantiteTeks
}
}
}