From 5d18b103ef78126bca13d77e98714ddcf377d4b5 Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Tue, 17 Oct 2023 16:11:56 -0400 Subject: [PATCH] updated book and EGW book sections to have dynamic headings --- public/compiled-lang/en.json | 16 ++++++++++++++-- public/lang/en.json | 10 ++++++++-- src/components/molecules/card/sequence.tsx | 19 +++++++++++-------- .../cardSlider/section/audiobooks.tsx | 17 ++++++++++++----- .../cardSlider/section/egwAudiobooks.tsx | 17 ++++++++++++----- src/containers/discover/index.tsx | 18 ++++++++++++++++-- 6 files changed, 73 insertions(+), 24 deletions(-) diff --git a/public/compiled-lang/en.json b/public/compiled-lang/en.json index ad2e60b90..4681cb1a9 100644 --- a/public/compiled-lang/en.json +++ b/public/compiled-lang/en.json @@ -1359,12 +1359,24 @@ "value": "Discover Collections" } ], + "discoverCollections_audiobooksHeading": [ + { + "type": 0, + "value": "Discover Books" + } + ], "discoverCollections_conferencesHeading": [ { "type": 0, "value": "Conferences" } ], + "discoverCollections_egwAudiobooksHeading": [ + { + "type": 0, + "value": "Discover Ellen G. White" + } + ], "discoverCollections_storySeasonsHeading": [ { "type": 0, @@ -3836,7 +3848,7 @@ "organismSection__audiobooksHeading": [ { "type": 0, - "value": "Discover Books" + "value": "Books" } ], "organismSection__audiobooksNext": [ @@ -3872,7 +3884,7 @@ "organismSection__egwAudiobooksHeading": [ { "type": 0, - "value": "Discover Ellen G. White" + "value": "Ellen G. White" } ], "organismSection__egwAudiobooksNext": [ diff --git a/public/lang/en.json b/public/lang/en.json index 2d5878104..69556a558 100644 --- a/public/lang/en.json +++ b/public/lang/en.json @@ -639,9 +639,15 @@ "discoverCollections__title": { "string": "Discover Collections" }, + "discoverCollections_audiobooksHeading": { + "string": "Discover Books" + }, "discoverCollections_conferencesHeading": { "string": "Conferences" }, + "discoverCollections_egwAudiobooksHeading": { + "string": "Discover Ellen G. White" + }, "discoverCollections_storySeasonsHeading": { "string": "Stories" }, @@ -1813,7 +1819,7 @@ "string": "Sponsor" }, "organismSection__audiobooksHeading": { - "string": "Discover Books" + "string": "Books" }, "organismSection__audiobooksNext": { "string": "Next audiobooks" @@ -1831,7 +1837,7 @@ "string": "Previous Bible books" }, "organismSection__egwAudiobooksHeading": { - "string": "Discover Ellen G. White" + "string": "Ellen G. White" }, "organismSection__egwAudiobooksNext": { "string": "Next EGW audiobooks" diff --git a/src/components/molecules/card/sequence.tsx b/src/components/molecules/card/sequence.tsx index 441026cf9..ffde52b25 100644 --- a/src/components/molecules/card/sequence.tsx +++ b/src/components/molecules/card/sequence.tsx @@ -17,6 +17,7 @@ import BookIcon from '~public/img/icons/fa-book-light.svg'; import FeatherIcon from '~public/img/icons/fa-feather-light.svg'; import ListIcon from '~public/img/icons/fa-list-alt.svg'; import MusicIcon from '~public/img/icons/fa-music-light.svg'; +import SeedlingIcon from '~public/img/icons/fa-seedling.svg'; import IconClosure from '~public/img/icons/icon-closure.svg'; import IconDisclosure from '~public/img/icons/icon-disclosure.svg'; import SuccessIcon from '~public/img/icons/icon-success-light.svg'; @@ -119,7 +120,7 @@ export default function CardSequence({ labelColor: BaseColors.DARK, }, [SequenceContentType.StorySeason]: { - Icon: FeatherIcon, + Icon: SeedlingIcon, accentColor: BaseColors.SALMON, backgroundColor: BaseColors.STORY_B, iconColor: BaseColors.WHITE, @@ -174,13 +175,15 @@ export default function CardSequence({ ultralight className={egw ? styles.bookReadBy : styles.bibleReadBy} > - + {(speakers.nodes || [])[0]?.name && ( + + )} )} {summary && ( diff --git a/src/components/organisms/cardSlider/section/audiobooks.tsx b/src/components/organisms/cardSlider/section/audiobooks.tsx index 48a076230..6ebeb4007 100644 --- a/src/components/organisms/cardSlider/section/audiobooks.tsx +++ b/src/components/organisms/cardSlider/section/audiobooks.tsx @@ -9,16 +9,23 @@ import { useLanguageId } from '~src/lib/useLanguageId'; import { useInfiniteGetSectionAudiobooksQuery } from './__generated__/audiobooks'; import Section from './index'; -export default function Audiobooks(): JSX.Element { +export default function Audiobooks(props: { + heading?: string | JSX.Element; +}): JSX.Element { const intl = useIntl(); const lang = useLanguageId(); + + const { + heading = intl.formatMessage({ + id: 'organismSection__audiobooksHeading', + defaultMessage: 'Books', + }), + } = props; + return (
- - + + } + /> + + } + />