diff --git a/src/exams/pdf/details/level.exam.tsx b/src/exams/pdf/details/level.exam.tsx index 57ccac20..9230a7c0 100644 --- a/src/exams/pdf/details/level.exam.tsx +++ b/src/exams/pdf/details/level.exam.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { View, Text } from "@react-pdf/renderer"; +import { View, Text, StyleSheet } from "@react-pdf/renderer"; import { ModuleScore } from "@/interfaces/module.scores"; import { styles } from "../styles"; import { RadialResult } from "./radial.result"; @@ -40,6 +40,29 @@ const thresholds = [ }, ]; +const customStyles = StyleSheet.create({ + container: { + display: "flex", + flexDirection: "row", + gap: 30, + justifyContent: "space-between", + }, + tableContainer: { + display: "flex", + flex: 1, + flexDirection: "column", + }, + tableLabel: { + display: "flex", + alignItems: "center", + }, + tableBody: { display: "flex", flex: 1, flexDirection: "row" }, + tableRow: { + display: "flex", + flexDirection: "column", + }, +}); + export const LevelExamDetails = ({ detail }: Props) => { const updatedThresholds = thresholds.map((t) => ({ ...t, @@ -56,47 +79,27 @@ export const LevelExamDetails = ({ detail }: Props) => { return base ? "white" : "#553b25"; }; return ( - + - - + + Level as per CEFR Levels - + {updatedThresholds.map( ({ level, label, minValue, maxValue, match }, index, arr) => ( ( - + {module} - - + + {score} out of {total} diff --git a/src/exams/pdf/details/skill.exam.tsx b/src/exams/pdf/details/skill.exam.tsx index a23e7c69..92f9ab69 100644 --- a/src/exams/pdf/details/skill.exam.tsx +++ b/src/exams/pdf/details/skill.exam.tsx @@ -1,12 +1,5 @@ import React from "react"; -import { - Document, - Page, - View, - Text, - StyleSheet, - Image, -} from "@react-pdf/renderer"; +import { View, StyleSheet } from "@react-pdf/renderer"; import { ModuleScore } from "@/interfaces/module.scores"; import { styles } from "../styles"; import { RadialResult } from "./radial.result"; @@ -14,11 +7,14 @@ interface Props { testDetails: ModuleScore[]; } +const customStyles = StyleSheet.create({ + container: { display: "flex", flexDirection: "row", gap: 30 }, +}); + export const SkillExamDetails = ({ testDetails }: Props) => ( - + {testDetails.map((detail) => { const { module } = detail; - return ; })} diff --git a/src/exams/pdf/index.tsx b/src/exams/pdf/index.tsx index 08223f47..0ec12e7e 100644 --- a/src/exams/pdf/index.tsx +++ b/src/exams/pdf/index.tsx @@ -4,11 +4,23 @@ import { Document, Page, View, Text, Image } from "@react-pdf/renderer"; import ProgressBar from "./progress.bar"; // import RadialProgress from "./radial.progress"; // import RadialProgressSvg from "./radial.progress.svg"; -import { Module } from "@/interfaces"; import { ModuleScore } from "@/interfaces/module.scores"; // import logo from './logo_title.png'; import { styles } from "./styles"; +import { StyleSheet } from "@react-pdf/renderer"; + +const customStyles = StyleSheet.create({ + testDetails: { + display: "flex", + gap: 4, + }, + qrcode: { + width: "80px", + height: "80px", + }, +}); + interface Props { date: string; name: string; @@ -46,7 +58,7 @@ const PDFReport = ({ - + Email: {email} Gender: {gender} - + feedback) .map(({ module, feedback }) => ( - + {module} @@ -138,15 +147,12 @@ const PDFReport = ({ - {false && ( + {false && (