Show the shop shortfall above the buy button so buttons stay aligned

"Il vous manque … poussières." sat under the button and pushed it below the buttons of the other items in the row. The shortfall and the pending opening notice now come before the button, which stays at the bottom of every card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-19 11:00:33 +01:00
parent e8ec657193
commit 99a438ff1d
2 changed files with 14 additions and 2 deletions

View file

@ -88,8 +88,9 @@ function QuantityItem({ id, cover, title, description, quantityLabel, rateLabel,
<QuantityInput value={value} max={max} label={quantityLabel} busy={busy} onChange={set} />
<span className="nebula-shop-item-rate"><StardustBalance value={price} /> {rateLabel}</span>
</div>
<BuyButton label={actionLabel} total={quantity * price} disabled={busy || max < 1} />
{/* Au-dessus du bouton : il reste aligné sur ceux des autres articles. */}
{max < 1 && <p className="nebula-form-help" role="status">Il vous manque {formatStardust(price - stardust)}.</p>}
<BuyButton label={actionLabel} total={quantity * price} disabled={busy || max < 1} />
</div>
</form>
</article>;
@ -149,9 +150,9 @@ export function ShopPanel({ catalog, state, runMutation, busy, content, onOpenPa
<h4>{shopPack.name}</h4>
<p className="nebula-form-help">{content.packDescription}</p>
<div className="nebula-shop-item-actions">
<BuyButton label={content.packAction} total={shop.shopPackPrice} type="button" disabled={busy || packMissing > 0 || Boolean(state.pendingOpening)} onClick={buyPack} />
{packMissing > 0 && <p className="nebula-form-help">Il vous manque {formatStardust(packMissing)}.</p>}
{state.pendingOpening && <p className="nebula-form-help">{content.packPending}</p>}
<BuyButton label={content.packAction} total={shop.shopPackPrice} type="button" disabled={busy || packMissing > 0 || Boolean(state.pendingOpening)} onClick={buyPack} />
</div>
</div>
</article>}