Add potential fix to transactionpdf page build error

This commit is contained in:
Keannu Bernasol 2024-01-11 08:31:16 +08:00
parent 06d019323c
commit 01e74a79de

View file

@ -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 (
<Document>
<Page size={{ width: 8.5 * 72, height: 10 * 90 }}>
<View>
<Text
style={{
color: colors.form_dark,
fontSize: 10,
textAlign: "center",
padding: "5 0 5 0",
}}
>
Invalid transaction PDF specified
</Text>
</View>
</Page>
</Document>
);
}
return (
<Document>
<Page size={{ width: 8.5 * 72, height: 10 * 90 }}>
@ -52,7 +72,6 @@ export default function TransactionPDF(props: props) {
/>
<View style={{ alignItems: "center" }}>
<Text
style={{
color: colors.form_dark,
@ -74,7 +93,10 @@ export default function TransactionPDF(props: props) {
padding: "5 0 5 0",
}}
>
<Text style={{ fontFamily: 'Helvetica-Bold' }}> BORROWER'S SLIP </Text>
<Text style={{ fontFamily: "Helvetica-Bold" }}>
{" "}
BORROWER'S SLIP{" "}
</Text>
</Text>
</View>
</View>
@ -186,7 +208,10 @@ export default function TransactionPDF(props: props) {
style={{ textDecoration: "underline" }}
>{`${props.transaction.borrower.course}`}</Text>{" "}
{"\n"}
Section: <Text style={{ textDecoration: "underline" }}>{props.transaction.section}</Text>
Section:{" "}
<Text style={{ textDecoration: "underline" }}>
{props.transaction.section}
</Text>
</Text>
</View>
</View>
@ -230,7 +255,7 @@ export default function TransactionPDF(props: props) {
display: "flex",
gap: 5,
alignSelf: "stretch",
marginTop: "10"
marginTop: "10",
}}
>
<Text
@ -295,10 +320,13 @@ export default function TransactionPDF(props: props) {
</View>
{/* Members here */}
<View style={{
<View
style={{
display: "flex",
gap: 5,
alignSelf: "stretch",}}>
alignSelf: "stretch",
}}
>
<Text
style={{
color: colors.form_title,
@ -318,7 +346,13 @@ export default function TransactionPDF(props: props) {
</Text>
{/* Remarks */}
</View>
<View style={{ display: "flex", flexDirection: "column", alignSelf: "stretch" }}>
<View
style={{
display: "flex",
flexDirection: "column",
alignSelf: "stretch",
}}
>
<View style={{ padding: "10 0" }}>
<Text
style={{