diff --git a/app/components/booking/generate-booking-pdf.tsx b/app/components/booking/generate-booking-pdf.tsx index c468b681c..f75adf48f 100644 --- a/app/components/booking/generate-booking-pdf.tsx +++ b/app/components/booking/generate-booking-pdf.tsx @@ -1,17 +1,8 @@ import { useRef, useState } from "react"; import type { Asset, Booking } from "@prisma/client"; import { Button } from "~/components/shared/button"; -import { - AlertDialog, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, -} from "~/components/shared/modal"; import { tw } from "~/utils/tw"; +import { Dialog, DialogPortal } from "../layout/dialog"; import { Spinner } from "../shared/spinner"; export const GenerateBookingPdf = ({ @@ -60,69 +51,83 @@ export const GenerateBookingPdf = ({ } }; + const [isDialogOpen, setIsDialogOpen] = useState(false); + + const handleOpenDialog = () => { + setIsDialogOpen(true); + }; + + const handleCloseDialog = () => { + setIsDialogOpen(false); + }; + return ( <> - - - - Generate overview PDF - - - - - - Generate booking checklist for "{booking?.name}" - - - You can either preview or download the PDF. - - - - {/** Show spinner if no iframe */} - {!iframeLoaded && ( - - - Generating PDF... - - )} - {totalAssets && ( - - - - )} + + Generate overview PDF + + + + Generate booking checklist for "{booking?.name}" + You can either preview or download the PDF. + + } + > + + + {/** Show spinner if no iframe */} + {!iframeLoaded && ( + + + Generating PDF... + + )} + {totalAssets && ( + + + + )} + + + + Cancel + + + Download + + - - - Cancel - - - Download - - - - + + {/* Only for mobile */} ) : null; + +export const DialogPortal = ({ children }: { children: React.ReactNode }) => + ReactDOM.createPortal(children, document.body); diff --git a/app/modules/booking/pdf-helpers.ts b/app/modules/booking/pdf-helpers.ts index d6b50bebe..277422e5e 100644 --- a/app/modules/booking/pdf-helpers.ts +++ b/app/modules/booking/pdf-helpers.ts @@ -138,8 +138,6 @@ export const getBookingAssetsCustomHeader = ({ display: flex; justify-content: space-between; align-items: center; - padding-bottom:20px; - border-bottom: 2px solid #bfbfbf; } .header-main img { height: 40px; @@ -161,7 +159,7 @@ export const getBookingAssetsCustomHeader = ({ gap:2px; } .header-main .header-content { - color: rgba(0, 0, 0, 0.6); + color: rgba(0, 0, 0, 0.6); } @@ -169,7 +167,7 @@ export const getBookingAssetsCustomHeader = ({ ${ - booking?.name || "" + booking.name } | ${new Date().toLocaleDateString()} | Page / diff --git a/app/routes/_layout+/bookings.$bookingId.generate-pdf.$fileName[.pdf].tsx b/app/routes/_layout+/bookings.$bookingId.generate-pdf.$fileName[.pdf].tsx index 756dfb5ca..b53a00ac7 100644 --- a/app/routes/_layout+/bookings.$bookingId.generate-pdf.$fileName[.pdf].tsx +++ b/app/routes/_layout+/bookings.$bookingId.generate-pdf.$fileName[.pdf].tsx @@ -102,7 +102,7 @@ const styles = { borderBottom: "1px solid #bfbfbf", }, infoLabel: { - fontWeight: "medium", + fontWeight: "500", minWidth: "150px", fontSize: "14px", }, @@ -120,8 +120,8 @@ const styles = { borderBottom: "1px solid #bfbfbf", padding: "10px", textAlign: "left", - fontSize: "14px", - fontWeight: "normal", + fontSize: "10px", + fontWeight: "500", }, tableRow: { verticalAlign: "top", @@ -145,12 +145,6 @@ const styles = { height: "55px", objectFit: "cover", }, - assetImg: { - borderWidth: "1px", - borderRadius: "4px", - padding: "1px", - border: "1px solid #bfbfbf", - }, checkbox: { display: "block", height: "20px", @@ -221,7 +215,7 @@ const BookingPDFPreview = ({ pdfMeta }: { pdfMeta: PdfDbResult }) => { `${SERVER_URL}/static/images/asset-placeholder.jpg` } alt="Asset" - style={{ ...styles.img, ...styles.assetImg }} + style={{ ...styles.img }} />
Generating PDF...
You can either preview or download the PDF.