Reveal the Stardust pack in the shop, keep the campaign expiry row inside its card and stabilise the Aniimo e2e tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
99724cb6ba
commit
2c10df0370
7 changed files with 65 additions and 27 deletions
|
|
@ -279,7 +279,7 @@ export function CardsPage({ siteContent, cardsConfig, playerSection = "", player
|
|||
{section === "expeditions" && <ExpeditionsPanel {...panelProps} content={{ ...content.expeditions, cardSheet: content.cardSheet }} joinId={decodeURIComponent(playerSubsection)} />}
|
||||
{section === "packs" && <PackPanel {...panelProps} content={content.packs} reserveContent={content.home} />}
|
||||
{section === "collection" && <CollectionPanel {...panelProps} headingContent={content.collection} recyclingContent={content.recycling} onStartTransfer={startTransfer} />}
|
||||
{section === "shop" && <ShopPanel {...panelProps} content={content.shop} onOpenPacks={openPacks} />}
|
||||
{section === "shop" && <ShopPanel {...panelProps} content={content.shop} openingContent={content.packs} />}
|
||||
{section === "transfers" && <TransfersPanel {...panelProps} content={content.transfers} draft={transferDraft} onDraftUsed={clearTransferDraft} />}
|
||||
{section === "history" && <HistoryPanel catalog={catalog} state={state} content={content.history} />}
|
||||
{section === "account" && <AccountPanel state={state} busy={busy || offline} content={content.account} privacy={content.privacy} privacyContact={cardsConfig.privacyContact} privacyController={cardsConfig.privacyController} onDelete={deleteAccount} runMutation={runMutation} />}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,8 @@ function OpeningOdds({ catalog, opening, collection, content, shopShare }) {
|
|||
</section>;
|
||||
}
|
||||
|
||||
function OpeningStage({ catalog, opening, onComplete, onDismiss, onOpenAnother, focusOnMountRef, remaining, busy, content, shopShare }) {
|
||||
// Révélation d'une ouverture ; la Boutique l'utilise aussi pour son paquet, qui s'ouvre sans quitter la boutique.
|
||||
export function OpeningStage({ catalog, opening, onComplete, onDismiss, onOpenAnother, focusOnMountRef, remaining, busy, content, shopShare }) {
|
||||
const [revealed, setRevealed] = useState(new Set());
|
||||
const [finishedReveals, setFinishedReveals] = useState(new Set());
|
||||
const [completed, setCompleted] = useState(false);
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
// Rôle : boutique du joueur ; affiche le solde de poussière d'étoiles, achète des ouvertures de paquet et, quand les Expéditions
|
||||
// sont ouvertes, change la poussière en Éclats d'étoile (Pont des Veilleurs) et vend les objets de la boutique (Parchemin d'oubli,
|
||||
// Rose des vents).
|
||||
import { useState } from "react";
|
||||
import { buyOpening, buyShopItem, buyShopPack, convertStardust } from "./cardsApi.js";
|
||||
import { useRef, useState } from "react";
|
||||
import { buyOpening, buyShopItem, buyShopPack, completeOpening, convertStardust } from "./cardsApi.js";
|
||||
import { DashboardAside } from "./CardsDashboard.jsx";
|
||||
import { CollectionCardBack } from "./CollectionCardBack.jsx";
|
||||
import { EclatsBalance, StardustBalance } from "./Currency.jsx";
|
||||
import { fillTemplate } from "./dailyShare.js";
|
||||
import { formatEclats } from "./expeditionFormat.js";
|
||||
import { OpeningStage } from "./PackPanel.jsx";
|
||||
import { formatStardust } from "./stardustFormat.js";
|
||||
|
||||
|
||||
|
|
@ -96,8 +97,10 @@ function QuantityItem({ id, cover, title, description, quantityLabel, rateLabel,
|
|||
</article>;
|
||||
}
|
||||
|
||||
export function ShopPanel({ catalog, state, runMutation, busy, content, onOpenPacks }) {
|
||||
export function ShopPanel({ catalog, state, runMutation, busy, content, openingContent }) {
|
||||
const [notice, setNotice] = useState("");
|
||||
const [completedOpening, setCompletedOpening] = useState(null);
|
||||
const focusOnMount = useRef(false);
|
||||
const { wallet, shop } = state;
|
||||
|
||||
// Les Éclats ne servent qu'aux Expéditions : le Pont n'est proposé que lorsqu'elles sont ouvertes.
|
||||
|
|
@ -106,11 +109,29 @@ export function ShopPanel({ catalog, state, runMutation, busy, content, onOpenPa
|
|||
const shopPack = catalog.collections.find((collection) => collection.packCategory === "shop" && collection.active);
|
||||
const packMissing = Math.max(0, shop.shopPackPrice - wallet.stardust);
|
||||
|
||||
// L'ouverture attribuée s'affiche dans la section Paquets, qui gère la révélation.
|
||||
// Le paquet acheté se révèle ici même : « Retour » ramène à la boutique. Une autre ouverture en cours reste dans Paquets.
|
||||
const isShopOpening = (opening) => catalog.collections.find((collection) => collection.id === opening?.collectionId)?.packCategory === "shop";
|
||||
const opening = (isShopOpening(state.pendingOpening) ? state.pendingOpening : null) || completedOpening;
|
||||
if (opening) return <OpeningStage
|
||||
key={opening.id}
|
||||
catalog={catalog}
|
||||
opening={opening}
|
||||
busy={busy}
|
||||
content={openingContent}
|
||||
shopShare={shop.shopPackShare}
|
||||
remaining={{ reserve: state.recharge.openingsBalance, purchased: wallet.purchasedOpenings }}
|
||||
onComplete={async () => {
|
||||
setCompletedOpening(opening);
|
||||
return runMutation(() => completeOpening(opening.id));
|
||||
}}
|
||||
onDismiss={() => setCompletedOpening(null)}
|
||||
focusOnMountRef={focusOnMount}
|
||||
onOpenAnother={null}
|
||||
/>;
|
||||
|
||||
async function buyPack() {
|
||||
setNotice("");
|
||||
const result = await runMutation(() => buyShopPack());
|
||||
if (result?.opening) onOpenPacks();
|
||||
await runMutation(() => buyShopPack());
|
||||
}
|
||||
|
||||
async function buy(count) {
|
||||
|
|
|
|||
|
|
@ -993,7 +993,7 @@ main:has(.nebula-dashboard) { overflow-x: clip; }
|
|||
.nebula-admin-campaign-missing { justify-self: start; margin: 0; }
|
||||
.nebula-admin-campaign-reward { margin: 0; color: var(--color-text-secondary); font-size: var(--font-size-sm); }
|
||||
.nebula-admin-campaign-detail .nebula-admin-actions { align-items: center; margin: 0; }
|
||||
.nebula-admin-extend { display: inline-flex; align-items: center; gap: var(--space-2); margin-left: auto; }
|
||||
.nebula-admin-extend { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); max-width: 100%; margin-left: auto; }
|
||||
.nebula-admin-extend .nds-input { width: 220px; }
|
||||
.nebula-admin-extend .nebula-admin-check, .nebula-admin-extend .nds-button { white-space: nowrap; }
|
||||
.nebula-admin-claims-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue