Add Aniimo guides and link game cards to toolbox checklists
Some checks failed
Deploy Sokko G / deploy (push) Failing after 3s
Some checks failed
Deploy Sokko G / deploy (push) Failing after 3s
This commit is contained in:
parent
f0797ccf14
commit
13434f72f6
278 changed files with 10025 additions and 57 deletions
35
website/src/features/games/GuideChecklistControls.jsx
Normal file
35
website/src/features/games/GuideChecklistControls.jsx
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
// Rôle : affiche le sélecteur de checklist et le masquage commun aux pages guides.
|
||||
import { Icon } from "../../components/Icon.jsx";
|
||||
import { useGuideChecklist } from "./useGuideChecklist.js";
|
||||
|
||||
export function CurrentGuideChecklistControls({ gameId }) {
|
||||
const checklist = useGuideChecklist();
|
||||
return checklist.available && checklist.guideId.split("/")[0] === gameId ? <GuideChecklistControls checklist={checklist} /> : null;
|
||||
}
|
||||
|
||||
export function GuideChecklistControls({ checklist }) {
|
||||
const { content, toolbox, selected, lists, hideCompleted } = checklist;
|
||||
return <div className="guide-checklist-controls nds-panel" aria-label={content.label}>
|
||||
{!toolbox ? <button type="button" className="nds-button" data-size="sm" onClick={checklist.linkToolbox}>{content.linkToolbox}</button> : <>
|
||||
<label className="field compact">
|
||||
<span>{content.label}</span>
|
||||
<select className="nds-select" data-size="sm" value={selected?.id || ""} disabled={!lists.length} onChange={(event) => checklist.associate(event.target.value)}>
|
||||
<option value="">{content.none}</option>
|
||||
{lists.map((list) => <option key={list.id} value={list.id}>{list.title} · {list.count} {content.matches}</option>)}
|
||||
</select>
|
||||
</label>
|
||||
{!lists.length && <p>{content.noCompatible}</p>}
|
||||
{selected && <>
|
||||
<div className="guide-checklist-actions">
|
||||
<button type="button" className="nds-button" data-size="sm" onClick={() => checklist.associate("")}>{content.unlink}</button>
|
||||
<button type="button" className="nds-switch" aria-pressed={hideCompleted} onClick={checklist.toggleHidden}><Icon name="hide" /><span>{content.hideCompleted}</span><i aria-hidden="true" /></button>
|
||||
</div>
|
||||
{!selected.count && <p>{content.noMatches}</p>}
|
||||
</>}
|
||||
</>}
|
||||
</div>;
|
||||
}
|
||||
|
||||
export function GuideChecklistMark({ completed, label }) {
|
||||
return completed ? <span className="guide-checklist-mark nds-badge" data-variant="neutral" role="img" aria-label={label} title={label}>✓</span> : null;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue