Improve KatKayLa component
This commit is contained in:
+10
-25
@@ -1,44 +1,29 @@
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import {useRouter} from 'next/router'
|
import {useRouter} from 'next/router'
|
||||||
import {
|
import Grid from '@mui/material/Grid'
|
||||||
Card,
|
import Card from '@mui/material/Card'
|
||||||
CardContent,
|
import CardActionArea from '@mui/material/CardActionArea'
|
||||||
CardActionArea,
|
import CardContent from '@mui/material/CardContent'
|
||||||
Typography,
|
import Typography from '@mui/material/Typography'
|
||||||
Grid
|
|
||||||
} from '@mui/material'
|
|
||||||
import {styled} from '@mui/material/styles'
|
|
||||||
|
|
||||||
const PREFIX = 'kat-kay-la'
|
|
||||||
|
|
||||||
const classes = {
|
|
||||||
root: `${PREFIX}-root`,
|
|
||||||
}
|
|
||||||
|
|
||||||
const StyledGrid = styled(Grid)({
|
|
||||||
[`& .${classes.root}`]: {
|
|
||||||
minWidth: 275
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
export default function KatKayLa({tit, kantite, href, as}) {
|
export default function KatKayLa({tit, kantite, href, as}) {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledGrid item xs={12} md={6}>
|
<Grid item xs={12} md={6}>
|
||||||
<Card className={classes.root} variant='outlined'>
|
<Card variant='outlined'>
|
||||||
<CardActionArea onClick={() => router.push(href, as).then(() => window.scrollTo(0, 0))}>
|
<CardActionArea onClick={() => router.push(href, as).then(() => window.scrollTo(0, 0))}>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<Typography gutterBottom style={{fontWeight: 'bold'}} align='center' variant='h4' component='h1'>
|
<Typography style={{fontWeight: 'bold'}} align='center' variant='h5' component='h4'>
|
||||||
{kantite}
|
{kantite}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography align='center' variant='h5' component='h2'>
|
<Typography align='center' variant='h6' component='h5'>
|
||||||
{tit}
|
{tit}
|
||||||
</Typography>
|
</Typography>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</CardActionArea>
|
</CardActionArea>
|
||||||
</Card>
|
</Card>
|
||||||
</StyledGrid>
|
</Grid>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user