Add a card details info tile to the click-to-preview modal
Shows type line, mana value/colors, price, per-format legality pills, and ownership context (owned copies, decks it's in) when the caller has that data — LibraryCard/DeckEntry rows do, bare CardRefs don't, so the section just omits itself when absent. The info tile sits beside the card art via flex-wrap and drops to its own line on narrow viewports, rather than shrinking either face to make room. Also shrinks a double-faced Battle's rotated front face when it has a sibling back face, so it no longer renders at full single-card size next to a much smaller back face.
This commit is contained in:
12
src/api.ts
12
src/api.ts
@@ -38,6 +38,18 @@ export interface DeckEntry extends CardRef {
|
||||
quantity_owned: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* A `CardRef` plus whatever ownership context the caller happens to have
|
||||
* (present on `LibraryCard`/`DeckEntry`, absent on a bare `CardRef`). The
|
||||
* click-to-preview modal's info tile renders these fields when present and
|
||||
* omits them otherwise — callers don't need to do anything special, since
|
||||
* `LibraryCard`/`DeckEntry`/`CardRef` are all structurally assignable here.
|
||||
*/
|
||||
export type PreviewCard = CardRef & {
|
||||
quantity_owned?: number;
|
||||
decks?: string[];
|
||||
};
|
||||
|
||||
export interface Deck {
|
||||
id: number;
|
||||
name: string;
|
||||
|
||||
Reference in New Issue
Block a user