mirror of
https://github.com/lemeow125/Borrowing-TrackerFrontend.git
synced 2024-11-17 06:19:27 +08:00
Add potential fix to transactionpdf page build error
This commit is contained in:
parent
06d019323c
commit
01e74a79de
1 changed files with 64 additions and 30 deletions
|
@ -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
|
||||
|
@ -271,7 +296,7 @@ export default function TransactionPDF(props: props) {
|
|||
</Text>
|
||||
</View>
|
||||
{/* Consumables Area */}
|
||||
<View style={{ marginTop: "5" , marginBottom: 10}}>
|
||||
<View style={{ marginTop: "5", marginBottom: 10 }}>
|
||||
<Text
|
||||
style={{
|
||||
color: colors.form_title,
|
||||
|
@ -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={{
|
||||
|
|
Loading…
Reference in a new issue