From 01e74a79de034c4100c50d334f9b61036557f9ad Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Thu, 11 Jan 2024 08:31:16 +0800 Subject: [PATCH] Add potential fix to transactionpdf page build error --- .../TransactionPDF/TransactionPDF.tsx | 94 +++++++++++++------ 1 file changed, 64 insertions(+), 30 deletions(-) diff --git a/src/Components/TransactionPDF/TransactionPDF.tsx b/src/Components/TransactionPDF/TransactionPDF.tsx index 7605d40..fae3c08 100644 --- a/src/Components/TransactionPDF/TransactionPDF.tsx +++ b/src/Components/TransactionPDF/TransactionPDF.tsx @@ -8,10 +8,30 @@ import { import ustplogo from "../../assets/ustp-logo.png"; type props = { - transaction: TransactionType; + transaction: TransactionType | null; }; export default function TransactionPDF(props: props) { + if (!props.transaction) { + return ( + + + + + Invalid transaction PDF specified + + + + + ); + } return ( @@ -52,7 +72,6 @@ export default function TransactionPDF(props: props) { /> - - + - BORROWER'S SLIP + + {" "} + BORROWER'S SLIP{" "} + @@ -186,7 +208,10 @@ export default function TransactionPDF(props: props) { style={{ textDecoration: "underline" }} >{`${props.transaction.borrower.course}`}{" "} {"\n"} - Section: {props.transaction.section} + Section:{" "} + + {props.transaction.section} + @@ -230,7 +255,7 @@ export default function TransactionPDF(props: props) { display: "flex", gap: 5, alignSelf: "stretch", - marginTop: "10" + marginTop: "10", }} > {/* Consumables Area */} - + {/* Members here */} - + {/* Remarks */} - - - - Remarks - - - + + - {props.transaction.remarks} + Remarks + + + {props.transaction.remarks} + +