diff --git a/dev-dist/sw.js b/dev-dist/sw.js index d8f3034..d262385 100644 --- a/dev-dist/sw.js +++ b/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-ca84f546'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "index.html", - "revision": "0.8gqbvnk5km4" + "revision": "0.bbuf8ja4298" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { diff --git a/src/App.tsx b/src/App.tsx index 18ed739..cdeb9f6 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -40,7 +40,7 @@ function AppContent() { switch (currentPage) { case 'home': return ( -
+

My Decks

+
-
- {renderPage()} +
+
+ {renderPage()} +
diff --git a/src/components/CardSearch.tsx b/src/components/CardSearch.tsx index 05225d0..963b29b 100644 --- a/src/components/CardSearch.tsx +++ b/src/components/CardSearch.tsx @@ -201,7 +201,7 @@ const CardSearch = () => { }; return ( -
+

Card Search

@@ -774,7 +774,7 @@ const CardSearch = () => {
diff --git a/src/components/Collection.tsx b/src/components/Collection.tsx index 74edc6b..398d7b1 100644 --- a/src/components/Collection.tsx +++ b/src/components/Collection.tsx @@ -189,7 +189,7 @@ export default function Collection() { }; return ( -
+

My Collection

@@ -295,7 +295,7 @@ export default function Collection() { const displayOracleText = currentFace?.oracle_text || hoveredCard.oracle_text; return ( -
+
{/* Backdrop */}
setSelectedCard(null)} /> {/* Sliding Panel */} -
+
{/* Close button - fixed position, stays visible when scrolling */}
); -} +} diff --git a/src/components/DeckEditor.tsx b/src/components/DeckEditor.tsx index b12ac8a..f476ca0 100644 --- a/src/components/DeckEditor.tsx +++ b/src/components/DeckEditor.tsx @@ -62,7 +62,7 @@ export default function DeckEditor({ deckId, onClose }: DeckEditorProps) { if (loading) { return ( -
+
); @@ -70,7 +70,7 @@ export default function DeckEditor({ deckId, onClose }: DeckEditorProps) { if (!deck) { return ( -
+

Error

@@ -82,4 +82,4 @@ export default function DeckEditor({ deckId, onClose }: DeckEditorProps) { } return ; -} +} diff --git a/src/components/DeckManager.tsx b/src/components/DeckManager.tsx index f93179e..00238c0 100644 --- a/src/components/DeckManager.tsx +++ b/src/components/DeckManager.tsx @@ -125,6 +125,7 @@ export default function DeckManager({ initialDeck, onSave }: DeckManagerProps) { const [currentDeckId, setCurrentDeckId] = useState(initialDeck?.id || null); const [searchQuery, setSearchQuery] = useState(''); const [searchResults, setSearchResults] = useState([]); + const [isSearching, setIsSearching] = useState(false); const [selectedCards, setSelectedCards] = useState<{ card: Card; quantity: number; @@ -296,11 +297,16 @@ export default function DeckManager({ initialDeck, onSave }: DeckManagerProps) { e.preventDefault(); if (!searchQuery.trim()) return; + setIsSearching(true); try { const cards = await searchCards(searchQuery); - setSearchResults(cards); + setSearchResults(cards || []); } catch (error) { console.error('Failed to search cards:', error); + setSearchResults([]); + setSnackbar({ message: 'Failed to search cards', type: 'error' }); + } finally { + setIsSearching(false); } }; @@ -538,7 +544,7 @@ export default function DeckManager({ initialDeck, onSave }: DeckManagerProps) { }; return ( -
+
{/* Card Search Section */} @@ -575,7 +581,17 @@ export default function DeckManager({ initialDeck, onSave }: DeckManagerProps) { {/* Vertical Card List for Mobile */}
- {searchResults.map(card => { + {isSearching ? ( +
+ +
+ ) : searchResults.length === 0 && searchQuery ? ( +
+

No cards found

+

Try a different search term

+
+ ) : ( + searchResults.map(card => { const currentFaceIndex = getCurrentFaceIndex(card.id); const isMultiFaced = isDoubleFaced(card); const inCollection = userCollection.get(card.id) || 0; @@ -702,7 +718,8 @@ export default function DeckManager({ initialDeck, onSave }: DeckManagerProps) {
); - })} + }) + )}
@@ -876,10 +893,6 @@ export default function DeckManager({ initialDeck, onSave }: DeckManagerProps) { })}
-
- Total Price: ${totalPrice.toFixed(2)} -
- {deckSize > 0 && suggestedLandCountValue > 0 && (
@@ -906,49 +919,62 @@ export default function DeckManager({ initialDeck, onSave }: DeckManagerProps) {
)} -
- {!isLoadingCollection && getMissingCards().length > 0 && ( - - )} - -
+ {/* Fixed Footer with Price and Actions - Mobile First */} +
+
+ {/* Total Price */} +
+ Total Price + ${totalPrice.toFixed(2)} +
+ + {/* Action Buttons */} +
+ {!isLoadingCollection && getMissingCards().length > 0 && ( + + )} + +
+
+
+ {/* Hover Card Preview - only show if no card is selected */} {hoveredCard && !selectedCard && (() => { const currentFaceIndex = getCurrentFaceIndex(hoveredCard.id); @@ -962,7 +988,7 @@ export default function DeckManager({ initialDeck, onSave }: DeckManagerProps) { const displayOracleText = currentFace?.oracle_text || hoveredCard.oracle_text; return ( -
+
{/* Backdrop */}
setSelectedCard(null)} /> {/* Sliding Panel */} -
+
{/* Close button */} {showDropdown && ( -
+