CurrentlyReadingShelf

4 variants. Open one in isolation: use the link on each card.

Currently reading

  • Cover of Empowered: Ordinary People, Extraordinary Products
  • Cover of A Pattern Language
  • Cover of One Second Ahead

Scrollable

Open alone →

Currently reading

  • Cover of Empowered: Ordinary People, Extraordinary Products
  • Cover of A Pattern Language
  • Cover of Thinking, Fast and Slow
  • Cover of Refactoring: Improving the Design of Existing Code

Currently reading

  • Cover of Empowered: Ordinary People, Extraordinary Products

src/ui/2_organisms/CurrentlyReadingShelf.astro
---
import type { BookShelfItem } from '../../lib/books'
import BookIcon from 'phosphor-astro/Book.astro'
import '../../styles/currently-reading-shelf.css'
interface Props {
books: BookShelfItem[]
}
const { books } = Astro.props
---
{
books.length > 0 && (
<section aria-label="Currently reading" class="mb-8 border-b border-border pb-6">
<h2 class="meta text-xs font-semibold uppercase tracking-widest text-ink-muted mb-3">
Currently reading
</h2>
<ul class="currently-reading-shelf__scroller list-none m-0 p-0">
{
books.map(book => (
<li class="currently-reading-shelf__item w-28">
<a
href={`/books/${book.slug}/`}
class="block no-underline"
aria-label={book.coverUrl ? undefined : `${book.title} — ${book.author}`}
>
<span class="flex h-32 items-center justify-center">
{
book.coverUrl ? (
<img
src={book.coverUrl}
alt={`Cover of ${book.title}`}
class="h-auto max-h-32 w-auto max-w-full border border-border"
/>
) : (
<span
class="flex h-full w-full items-center justify-center border border-border"
aria-hidden="true"
>
<BookIcon class="size-6 text-ink-faint" />
</span>
)
}
</span>
</a>
</li>
))
}
</ul>
</section>
)
}