Skip to content

Conversation

ilsea
Copy link
Member

@ilsea ilsea commented Sep 30, 2026

Add the shared styles (tokens, reset, base) and the first components: BookCover, BookCard, BookGrid and SearchField, plus the client Book type.

Close #32, Close #34, Close #35

Notes

  • BookGrid props: books, savedIds, ratings, onToggleSaved, and optional showShelf. The wooden shelf is shown on My shelf only, never on Browse. The grid does not know which page it is on.
  • Search is submitted with Enter or the button, never while typing.
  • Field names follow the backend model. id is still to be settled (see open questions in decisions.md).
  • Uses the full Book type for now, narrowing is tracked in Client: Narrow down the fields fetched for book lists #44
  • Formatted with Prettier. Lint runs clean. npm run build runs clean.
  • Related docs have been updated to reflect these changes and decisions

New dependency: react-router-dom (for Link in BookCard). Run npm install in client/ to make sure you have the required package.

NB! No actual pages have been created, so it is not possible to see this in use via npm run dev

Preview:
Desktop view without shelf element
Desktop view without shelf element

Desktop view with shelf element
Desktop view with shelf element

Search field in focus, with input, button highlighted
Search field in focus, with input, button highlighted

The purple header and the surrounding page are a throwaway mockup, used only to show the components in context.
Fonts Fraunces and Figtree are not loaded yet (fallback fonts). Self-hosting fonts is a separate task.

Basic setup for design elements and components, to be continued on a different machine
Create/move all global .css files into styles/ folder
- index.css
- tokens.css
- base.css
- reset.css

Add styles_documentation.md to docs/, describes purpose and rules of global .css files, and other style decisions
New file: client\src\types\book.ts

Book mirrors the current GraphQL schema / Mongoose model
New files:
- BookCover.tsx and .module.css
- BookCard.tsx and .module.css
- BookGrid.tsx and .module.css

- ´BookCover` generates styled color cover for books that are missing a real img cover (URL)
- ´BookCard` creates book card used in grid on Browse and My shelf pages, uses select fields from Book type, includes link to book detail page, optional visual shelf plank element, title, author, year, save toggle ribbon button
- `BookGrid` creates list of `BookCard`s, renders into auto-fill grid that responds to different screen sizes

Add react-router-dom config to .json files in client/, used by BookCard link
Use: pass the applied query as `value` (e.g. from the URL "?q="); onSearch fires only on Enter or button, never while typing.
Updated docs to reflect recent changes to components and CSS
@ilsea ilsea requested a review from a team as a code owner September 30, 2026 17:54
@ilsea ilsea linked an issue Sep 30, 2026 that may be closed by this pull request
Copy link
Member

@adriach adriach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ser bra ut

@adriach adriach merged commit 2462a05 into main Oct 1, 2026
@ilsea ilsea deleted the feat/23-create-components-for-frontend branch October 1, 2026 09:32
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shared components: book-specific Shared components: primitives Foundational CSS Create components for frontend
2 participants