Skip to content

Commit

Permalink
corrected eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
danielc-n committed Sep 25, 2024
1 parent cc51526 commit 4279920
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 71 deletions.
27 changes: 13 additions & 14 deletions renderer/src/layouts/editor/InnerFramePopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ export default function InnerFramePopup() {
>
Choose an export folder
</Button>
<div>{folder ? `Folder selected : ${folder}` : "Please choose an export folder"}</div>
<div>{folder ? `Folder selected : ${folder}` : 'Please choose an export folder'}</div>
<Input
onChange={(e) => {
handleInputChange(e);
Expand Down Expand Up @@ -818,7 +818,7 @@ export default function InnerFramePopup() {
}
}
onClick={async () => {
if (jsonValidation.length == 0) {
if (jsonValidation.length === 0) {
setMessagePrint('');
const pdfGen = new global.PdfGenStatic(
JSON.parse(kitchenFaucet),
Expand All @@ -834,19 +834,18 @@ export default function InnerFramePopup() {
}
setMessagePrint((prev) => `${prev }\nSuccessful pdf generation.`);
} else {
let cleanerMessage = jsonValidation.map(
txt => {
console.log(txt);
console.log("txt.includes('outputPath')", txt.includes('outputPath'));
if(txt.includes('outputPath')) {
return "Please choose an export folder";
} else if(txt.includes('Unknown section type')) {
return "Please choose at least one 'Print type'";
} else if(txt.includes('requires ranges')) {
return "Canon specification : please choose at least one book";
const cleanerMessage = jsonValidation.map(
(txt) => {
let theText = txt;
if (txt.includes('outputPath')) {
theText = 'Please choose an export folder';
} else if (txt.includes('Unknown section type')) {
theText = 'Please choose at least one "Print type"';
} else if (txt.includes('requires ranges')) {
theText = 'Canon specification : please choose at least one book';
}
return txt;
}
return theText;
},
).join('\n');
setMessagePrint(`# Error\n${cleanerMessage}`);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
import React from 'react';

export const BookList = ({ books }) => {
return (
<div style={{ paddingBottom: '12px', borderRadius: 999, display: 'inline-flex', flexDirection: 'row', justifyContent: 'center', alignItems: 'center', gap: 8}}>
{books.map((book, index) => (
<div key={index} style={{ alignSelf: 'stretch', height: 30, padding: '4px 11px', backgroundColor: '#464646', borderRadius: 999, border: '1px solid #737373', display: 'flex', justifyContent: 'center', alignItems: 'center', gap: 8 }}>
<div style={{ display: 'inline-flex', alignItems: 'center', gap: 8 }}>
<div style={{ color: 'white', fontSize: 14, fontFamily: 'Lato', fontWeight: 400, lineHeight: '20px', wordWrap: 'break-word' }}>
{book}
</div>
export const BookList = ({ books }) => (
<div
style={{
paddingBottom: '12px', borderRadius: 999, display: 'inline-flex', flexDirection: 'row', justifyContent: 'center', alignItems: 'center', gap: 8,
}}
>
{books.map((book, index) => (
<div
// eslint-disable-next-line
key={index}
style={{
alignSelf: 'stretch', height: 30, padding: '4px 11px', backgroundColor: '#464646', borderRadius: 999, border: '1px solid #737373', display: 'flex', justifyContent: 'center', alignItems: 'center', gap: 8,
}}
>
<div
style={{
display: 'inline-flex', alignItems: 'center', gap: 8,
}}
>
<div
style={{
color: 'white', fontSize: 14, fontFamily: 'Lato', fontWeight: 400, lineHeight: '20px', wordWrap: 'break-word',
}}
>
{book}
</div>
</div>
))}
</div>
);
};
</div>
))}
</div>
);
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function BCVWrapperSortableList({
loopMode,
}) {
// Start get all book from current project
const initialBook = 'mat';
// const initialBook = 'mat';
const initialChapter = '1';
const initialVerse = '1';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect, useState, useContext } from 'react';
import { Modal } from '@material-ui/core';
import { ProjectContext } from '@/components/context/ProjectContext';
import { ReferenceContext } from '@/components/context/ReferenceContext';
import SelectBook from '@/components/EditorPage/Navigation/reference/SelectBook';
import { useBibleReference } from 'bible-reference-rcl';
import { XMarkIcon } from '@heroicons/react/24/outline';
Expand All @@ -16,7 +17,7 @@ export function JXLHeaderWrapper({
loopMode,
}) {
// Start get all book from current project
const initialBook = 'mat';
// const initialBook = 'mat';
const initialChapter = '1';
const initialVerse = '1';

Expand Down Expand Up @@ -105,7 +106,7 @@ export function JXLHeaderWrapper({
margin: 'auto',
display: 'flex',
justifyContent: 'center',
alignItems: 'center', // Added alignment to center vertically
alignItems: 'center',
fontSize: 24,
color: 'black',
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ const convertionWrapperType = (type) => {
};

const hashPrintTypes = {
'bcvBible': 'Bible by verse',
'bookNote': 'Book Note',
bcvBible: 'Bible by verse',
bookNote: 'Book Note',
'4ColumnSpread': 'Four resources on facing pages',
'2Column': 'Two resources in two columns',
'biblePlusNotes': 'Notes focus (by verse)',
'paraBible': 'Formatted Bible',
'markdown': 'Simple formatting',
// 'jxlSpread': 'Juxtalinear on facing pages',
'jxlSimple': 'Juxtalinear',
'obs': 'Obs',
'obsPlusNotes': 'Obs with Notes',
}
biblePlusNotes: 'Notes focus (by verse)',
paraBible: 'Formatted Bible',
markdown: 'Simple formatting',
// jxlSpread: 'Juxtalinear on facing pages',
jxlSimple: 'Juxtalinear',
obs: 'Obs',
obsPlusNotes: 'Obs with Notes',
};

export function AccordionPicker({
language,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,38 +228,40 @@ export function WrapperTemplate({
}}
>
<div style={{ display: 'flex' }}>
{advanceMode && (<Button
style={{
borderStyle: 'solid',
color: 'white',
}}
onClick={() => {
changePrintOrder((prev) => {
const t = [...prev];
t.splice(
t.indexOf(parseInt(keyWrapper, 10)),
1,
);
return t;
});
{advanceMode && (
<Button
style={{
borderStyle: 'solid',
color: 'white',
}}
onClick={() => {
changePrintOrder((prev) => {
const t = [...prev];
t.splice(
t.indexOf(parseInt(keyWrapper, 10)),
1,
);
return t;
});

changePrintData((prev) => {
const updatedSelected = JSON.parse(
JSON.stringify(prev),
);
// Remove the last key in the map as it's not required
delete updatedSelected[
parseInt(keyWrapper, 10)
];
return updatedSelected;
});
}}
>
<Trash
color="black"
style={{ height: 35, width: 35 }}
/>
</Button>)}
changePrintData((prev) => {
const updatedSelected = JSON.parse(
JSON.stringify(prev),
);
// Remove the last key in the map as it's not required
delete updatedSelected[
parseInt(keyWrapper, 10)
];
return updatedSelected;
});
}}
>
<Trash
color="black"
style={{ height: 35, width: 35 }}
/>
</Button>
)}
</div>
</div>

Expand Down

0 comments on commit 4279920

Please sign in to comment.