Files
pawol.nu/components/kat-kay-la.js
T

61 lines
1.5 KiB
JavaScript
Raw Normal View History

2020-12-17 22:34:55 +01:00
import React from 'react'
import PropTypes from 'prop-types'
import {useRouter} from 'next/router'
import {
Card,
CardContent,
CardActionArea,
Typography,
Grid
} from '@material-ui/core'
import {makeStyles} from '@material-ui/core/styles'
const useStyles = makeStyles({
root: {
minWidth: 275
},
bullet: {
display: 'inline-block',
margin: '0 2px',
transform: 'scale(0.8)'
},
title: {
fontSize: 14
},
pos: {
marginBottom: 12
}
})
2021-08-21 21:37:09 +02:00
export default function KatKayLa({tit, soutit, kantite, route}) {
2020-12-17 22:34:55 +01:00
const classes = useStyles()
const router = useRouter()
return (
2020-12-19 02:02:29 +01:00
<Grid item xs={12} md={6}>
2020-12-17 22:34:55 +01:00
<Card className={classes.root} variant='outlined'>
2020-12-17 23:19:21 +01:00
<CardActionArea onClick={() => router.push(route).then(() => window.scrollTo(0, 0))}>
2020-12-17 22:34:55 +01:00
<CardContent>
2021-08-21 21:37:09 +02:00
<Typography style={{display: 'flex', justifyContent: 'center', alignItems: 'center'}} align='center' variant='h3' component='h1'>
2020-12-17 22:34:55 +01:00
{tit}
2021-08-21 21:37:09 +02:00
<Typography style={{marginLeft: 5}} variant='overline'>
({soutit})
</Typography>
2020-12-17 22:34:55 +01:00
</Typography>
<Typography gutterBottom style={{fontWeight: 'bold'}} align='center' variant='h4' component='h2'>
2020-12-18 22:01:47 +01:00
{kantite}
2020-12-17 22:34:55 +01:00
</Typography>
</CardContent>
</CardActionArea>
</Card>
</Grid>
)
}
KatKayLa.propTypes = {
tit: PropTypes.string.isRequired,
2021-08-21 21:37:09 +02:00
soutit: PropTypes.string.isRequired,
2020-12-18 22:01:47 +01:00
kantite: PropTypes.number.isRequired,
2020-12-17 22:34:55 +01:00
route: PropTypes.string.isRequired
}