Skip to content

Create a deck#15

Open
acezard wants to merge 4 commits intomainfrom
create-deck
Open

Create a deck#15
acezard wants to merge 4 commits intomainfrom
create-deck

Conversation

@acezard
Copy link
Copy Markdown
Owner

@acezard acezard commented Feb 20, 2025

Fixes #1

Add functionality to create and manage decks with unique names, save to local storage, and switch between decks using tabs.

  • src/App.tsx

    • Add a prompt to ask the user for a deck name when creating a new deck.
    • Assign a default name "New Deck" if the user does not provide a name.
    • Save the new deck to local storage using localStorage.setItem.
    • Load decks from local storage on component mount using localStorage.getItem.
  • src/components/DeckTab.tsx

    • Add tabs for each deck for quick switching.
    • Display deck stats in a tabbed interface.
  • src/App.spec.tsx

    • Add tests for creating a new deck with a unique name.
    • Add tests for saving the deck to local storage.
    • Add tests for loading decks from local storage on component mount.

For more details, open the Copilot Workspace session.

Fixes #1

Add functionality to create and manage decks with unique names, save to local storage, and switch between decks using tabs.

* **src/App.tsx**
  - Add a prompt to ask the user for a deck name when creating a new deck.
  - Assign a default name "New Deck" if the user does not provide a name.
  - Save the new deck to local storage using `localStorage.setItem`.
  - Load decks from local storage on component mount using `localStorage.getItem`.

* **src/components/DeckTab.tsx**
  - Add tabs for each deck for quick switching.
  - Display deck stats in a tabbed interface.

* **src/App.spec.tsx**
  - Add tests for creating a new deck with a unique name.
  - Add tests for saving the deck to local storage.
  - Add tests for loading decks from local storage on component mount.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/acezard/warpforge-tracker/issues/1?shareId=XXXX-XXXX-XXXX-XXXX).
* Add `Tabs` and `Tab` components to `src/App.tsx` to allow switching between decks
* Update `src/components/DeckTab.tsx` to show all warlords for the current deck on screen
* Add tests in `src/App.spec.tsx` for showing only one deck per tab
* Add a new `Faction` type import
* Map over `deck.factions` to create a table row for each faction
* Add a table cell with the faction name, spanning all columns
* Map over `faction.warlords` to create a table row for each warlord
* Apply color-coded styles to columns for offensive wins, offensive losses, defensive wins, defensive losses, total wins, total losses, and win rate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a Deck

2 participants