removed hook reference to fix build
This commit is contained in:
@@ -11,7 +11,19 @@ import ReactPDF, {
|
|||||||
import { createElement } from "react";
|
import { createElement } from "react";
|
||||||
import Html from "react-pdf-html";
|
import Html from "react-pdf-html";
|
||||||
import { getFormCollectionByID } from "../../components/utils";
|
import { getFormCollectionByID } from "../../components/utils";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
|
||||||
|
import transLookupCY from "../../locales/cy/myrepresentations.json";
|
||||||
|
import transLookupEN from "../../locales/en/myrepresentations.json";
|
||||||
|
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||||
|
|
||||||
|
const getTrans = (locale, key) => {
|
||||||
|
let jsonQuery = `$.${key}`;
|
||||||
|
|
||||||
|
let jsonObj = locale == "cy" ? transLookupCY : transLookupEN;
|
||||||
|
|
||||||
|
console.log(locale, jsonObj[key]);
|
||||||
|
return jsonObj[key];
|
||||||
|
};
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
page: {
|
page: {
|
||||||
@@ -89,7 +101,6 @@ const styles = StyleSheet.create({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const other_pdf = ({ docProps }) => {
|
export const other_pdf = ({ docProps }) => {
|
||||||
let { t } = useTranslation();
|
|
||||||
//console.log("----", docProps);
|
//console.log("----", docProps);
|
||||||
function formatDates(dateObj) {
|
function formatDates(dateObj) {
|
||||||
var dateObj = new Date(dateObj);
|
var dateObj = new Date(dateObj);
|
||||||
@@ -164,10 +175,10 @@ export const other_pdf = ({ docProps }) => {
|
|||||||
>
|
>
|
||||||
<Text style={styles.questionBullet}>1.</Text>
|
<Text style={styles.questionBullet}>1.</Text>
|
||||||
<Text style={styles.questionText}>
|
<Text style={styles.questionText}>
|
||||||
{t(
|
{getTrans(
|
||||||
"myrepresentations:s78-section-question-1"
|
docProps.locale,
|
||||||
|
"s78-section-question-1"
|
||||||
)}
|
)}
|
||||||
:
|
|
||||||
</Text>
|
</Text>
|
||||||
<Text style={styles.questionAnswer}>
|
<Text style={styles.questionAnswer}>
|
||||||
{values.caseRef}
|
{values.caseRef}
|
||||||
|
|||||||
Reference in New Issue
Block a user