Skip to content

Commit

Permalink
Adds built with for Bibles
Browse files Browse the repository at this point in the history
  • Loading branch information
richmahn committed May 2, 2024
1 parent 50cbfbd commit 489890e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/components/Bible.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ a.footnote {
export default function Bible() {
const {
state: { urlInfo, catalogEntry, documentAnchor, authToken, bookId, bookTitle, supportedBooks, htmlSections },
actions: { setBookId, setBookTitle, setSupportedBooks, setStatusMessage, setErrorMessage, setHtmlSections, setDocumentAnchor, setCanChangeColumns, setPrintOptions },
actions: { setBookId, setBookTitle, setBuiltWith, setSupportedBooks, setStatusMessage, setErrorMessage, setHtmlSections, setDocumentAnchor, setCanChangeColumns, setPrintOptions },
} = useContext(AppContext);

const [usfmText, setUsfmText] = useState();
Expand Down Expand Up @@ -144,6 +144,12 @@ export default function Bible() {
setErrorMessage,
});

useEffect(() => {
if (catalogEntry) {
setBuiltWith([catalogEntry])
}
}, [catalogEntry, setBuiltWith])

useEffect(() => {
if (documentAnchor && documentAnchor.split('-').length == 3) {
const parts = documentAnchor.split('-');
Expand Down
8 changes: 7 additions & 1 deletion src/components/TsBible.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ a.footnote {
export default function TsBible() {
const {
state: { urlInfo, catalogEntry, bookId, bookTitle, supportedBooks, documentAnchor, authToken },
actions: { setBookId, setBookTitle, setSupportedBooks, setStatusMessage, setErrorMessage, setHtmlSections, setDocumentAnchor, setCanChangeColumns },
actions: { setBookId, setBookTitle, setBuiltWith, setSupportedBooks, setStatusMessage, setErrorMessage, setHtmlSections, setDocumentAnchor, setCanChangeColumns },
} = useContext(AppContext);

const [usfmText, setUsfmText] = useState();
Expand Down Expand Up @@ -145,6 +145,12 @@ export default function TsBible() {
setErrorMessage,
});

useEffect(() => {
if (catalogEntry) {
setBuiltWith([catalogEntry])
}
}, [catalogEntry, setBuiltWith])

useEffect(() => {
if (documentAnchor && documentAnchor.split('-').length == 3) {
const parts = documentAnchor.split('-');
Expand Down

0 comments on commit 489890e

Please sign in to comment.