The sidebar and About page advertised the game even when disabled. The admin rates also warned that the shop pack had no drawable common, rare or epic card although it draws them from the other collections. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
165 lines
7.8 KiB
JavaScript
165 lines
7.8 KiB
JavaScript
// Rôle : présente le projet, son fonctionnement local et les repères de contribution.
|
|
import { useEffect } from "react";
|
|
import { Icon } from "../components/Icon.jsx";
|
|
import { RichText } from "../components/RichText.jsx";
|
|
import { HomeOnboardingSection } from "./HomeOnboardingSection.jsx";
|
|
|
|
export function AboutPage({ siteContent, cardsEnabled = false }) {
|
|
const content = siteContent.about;
|
|
const limits = Array.isArray(content.limits) ? content.limits : [];
|
|
const toolGroups = Array.isArray(content.toolGroups) ? content.toolGroups : [];
|
|
const contributeBlocks = Array.isArray(content.contribute?.blocks) ? content.contribute.blocks : [];
|
|
const normalizeReminder = (item, index) => typeof item === "string" ? { title: `Point ${index + 1}`, text: item, icon: "toolbox" } : item;
|
|
useEffect(() => {
|
|
if (!location.hash.includes("#contribuer")) return;
|
|
requestAnimationFrame(() => document.querySelector("#contribuer")?.scrollIntoView({ behavior: "smooth", block: "start" }));
|
|
}, []);
|
|
|
|
return (
|
|
<div className="about-page">
|
|
<section className="page-hero nds-page-hero">
|
|
<div>
|
|
<p className="eyebrow">{content.eyebrow}</p>
|
|
<h1>{content.title}</h1>
|
|
<p><RichText text={cardsEnabled ? content.cardsDescription : content.description} /></p>
|
|
</div>
|
|
</section>
|
|
<section className="about-story-section nebula-panel nds-panel" aria-labelledby="about-story-title">
|
|
<div className="about-section-heading">
|
|
<p className="eyebrow">{content.sectionsEyebrow}</p>
|
|
<h2 id="about-story-title">{content.sectionsTitle}</h2>
|
|
</div>
|
|
<div className="about-story-list">
|
|
{content.sections.map((section) => (
|
|
<article className="about-story-item" key={section.title}>
|
|
<h3>
|
|
<span className="module-icon" aria-hidden="true">
|
|
<span className={`module-icon-svg module-icon-${section.icon || "toolbox"}`} />
|
|
</span>
|
|
{section.title}
|
|
</h3>
|
|
<div className="about-story-body">
|
|
{section.image && (
|
|
<span className="about-story-visual" aria-hidden="true">
|
|
<img className="about-story-illustration" src={section.image} alt="" />
|
|
</span>
|
|
)}
|
|
<div>
|
|
<p><RichText text={section.text} /></p>
|
|
{Array.isArray(section.bullets) && section.bullets.length > 0 && (
|
|
<ul className={`about-story-bullets ${section.bulletsColumns === 1 ? "single-column" : ""}`}>
|
|
{section.bullets.map((bullet) => <li key={bullet}>{bullet}</li>)}
|
|
</ul>
|
|
)}
|
|
{section.afterText && <p><RichText text={section.afterText} /></p>}
|
|
{section.warning && (
|
|
<p className="about-story-warning">
|
|
<Icon name="warning" />
|
|
<RichText text={section.warning} />
|
|
</p>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</article>
|
|
))}
|
|
</div>
|
|
{limits.length > 0 && (
|
|
<div className="about-storage-reminders">
|
|
<p className="eyebrow">{content.limitsTitle}</p>
|
|
<ul className="about-reminders-list">
|
|
{limits.map((item, itemIndex) => {
|
|
const reminder = normalizeReminder(item, itemIndex);
|
|
return (
|
|
<li className="about-reminder-item" key={reminder.title || reminder.text}>
|
|
<div className="about-reminder-heading">
|
|
<span className="module-icon" aria-hidden="true">
|
|
<span className={`module-icon-svg module-icon-${reminder.icon || "toolbox"}`} />
|
|
</span>
|
|
<h4>{reminder.title}</h4>
|
|
</div>
|
|
<p><RichText text={reminder.text} /></p>
|
|
</li>
|
|
);
|
|
})}
|
|
</ul>
|
|
</div>
|
|
)}
|
|
</section>
|
|
<HomeOnboardingSection content={siteContent.home.onboarding} className="about-onboarding-section" />
|
|
<section className="about-tools-section nebula-panel nds-panel">
|
|
<div className="page-heading">
|
|
<div>
|
|
<p className="eyebrow">Toolbox</p>
|
|
<h2>{content.toolsTitle}</h2>
|
|
{content.toolsIntro && <p>{content.toolsIntro}</p>}
|
|
</div>
|
|
</div>
|
|
<div className="about-tools-list">
|
|
{toolGroups.map((group) => (
|
|
<article className="about-tool-item" key={group.title}>
|
|
<span className="module-icon" aria-hidden="true">
|
|
<span className={`module-icon-svg module-icon-${group.icon || "notepad"}`} />
|
|
</span>
|
|
<div>
|
|
<h3>{group.title}</h3>
|
|
<p><RichText text={group.text} /></p>
|
|
{Array.isArray(group.examples) && group.examples.length > 0 && (
|
|
<ul className="about-tool-examples" aria-label={`Exemples pour ${group.title}`}>
|
|
{group.examples.map((example) => <li key={example}>{example}</li>)}
|
|
</ul>
|
|
)}
|
|
</div>
|
|
</article>
|
|
))}
|
|
</div>
|
|
<a className="about-tools-library-button nds-button" data-size="md" data-variant="primary" href="#/library"><Icon name="book" />{content.toolsLibraryLink}</a>
|
|
</section>
|
|
{content.contribute && (
|
|
<section className="about-contribute-section nebula-panel nds-panel" id="contribuer" aria-labelledby="about-contribute-title">
|
|
<div className="about-section-heading">
|
|
<p className="eyebrow">{content.contribute.eyebrow}</p>
|
|
<h2 id="about-contribute-title">{content.contribute.title}</h2>
|
|
{content.contribute.image && (
|
|
<img className="about-contribute-illustration" src={content.contribute.image} alt={content.contribute.imageAlt || ""} />
|
|
)}
|
|
</div>
|
|
<div className="about-contribute-content">
|
|
<p><RichText text={content.contribute.description} /></p>
|
|
{contributeBlocks.length > 0 && (
|
|
<div className="about-contribute-blocks">
|
|
{contributeBlocks.map((block) => (
|
|
<article className="about-contribute-block" key={block.title}>
|
|
<span className="module-icon" aria-hidden="true">
|
|
<span className={`module-icon-svg module-icon-${block.icon || "checklist"}`} />
|
|
</span>
|
|
<div>
|
|
<h3>{block.title}</h3>
|
|
<p><RichText text={block.text} /></p>
|
|
{Array.isArray(block.bullets) && block.bullets.length > 0 && (
|
|
<ul>
|
|
{block.bullets.map((bullet) => <li key={bullet}>{bullet}</li>)}
|
|
</ul>
|
|
)}
|
|
{block.note && <p className="about-contribute-note"><RichText text={block.note} /></p>}
|
|
</div>
|
|
</article>
|
|
))}
|
|
</div>
|
|
)}
|
|
<div className="about-contribute-formats">
|
|
<div className="about-code-example">
|
|
{content.contribute.exampleIntro && <p><RichText text={content.contribute.exampleIntro} /></p>}
|
|
<pre><code>{content.contribute.example}</code></pre>
|
|
</div>
|
|
<div className="about-prompt-box">
|
|
<h3>{content.contribute.promptTitle}</h3>
|
|
<p><RichText text={content.contribute.promptIntro} /></p>
|
|
<pre><code>{content.contribute.promptText}</code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|