Skip to content

Commit

Permalink
Add draft grid view
Browse files Browse the repository at this point in the history
  • Loading branch information
jakecoble committed Dec 2, 2024
1 parent 107acd2 commit 000868a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/components/organisms/passageNavigation.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 6 additions & 3 deletions src/components/organisms/passageNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export default function PassageNavigation(props: Props): JSX.Element {
List
</button>
</div>
<ul className={styles.books}>

<ul className={clsx(styles.books, { grid: selectedView === 'grid' })}>
{BIBLE_BOOKS.map((book) => {
const chapters = getChapters(props.audiobibles, book);
return (
Expand All @@ -51,9 +52,11 @@ export default function PassageNavigation(props: Props): JSX.Element {
setSelectedBook(book);
}}
>
{book}
{selectedView === 'grid'
? book.replace(' ', '').substring(0, 3)
: book}
</button>
{book === selectedBook ? (
{book === selectedBook && selectedView === 'list' ? (
<ul className={styles.chapters}>
{chapters?.map(({ title }) => {
console.log('title', title);
Expand Down

0 comments on commit 000868a

Please sign in to comment.