From 6453436dd93457abfccfce7acf64e1821d0a27fb Mon Sep 17 00:00:00 2001 From: Nathan Arthur Date: Tue, 3 Dec 2024 13:11:20 -0500 Subject: [PATCH] fix bible chapter links --- package-lock.json | 6 +-- .../organisms/passageNavigation.graphql | 17 +++------ .../organisms/passageNavigation.tsx | 37 +++++++------------ src/containers/bible/index.graphql | 19 ++++++++-- src/containers/bible/index.tsx | 11 +++--- src/pages/[language]/bibles/index.tsx | 35 +++++++++--------- 6 files changed, 61 insertions(+), 64 deletions(-) diff --git a/package-lock.json b/package-lock.json index d6c7c6758..03f46021a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11204,9 +11204,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001684", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001684.tgz", - "integrity": "sha512-G1LRwLIQjBQoyq0ZJGqGIJUXzJ8irpbjHLpVRXDvBEScFJ9b17sgK6vlx0GAJFE21okD7zXl08rRRUfq6HdoEQ==", + "version": "1.0.30001686", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001686.tgz", + "integrity": "sha512-Y7deg0Aergpa24M3qLC5xjNklnKnhsmSyR/V89dLZ1n0ucJIFNs7PgR2Yfa/Zf6W79SbBicgtGxZr2juHkEUIA==", "funding": [ { "type": "opencollective", diff --git a/src/components/organisms/passageNavigation.graphql b/src/components/organisms/passageNavigation.graphql index b81fc42f5..84424ff48 100644 --- a/src/components/organisms/passageNavigation.graphql +++ b/src/components/organisms/passageNavigation.graphql @@ -1,16 +1,11 @@ -fragment passageNavigation on BibleConnection { - nodes { - title - books { +fragment passageNavigation on Sequence { + id + title + recordings(first: 150) { + nodes { id title - chapters { - title - url - } + canonicalPath } } - aggregate { - count - } } diff --git a/src/components/organisms/passageNavigation.tsx b/src/components/organisms/passageNavigation.tsx index 541faf134..96ca61f5f 100644 --- a/src/components/organisms/passageNavigation.tsx +++ b/src/components/organisms/passageNavigation.tsx @@ -2,56 +2,45 @@ import clsx from 'clsx'; import React, { useState } from 'react'; import Link from '~components/atoms/linkWithoutPrefetch'; -import root from '~src/lib/routes'; -import useLanguageRoute from '~src/lib/useLanguageRoute'; -import { IBibleBook } from '~src/services/fcbh/types'; +import { PassageNavigationFragment } from './__generated__/passageNavigation'; import styles from './passageNavigation.module.scss'; type Props = { - books: IBibleBook[]; + books: Array; }; export default function PassageNavigation({ books }: Props): JSX.Element { - const [selectedBook, setSelectedBook] = useState( - books[0]?.name, + const [selectedBook, setSelectedBook] = useState( + null, ); - const languageRoute = useLanguageRoute(); - return (