Improve KatRezoNou component
This commit is contained in:
@@ -1,15 +1,33 @@
|
|||||||
|
import {useState} from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import Box from '@mui/material/Box'
|
|
||||||
import Card from '@mui/material/Card'
|
import Card from '@mui/material/Card'
|
||||||
import CardContent from '@mui/material/CardContent'
|
import CardContent from '@mui/material/CardContent'
|
||||||
import {CardActionArea} from '@mui/material'
|
import {Button, CardActionArea, CardActions, CardMedia, Divider, Grid} from '@mui/material'
|
||||||
import Typography from '@mui/material/Typography'
|
import Typography from '@mui/material/Typography'
|
||||||
|
import RezoImaj from './rezo-imaj'
|
||||||
|
|
||||||
|
export default function KatRezoNou({tit, img, soutit, ko, lyen}) {
|
||||||
|
const [open, setOpen] = useState(false)
|
||||||
|
|
||||||
|
const handleClickOpen = () => {
|
||||||
|
setOpen(true)
|
||||||
|
}
|
||||||
|
|
||||||
export default function KatRezoNou({tit, soutit, ko, lyen}) {
|
|
||||||
return (
|
return (
|
||||||
<Box sx={{minWidth: 275, marginBottom: 3}}>
|
<>
|
||||||
|
<Grid item xs={12} md={6} sx={{marginBottom: 3}}>
|
||||||
<Card raised>
|
<Card raised>
|
||||||
<CardActionArea onClick={() => window.open(lyen, '_blank')}>
|
<CardActionArea onClick={handleClickOpen}>
|
||||||
|
<CardMedia
|
||||||
|
sx={{objectFit: 'contain'}}
|
||||||
|
component='img'
|
||||||
|
height='150'
|
||||||
|
image={`/captures/${img}.png`}
|
||||||
|
alt={`Aperçu ${tit}`}
|
||||||
|
title='Cliquez pour agrandir'
|
||||||
|
/>
|
||||||
|
</CardActionArea>
|
||||||
|
<Divider />
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<Typography color='primary' variant='button' sx={{fontSize: 25}}>
|
<Typography color='primary' variant='button' sx={{fontSize: 25}}>
|
||||||
{tit}
|
{tit}
|
||||||
@@ -21,14 +39,21 @@ export default function KatRezoNou({tit, soutit, ko, lyen}) {
|
|||||||
{ko}
|
{ko}
|
||||||
</Typography>
|
</Typography>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</CardActionArea>
|
<CardActions sx={{textAlign: 'center'}}>
|
||||||
|
<Button variant='outlined' size='small' color='primary' onClick={() => window.open(lyen, '_blank')}>
|
||||||
|
Accéder à {tit}
|
||||||
|
</Button>
|
||||||
|
</CardActions>
|
||||||
</Card>
|
</Card>
|
||||||
</Box>
|
</Grid>
|
||||||
|
<RezoImaj img={img} open={open} setOpen={setOpen} />
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
KatRezoNou.propTypes = {
|
KatRezoNou.propTypes = {
|
||||||
tit: PropTypes.string.isRequired,
|
tit: PropTypes.string.isRequired,
|
||||||
|
img: PropTypes.string.isRequired,
|
||||||
soutit: PropTypes.string.isRequired,
|
soutit: PropTypes.string.isRequired,
|
||||||
ko: PropTypes.string.isRequired,
|
ko: PropTypes.string.isRequired,
|
||||||
lyen: PropTypes.string.isRequired
|
lyen: PropTypes.string.isRequired
|
||||||
|
|||||||
Reference in New Issue
Block a user