Skip to content

Commit

Permalink
Make the book grid out of floats
Browse files Browse the repository at this point in the history
  • Loading branch information
jakecoble committed Dec 4, 2024
1 parent fd8b8aa commit 114f078
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
28 changes: 19 additions & 9 deletions src/components/organisms/passageNavigation.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
padding-bottom: 16px;
}

.wrapper .books:global(.grid) {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
}
// .wrapper .books:global(.grid) {
// display: grid;
// grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
// }

.wrapper li,
.wrapper li button,
Expand All @@ -53,9 +53,9 @@
width: 100%;
}

.books:global(.grid) .chapters {
grid-column: 1 / -1;
}
// .books:global(.grid) .chapters {
// grid-column: 1 / -1;
// }

.chapters {
display: grid;
Expand Down Expand Up @@ -92,9 +92,19 @@
font-size: 12px;
line-height: 14.4px;
text-transform: uppercase;
display: inline-block;
}

.chaptersWrapper {
grid-column: 1 / -1;
width: 100%;
display: none;
}

.chaptersWrapper:global(.active) {
display: block;
float: left;
}

.books:global(.grid) .book {
width: 70px;
display: inline-block;
}
14 changes: 11 additions & 3 deletions src/components/organisms/passageNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,17 @@ export default function PassageNavigation({ books }: Props): JSX.Element {
: book.title}
</button>
</li>
{book.id === selectedBook && selectedView === 'list' ? (
<li className={styles.chaptersWrapper}>
<ul className={styles.chapters}>
{book.id === selectedBook ? (
<li
className={clsx(styles.chaptersWrapper, {
active: book.id === selectedBook,
})}
>
<ul
className={clsx(styles.chapters, {
active: book.id === selectedBook,
})}
>
{chapters?.map((chapter) => {
const n = Number(chapter.title.split(' ').pop());
return (
Expand Down

0 comments on commit 114f078

Please sign in to comment.