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

68 lines
1.7 KiB
JavaScript
Raw Normal View History

2020-12-17 22:34:55 +01:00
import PropTypes from 'prop-types'
import {useRouter} from 'next/router'
import {
Card,
CardContent,
CardActionArea,
Typography,
Grid
} from '@material-ui/core'
2022-01-19 06:35:04 +04:00
import {styled} from '@material-ui/core/styles'
2020-12-17 22:34:55 +01:00
2022-01-19 06:35:04 +04:00
const PREFIX = 'kat-kay-la'
const classes = {
root: `${PREFIX}-root`,
bullet: `${PREFIX}-bullet`,
title: `${PREFIX}-title`,
pos: `${PREFIX}-pos`
}
const StyledGrid = styled(Grid)({
[`& .${classes.root}`]: {
2020-12-17 22:34:55 +01:00
minWidth: 275
},
2022-01-19 06:35:04 +04:00
[`& .${classes.bullet}`]: {
2020-12-17 22:34:55 +01:00
display: 'inline-block',
margin: '0 2px',
transform: 'scale(0.8)'
},
2022-01-19 06:35:04 +04:00
[`& .${classes.title}`]: {
2020-12-17 22:34:55 +01:00
fontSize: 14
},
2022-01-19 06:35:04 +04:00
[`& .${classes.pos}`]: {
2020-12-17 22:34:55 +01:00
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 router = useRouter()
return (
2022-01-19 06:35:04 +04:00
<StyledGrid 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>
2022-01-19 06:35:04 +04:00
</StyledGrid>
2020-12-17 22:34:55 +01:00
)
}
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
}