rep defect 41 update final comments in line
This commit is contained in:
@@ -1,20 +1,17 @@
|
|||||||
import ReactPDF, {
|
import {
|
||||||
Document,
|
Document,
|
||||||
|
Image,
|
||||||
Page,
|
Page,
|
||||||
|
StyleSheet,
|
||||||
Text,
|
Text,
|
||||||
View,
|
View,
|
||||||
Image,
|
|
||||||
StyleSheet,
|
|
||||||
PDFViewer,
|
|
||||||
Font,
|
Font,
|
||||||
} from "@react-pdf/renderer";
|
} from "@react-pdf/renderer";
|
||||||
import { createElement } from "react";
|
|
||||||
import Html from "react-pdf-html";
|
import Html from "react-pdf-html";
|
||||||
import { getFormCollectionByID, bytesToSize } from "../../components/utils";
|
import { getFormCollectionByID, bytesToSize } from "../../components/utils";
|
||||||
|
|
||||||
import transLookupCY from "../../locales/cy/myrepresentations.json";
|
import transLookupCY from "../../locales/cy/myrepresentations.json";
|
||||||
import transLookupEN from "../../locales/en/myrepresentations.json";
|
import transLookupEN from "../../locales/en/myrepresentations.json";
|
||||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
|
||||||
|
|
||||||
const getTrans = (locale, key) => {
|
const getTrans = (locale, key) => {
|
||||||
let jsonQuery = `$.${key}`;
|
let jsonQuery = `$.${key}`;
|
||||||
@@ -56,6 +53,28 @@ const styles = StyleSheet.create({
|
|||||||
paddingLeft: 10,
|
paddingLeft: 10,
|
||||||
backgroundColor: "white",
|
backgroundColor: "white",
|
||||||
},
|
},
|
||||||
|
questionAnswerSmall: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "300",
|
||||||
|
fontSize: 12,
|
||||||
|
padding: 5,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
paddingLeft: 10,
|
||||||
|
paddingRight: 10,
|
||||||
|
backgroundColor: "white",
|
||||||
|
marginRight: 10,
|
||||||
|
},
|
||||||
|
questionAnswerSmaller: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "90",
|
||||||
|
fontSize: 12,
|
||||||
|
padding: 5,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
paddingLeft: 10,
|
||||||
|
backgroundColor: "white",
|
||||||
|
},
|
||||||
questionAnswerMid: {
|
questionAnswerMid: {
|
||||||
color: "#757575",
|
color: "#757575",
|
||||||
width: "20%",
|
width: "20%",
|
||||||
@@ -242,7 +261,7 @@ export const finalComments_pdf = ({ docProps }) => {
|
|||||||
<Html style={styles.richArea}>
|
<Html style={styles.richArea}>
|
||||||
{CleanHTML(
|
{CleanHTML(
|
||||||
values.conditional_representationCapacity_Comments
|
values.conditional_representationCapacity_Comments
|
||||||
)}
|
) || "N/A"}
|
||||||
</Html>
|
</Html>
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -443,7 +462,7 @@ export const finalComments_pdf = ({ docProps }) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text
|
<Text
|
||||||
style={{ width: "40%", fontSize: 12 }}
|
style={{ width: "15%", fontSize: 12 }}
|
||||||
>
|
>
|
||||||
{getTrans(
|
{getTrans(
|
||||||
docProps.locale,
|
docProps.locale,
|
||||||
@@ -451,7 +470,18 @@ export const finalComments_pdf = ({ docProps }) => {
|
|||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</Text>
|
</Text>
|
||||||
<Text style={styles.questionAnswer}>
|
<Text
|
||||||
|
style={{
|
||||||
|
color: "#757575",
|
||||||
|
width: "310",
|
||||||
|
fontSize: 12,
|
||||||
|
padding: 5,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
backgroundColor: "white",
|
||||||
|
paddingRight: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
{values.firstname} {values.lastname}
|
{values.firstname} {values.lastname}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -462,14 +492,20 @@ export const finalComments_pdf = ({ docProps }) => {
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text style={styles.questionText}>
|
<Text
|
||||||
|
style={{
|
||||||
|
width: "40",
|
||||||
|
fontSize: 12,
|
||||||
|
marginLeft: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
{getTrans(
|
{getTrans(
|
||||||
docProps.locale,
|
docProps.locale,
|
||||||
"statement-date-label"
|
"statement-date-label"
|
||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</Text>
|
</Text>
|
||||||
<Text style={styles.questionAnswer}>
|
<Text style={styles.questionAnswerSmaller}>
|
||||||
{signedDate}
|
{signedDate}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -482,6 +518,7 @@ export const finalComments_pdf = ({ docProps }) => {
|
|||||||
style={{
|
style={{
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
marginBottom: 10,
|
marginBottom: 10,
|
||||||
|
alignItems: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text
|
<Text
|
||||||
@@ -501,6 +538,28 @@ export const finalComments_pdf = ({ docProps }) => {
|
|||||||
: ""}
|
: ""}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
) : values.hasOwnProperty("onBehalfOfLPA") ? (
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={{ width: "18%", fontSize: 12 }}
|
||||||
|
>
|
||||||
|
{getTrans(
|
||||||
|
docProps.locale,
|
||||||
|
"statement-onbehalf-label"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswerWide}>
|
||||||
|
{values.onBehalfOfLPA}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
) : (
|
) : (
|
||||||
<View />
|
<View />
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user