sokko-g/website/src/features/cards/GuildPanel.jsx
Shinuwa 0ef213cf4f
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 20m57s
Validate and deploy Sokko G / deploy (push) Successful in 12s
Add the Guilde des Veilleurs and its daily guess-the-card quest to Sokko TCG
- La Carte du jour: one zoomed card shared by all players each Paris day, six guesses with collection and rarity hints, a fixed stardust reward and an emoji result to share.
- The Guilde des Veilleurs lists the quests, with a menu entry, a home banner and an admin section for quest settings.
- The section menu folds into a dropdown below 960 px; the home pairs the guild with the best pull and moves the opening reserve under the menu.
- The shop pack share moves to the shop collection admin page, which recalls where the pack draws its cards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 18:43:28 +01:00

46 lines
2.5 KiB
JavaScript

// Rôle : présente la Guilde des Veilleurs et la tuile de chacune de ses quêtes, avec leur état.
import { dailyQuestStatus, fillTemplate, formatStreak } from "./dailyShare.js";
import { guildQuests } from "./guildQuests.js";
// Carte du jour : un dos vierge, propre à aucune collection et marqué d'un « ? », figure la carte cachée à retrouver.
const DAILY_COVER = "/static/img/cards/empty-back.webp";
function DailyQuest({ summary: daily, content }) {
const finished = daily.status !== "playing";
return <article className="nds-card nebula-quest" data-status={daily.status} aria-labelledby="nebula-quest-daily-title">
{/* La série en cours se range sous la couverture. */}
<div className="nebula-quest-media">
<div className="nds-card-cover nebula-quest-cover" aria-hidden="true">
<img src={DAILY_COVER} alt="" />
<span>?</span>
</div>
{daily.streak > 0 && <span className="nds-badge" data-variant="gold">{fillTemplate(content.dailyStreak, { streak: formatStreak(daily.streak) })}</span>}
</div>
<div className="nds-card-body nebula-quest-body">
<p className="eyebrow">{content.dailyKind}</p>
<h3 id="nebula-quest-daily-title">{content.dailyTitle}</h3>
<p>{content.dailyDescription}</p>
<p className="nebula-quest-status">{dailyQuestStatus(daily, content)}</p>
<div className="nds-card-actions">
<a className="nds-button" data-size="sm" data-variant={finished ? "secondary" : "primary"} href="#/cards/daily">{finished ? content.dailyResult : content.dailyAction}</a>
</div>
</div>
</article>;
}
// Tuile de chaque type de quête, choisie par l'identifiant donné dans guildQuests.
const QUEST_TILES = { daily: DailyQuest };
export function GuildPanel({ catalog, state, content }) {
const quests = guildQuests(state).filter((quest) => QUEST_TILES[quest.id]);
return <section className="nebula-quests" aria-labelledby="nebula-guild-title">
<div className="nds-section-heading nebula-section-heading">
<div><p className="eyebrow">{content.eyebrow}</p><h2 id="nebula-guild-title">{content.title}</h2><p className="nebula-guild-intro">{content.intro}</p></div>
</div>
{quests.length ? <div className="nebula-quests-grid">{quests.map(({ id, summary }) => {
const Tile = QUEST_TILES[id];
return <Tile key={id} catalog={catalog} summary={summary} content={content} />;
})}</div>
: <div className="nds-empty-state"><p>{content.empty}</p></div>}
</section>;
}