Add the Sokko TCG collectible card mini-game
Add the server-backed card game: Discord login, recharging pack openings, album, trades, gifts, stardust shop, campaign codes and its administration, stored in SQLite and disabled in production until configured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
243465720f
commit
5ce35cd7ba
193 changed files with 12159 additions and 28 deletions
16
website/src/features/cards/admin/ExpiryField.jsx
Normal file
16
website/src/features/cards/admin/ExpiryField.jsx
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Rôle : saisit une date et une heure d'expiration avec le calendrier et le champ d'heure du design system.
|
||||
import { useState } from "react";
|
||||
import { MonthDateDropdown } from "../../toolboxes/modules/CalendarMonthDatePicker.jsx";
|
||||
import { toDateTimeLocal } from "./adminFormat.js";
|
||||
|
||||
const monthStartOf = (dateKey) => new Date(`${dateKey.slice(0, 7)}-01T00:00`);
|
||||
|
||||
// `value` et `onChange` utilisent le format local « AAAA-MM-JJTHH:mm ».
|
||||
export function ExpiryField({ label, value, now, onChange }) {
|
||||
const [date, time] = value.split("T");
|
||||
const [displayedMonth, setDisplayedMonth] = useState(() => monthStartOf(date));
|
||||
return <div className="nebula-admin-expiry-field">
|
||||
<MonthDateDropdown value={date} displayedMonth={displayedMonth} minDate={toDateTimeLocal(now).slice(0, 10)} mode="date" textContent={{}} label={label} onMonthChange={setDisplayedMonth} onChange={(nextDate) => onChange(`${nextDate}T${time}`)} />
|
||||
<input className="nds-time" data-size="sm" type="time" aria-label="Heure d’expiration" value={time} onChange={(event) => onChange(`${date}T${event.target.value || time}`)} />
|
||||
</div>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue