Admin : onglet Infos (et création de magasin) retravaillé
Sections à pictogramme et explication (Commerce, Dirigeant, Anti-triche), aides sous les réglages anti-triche, référence corrigée vers l'historique de l'app, barre d'enregistrement fixe avec Annuler dès qu'un champ change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9adff56acf
commit
60c3a1d333
7 changed files with 56 additions and 34 deletions
|
|
@ -16,6 +16,18 @@ export const EMPTY_STORE: StoreInput = {
|
|||
minScanIntervalMin: 5,
|
||||
};
|
||||
|
||||
function SectionTitle({ icon, title, sub }: { icon: string; title: string; sub: string }) {
|
||||
return (
|
||||
<div style={{ display: 'flex', gap: 14, alignItems: 'flex-start' }}>
|
||||
<span className="mod-ic on" aria-hidden="true" style={{ width: 44, height: 44, fontSize: 22 }}>{icon}</span>
|
||||
<div>
|
||||
<h2 style={{ margin: 0 }}>{title}</h2>
|
||||
<p className="muted" style={{ margin: '2px 0 0', fontSize: 14 }}>{sub}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** Formulaire partagé entre la création et l'onglet Infos. */
|
||||
export function StoreForm({
|
||||
initial,
|
||||
|
|
@ -33,6 +45,8 @@ export function StoreForm({
|
|||
const set = <K extends keyof StoreInput>(k: K) => (e: { target: { value: string } }) =>
|
||||
setV((prev) => ({ ...prev, [k]: typeof prev[k] === 'number' ? Number(e.target.value) : e.target.value }));
|
||||
|
||||
const dirty = (Object.keys(initial) as (keyof StoreInput)[]).some((k) => String(v[k]) !== String(initial[k]));
|
||||
|
||||
async function submit(e: FormEvent) {
|
||||
e.preventDefault();
|
||||
setBusy(true);
|
||||
|
|
@ -59,7 +73,7 @@ export function StoreForm({
|
|||
{error && <div className="alert error" role="alert">{error}</div>}
|
||||
|
||||
<section className="card" style={{ display: 'flex', flexDirection: 'column', gap: 20 }}>
|
||||
<h2>Commerce</h2>
|
||||
<SectionTitle icon="🏪" title="Commerce" sub="Identité légale du magasin, reprise sur les factures." />
|
||||
<div className="grid-2">
|
||||
{text('name', 'Nom du magasin')}
|
||||
{text('siret', 'SIRET', { placeholder: '14 chiffres', inputMode: 'numeric', pattern: '[0-9 ]{14,17}' })}
|
||||
|
|
@ -72,8 +86,8 @@ export function StoreForm({
|
|||
</section>
|
||||
|
||||
<section className="card" style={{ display: 'flex', flexDirection: 'column', gap: 20 }}>
|
||||
<h2>Contact</h2>
|
||||
{text('contactName', 'Nom du contact', { placeholder: 'Prénom Nom' })}
|
||||
<SectionTitle icon="👤" title="Dirigeant" sub="Destinataire des e-mails : lien de paiement, factures, exports CSV." />
|
||||
{text('contactName', 'Prénom et nom', { placeholder: 'Prénom Nom' })}
|
||||
<div className="grid-2">
|
||||
{text('contactEmail', 'E-mail', { type: 'email', placeholder: 'contact@exemple.fr' })}
|
||||
{text('contactPhone', 'Téléphone', { type: 'tel', placeholder: '06 12 34 56 78' })}
|
||||
|
|
@ -81,25 +95,28 @@ export function StoreForm({
|
|||
</section>
|
||||
|
||||
<section className="card" style={{ display: 'flex', flexDirection: 'column', gap: 20 }}>
|
||||
<div>
|
||||
<h2>Anti-triche</h2>
|
||||
<p className="muted" style={{ margin: 0 }}>
|
||||
Limitent les crédits abusifs. Une opération hors limites est refusée et apparaît dans l'onglet Opérations.
|
||||
</p>
|
||||
</div>
|
||||
<SectionTitle icon="🛡️" title="Anti-triche" sub="Limitent les crédits abusifs. Une opération hors limites est refusée et reste visible dans l’historique de l’app." />
|
||||
<div className="grid-2">
|
||||
<div className="field">
|
||||
<label htmlFor="maxAmountEuros">Plafond par opération (€) *</label>
|
||||
<input id="maxAmountEuros" className="input" type="number" min={1} max={10000} required value={v.maxAmountEuros} onChange={set('maxAmountEuros')} />
|
||||
<span className="hint">Montant maximum saisi en une fois (mode points). Ex. : 500 € pour une boulangerie.</span>
|
||||
</div>
|
||||
<div className="field">
|
||||
<label htmlFor="minScanIntervalMin">Délai minimum entre deux crédits (min) *</label>
|
||||
<input id="minScanIntervalMin" className="input" type="number" min={0} max={1440} required value={v.minScanIntervalMin} onChange={set('minScanIntervalMin')} />
|
||||
<span className="hint">Évite de créditer deux fois la même carte. 0 = aucun délai.</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div>
|
||||
<div className={`form-save${dirty ? ' dirty' : ''}`}>
|
||||
{dirty && <span className="muted" style={{ fontSize: 14 }}>Modifications non enregistrées</span>}
|
||||
{dirty && (
|
||||
<button type="button" className="btn secondary" disabled={busy} onClick={() => setV(initial)}>
|
||||
Annuler
|
||||
</button>
|
||||
)}
|
||||
<button className="btn" disabled={busy}>{busy ? 'Enregistrement…' : submitLabel}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -285,3 +285,8 @@ tr.clickable:hover td { background: var(--primary-soft); }
|
|||
.stats-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px; }
|
||||
.rank { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: inline-grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--text-3); }
|
||||
.rank.top { background: var(--warn-bg); font-size: 17px; }
|
||||
|
||||
/* ── Formulaire magasin ── */
|
||||
.form-save { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; padding: 14px 0; background: var(--bg); border-top: 1px solid transparent; }
|
||||
.form-save.dirty { border-top-color: var(--border); }
|
||||
.form-save .muted { margin-right: auto; }
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -8,8 +8,8 @@
|
|||
<title>Affichette — MonEspacePro</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
|
||||
<script type="module" crossorigin src="/assets/espace/index-CWiD3xSy.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/espace/index-DGLmXErW.css">
|
||||
<script type="module" crossorigin src="/assets/espace/index-B2Kkb0_y.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/espace/index-1qlvpGNx.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
<title>Mon espace — MonEspacePro</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
|
||||
<script type="module" crossorigin src="/assets/espace/index-CWiD3xSy.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/espace/index-DGLmXErW.css">
|
||||
<script type="module" crossorigin src="/assets/espace/index-B2Kkb0_y.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/espace/index-1qlvpGNx.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
<title>Créer mon programme de fidélité — MonEspacePro</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
|
||||
<script type="module" crossorigin src="/assets/espace/index-CWiD3xSy.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/espace/index-DGLmXErW.css">
|
||||
<script type="module" crossorigin src="/assets/espace/index-B2Kkb0_y.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/espace/index-1qlvpGNx.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue