Open any toolbox from a list in Sokko TCG's toolbox drawer
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 23m40s
Validate and deploy Sokko G / deploy (push) Successful in 16s

Every Sokko TCG section now offers the top bar's toolbox button. Instead of
linking a toolbox, the drawer lists all toolboxes (linked to a game or not)
as wide rows with a large cover, opens the one chosen, and remembers it on
the device. Memos and alerts follow the toolbox shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-30 14:31:53 +01:00
parent e8fe27a90f
commit 8253f74c90
17 changed files with 359 additions and 45 deletions

View file

@ -22,11 +22,23 @@ export function formatDate(value) {
return new Intl.DateTimeFormat("fr-FR", { dateStyle: "medium", timeStyle: "short" }).format(new Date(value));
}
export function ToolboxCard({ toolbox, game, actions, reorder }) {
// Couverture d'une toolbox : celle du jeu lié, sinon l'image choisie, sinon son icône. `rect` distingue une image (bandeau)
// d'une icône (à centrer sur le dégradé).
export function getToolboxCover(toolbox, game) {
const gameCoverImage = getGameCardCover(game);
const customCoverImage = !gameCoverImage && toolbox.customCover ? toolbox.customCover : "";
const coverImage = gameCoverImage || customCoverImage || toolbox.icon || DEFAULT_TOOLBOX_ICON;
const hasRectCover = Boolean(gameCoverImage || customCoverImage);
return {
src: gameCoverImage || customCoverImage || toolbox.icon || DEFAULT_TOOLBOX_ICON,
rect: Boolean(gameCoverImage || customCoverImage),
custom: Boolean(customCoverImage)
};
}
export function ToolboxCard({ toolbox, game, actions, reorder }) {
const cover = getToolboxCover(toolbox, game);
const customCoverImage = cover.custom ? cover.src : "";
const coverImage = cover.src;
const hasRectCover = cover.rect;
const className = [
"card",
"nds-card",