Added QRCode for PDF

This commit is contained in:
Joao Ramos
2024-01-04 19:49:15 +00:00
parent a4f79d236d
commit 432f4a735f
4 changed files with 221 additions and 54 deletions

View File

@@ -54,6 +54,10 @@ const styles = StyleSheet.create({
flexDirection: "row",
justifyContent: "space-between",
},
alignRightRow: {
display: "flex",
flexDirection: "row-reverse",
}
});
interface Props {
@@ -65,6 +69,7 @@ interface Props {
testDetails: ModuleScore[];
summary: string;
logo: string;
qrcode: string;
}
const PDFReport = ({
@@ -76,6 +81,7 @@ const PDFReport = ({
testDetails,
summary,
logo,
qrcode,
}: Props) => {
const defaultTextStyle = [styles.textFont, { fontSize: 8 }];
const defaultSkillsTextStyle = [styles.textFont, { fontSize: 8 }];
@@ -89,10 +95,7 @@ const PDFReport = ({
<Document>
<Page style={styles.body}>
<View
style={{
display: "flex",
flexDirection: "row-reverse",
}}
style={styles.alignRightRow}
>
<Image
src={logo}
@@ -209,6 +212,12 @@ const PDFReport = ({
</View>
))}
</View>
<View style={styles.alignRightRow}>
<Image src={qrcode} style={{
width: '80px',
height: '80px',
}}/>
</View>
</View>
<View style={[{ paddingTop: 30 }, styles.separator]}>
<View>