From d73a30b6753a89be57b5c0d9ae8fcc26a88b595c Mon Sep 17 00:00:00 2001 From: Deflaktor Date: Sun, 30 Jun 2024 17:41:01 +0200 Subject: [PATCH] Add a small card view in venture cards editor --- src/components/board/boardVentureCards.astro | 293 ++++++++++--------- src/lib/getboards.ts | 3 +- src/pages/boards/[slug].astro | 6 +- src/pages/cards.astro | 47 ++- src/pages/cards.d.ts | 2 + src/pages/cards.js | 62 +++- 6 files changed, 247 insertions(+), 166 deletions(-) diff --git a/src/components/board/boardVentureCards.astro b/src/components/board/boardVentureCards.astro index 97b2e128..bbcf33c7 100644 --- a/src/components/board/boardVentureCards.astro +++ b/src/components/board/boardVentureCards.astro @@ -1,20 +1,23 @@ --- import ventureCards from "~/data/venturecards.yml"; -import type { MapDescriptorExtended } from '~/lib/getboards'; interface Props { - board: MapDescriptorExtended; + activeVentureCards?: number[]; + disabled?: boolean; + onchange?: string; } -const { board } = Astro.props; +const { activeVentureCards = [], disabled = true, onchange = '' } = Astro.props; --- -
-
- {ventureCards.map((ventureCard, index) => ( -
#${index + 1}
${ventureCard.description}`}/> - ))} -
-
+{ventureCards.map((ventureCard, index) => ( + <> + {disabled? ( +
#${index + 1}
${ventureCard.description}`}/> + ) : ( + + + + )} + +))}