From 5d14e44a09017b2ebc3160b9de0dd93bb832d051 Mon Sep 17 00:00:00 2001 From: Valimp Date: Mon, 28 Oct 2024 15:12:58 +0100 Subject: [PATCH] feat: open a modal on thumbnail clic --- src/components/ImageTicket.tsx | 58 ++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/src/components/ImageTicket.tsx b/src/components/ImageTicket.tsx index 6bc19ff..8b7914b 100644 --- a/src/components/ImageTicket.tsx +++ b/src/components/ImageTicket.tsx @@ -1,3 +1,4 @@ +import { useState } from 'react'; import TableCell from '@mui/material/TableCell'; import TableRow from '@mui/material/TableRow'; import Date from './Date' @@ -5,9 +6,30 @@ import TicketsButtons from './TicketsButtons' import Box from '@mui/material/Box'; import { useMediaQuery } from '@mui/material'; import InfoModal from './InfoModal'; +import Modal from '@mui/material/Modal'; +import Button from '@mui/material/Button'; export default function ImageTicket({ticket, setTickets, tickets}: {ticket: any, setTickets: any, tickets: any}) { + const style = { + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + position: 'absolute', + top: '50%', + left: '50%', + transform: 'translate(-50%, -50%)', + width: '80%', + bgcolor: 'background.paper', + border: '2px solid #000', + boxShadow: 24, + p: 4, + }; + + const [open, setOpen] = useState(false); + const handleOpen = () => setOpen(true); + const handleClose = () => setOpen(false); + const isMobile = useMediaQuery('(max-width:700px)'); // format url to get mini image const imageUrl = ticket.url.replace(/\.jpg$/, '.400.jpg'); @@ -38,15 +60,33 @@ export default function ImageTicket({ticket, setTickets, tickets}: {ticket: any, }, }} > - - {ticket.barcode} - +
+ + + + {ticket.barcode} + + +