From defcf2af9cfad13871c9d877388c1106a6bce478 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Fri, 21 Nov 2025 17:36:00 +0100 Subject: [PATCH] Add functionality to create new decks and update navigation labels --- src/App.tsx | 5 +- src/components/DeckList.tsx | 20 +++++++- src/components/DeckManager.tsx | 2 +- src/components/Navigation.tsx | 92 ++++++++++++++++++---------------- 4 files changed, 73 insertions(+), 46 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index ce4d5cd..4650848 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -42,7 +42,10 @@ import React, { useState } from 'react';

My Decks

- + setCurrentPage('deck')} + />
); diff --git a/src/components/DeckList.tsx b/src/components/DeckList.tsx index 3cbdb28..9845ab1 100644 --- a/src/components/DeckList.tsx +++ b/src/components/DeckList.tsx @@ -3,12 +3,14 @@ import { getCardById, getCardsByIds } from '../services/api'; import { Deck } from '../types'; import { supabase } from "../lib/supabase"; import DeckCard from "./DeckCard"; +import { PlusCircle } from 'lucide-react'; interface DeckListProps { onDeckEdit?: (deckId: string) => void; + onCreateDeck?: () => void; } -const DeckList = ({ onDeckEdit }: DeckListProps) => { +const DeckList = ({ onDeckEdit, onCreateDeck }: DeckListProps) => { const [decks, setDecks] = useState([]); const [loading, setLoading] = useState(true); @@ -92,6 +94,22 @@ const DeckList = ({ onDeckEdit }: DeckListProps) => { {decks.map((deck) => ( ))} + + {/* Create New Deck Card */} + ); }; diff --git a/src/components/DeckManager.tsx b/src/components/DeckManager.tsx index 4eae315..a88c897 100644 --- a/src/components/DeckManager.tsx +++ b/src/components/DeckManager.tsx @@ -490,7 +490,7 @@ export default function DeckManager({ initialDeck, onSave }: DeckManagerProps) { }; return ( -
+
{/* Card Search Section */} diff --git a/src/components/Navigation.tsx b/src/components/Navigation.tsx index 0679461..8524cf6 100644 --- a/src/components/Navigation.tsx +++ b/src/components/Navigation.tsx @@ -51,8 +51,7 @@ import React, { useState, useRef, useEffect } from 'react'; }, []); const navItems = [ - { id: 'home' as const, label: 'Home', icon: Home }, - { id: 'deck' as const, label: 'New Deck', icon: PlusSquare }, + { id: 'home' as const, label: 'Decks', icon: Library }, { id: 'collection' as const, label: 'Collection', icon: Library }, { id: 'search' as const, label: 'Search', icon: Search }, { id: 'life-counter' as const, label: 'Life Counter', icon: Heart }, @@ -140,52 +139,59 @@ import React, { useState, useRef, useEffect } from 'react'; {/* Mobile Navigation - Bottom */} -