From 04d577c833cb8aca1c2cac629897be6caed25339 Mon Sep 17 00:00:00 2001 From: Jake Coble Date: Mon, 2 Dec 2024 11:39:56 -0500 Subject: [PATCH 1/4] Add toggle for grid and list views --- .../organisms/passageNavigation.module.scss | 20 +++++++++++++++++-- .../organisms/passageNavigation.tsx | 15 ++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/components/organisms/passageNavigation.module.scss b/src/components/organisms/passageNavigation.module.scss index b0dc441af..d7454de13 100644 --- a/src/components/organisms/passageNavigation.module.scss +++ b/src/components/organisms/passageNavigation.module.scss @@ -1,7 +1,6 @@ @import '../../styles/common.scss'; .wrapper { - display: flex; background-color: $ts-bibleVersionH; } @@ -29,7 +28,7 @@ .wrapper li a { color: $ts-lightTone; font-weight: 700; - size: 16px; + font-size: 16px; line-height: 19.2px; text-transform: uppercase; list-style-type: none; @@ -39,6 +38,10 @@ color: $ts-salmon; } +.switch > :global(button.active) { + color: $ts-salmon; +} + .wrapper, .wrapper .books, .wrapper .chapters { @@ -69,3 +72,16 @@ .books button:hover { color: $ts-salmon; } + +.switch { + border-bottom: 1px solid $ts-salmon; +} + +.switch > button { + color: $ts-lightTone; + font-weight: 700; + font-size: 12px; + line-height: 14.4px; + text-transform: uppercase; + display: inline-block; +} diff --git a/src/components/organisms/passageNavigation.tsx b/src/components/organisms/passageNavigation.tsx index 96ca61f5f..86a5dfdca 100644 --- a/src/components/organisms/passageNavigation.tsx +++ b/src/components/organisms/passageNavigation.tsx @@ -14,9 +14,24 @@ export default function PassageNavigation({ books }: Props): JSX.Element { const [selectedBook, setSelectedBook] = useState( null, ); + const [selectedView, setSelectedView] = useState<'grid' | 'list'>('grid'); return (
+
+ + +
    {books.map((book) => { const chapters = book.recordings.nodes; From 06fc6da2f737fbb3ff452b89e63cb1fd6290dd01 Mon Sep 17 00:00:00 2001 From: Jake Coble Date: Mon, 2 Dec 2024 16:03:37 -0500 Subject: [PATCH 2/4] Add draft grid view --- src/components/organisms/passageNavigation.module.scss | 5 +++++ src/components/organisms/passageNavigation.tsx | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/organisms/passageNavigation.module.scss b/src/components/organisms/passageNavigation.module.scss index d7454de13..ca53fb8c3 100644 --- a/src/components/organisms/passageNavigation.module.scss +++ b/src/components/organisms/passageNavigation.module.scss @@ -23,6 +23,11 @@ padding-bottom: 16px; } +.wrapper .books:global(.grid) { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); +} + .wrapper li, .wrapper li button, .wrapper li a { diff --git a/src/components/organisms/passageNavigation.tsx b/src/components/organisms/passageNavigation.tsx index 86a5dfdca..f15940b62 100644 --- a/src/components/organisms/passageNavigation.tsx +++ b/src/components/organisms/passageNavigation.tsx @@ -32,9 +32,11 @@ export default function PassageNavigation({ books }: Props): JSX.Element { List
-