mirror of
https://github.com/IliesAllali/parenthese.git
synced 2026-11-11 16:12:14 +00:00
feat(invite): crayon pour proposer des changements
L'invité a le crayon du propriétaire dans la barre du bas, avant « Plus ». Le bandeau du mode contribution dit « Vous proposez » (« Vous proposez des changements » sur ordinateur), sur une seule ligne, avec « Envoyer ». Le propriétaire ne voit aucun changement. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6a9034cf98
commit
ac3cd6aec2
5 files changed
+32
-12
No files matched your search
@@ -48,14 +48,20 @@
|
||||
.edit-mode-submit { flex: none; }
|
||||
.edit-mode-toast-close { width: 36px; min-height: 36px; flex: none; }
|
||||
|
||||
/* Invité : la phrase complète sur ordinateur, « Vous proposez » sur téléphone, toujours sur une ligne */
|
||||
.edit-mode-toast-short { display: none; }
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.edit-mode-toast { top: 68px; max-width: calc(100vw - 24px); }
|
||||
.edit-mode-toast-text { font-size: 13px; }
|
||||
.edit-mode-toast--contrib .edit-mode-toast-long { display: none; }
|
||||
.edit-mode-toast--contrib .edit-mode-toast-short { display: inline; }
|
||||
}
|
||||
|
||||
/* Téléphone : le texte se coupait en « Vous modifi… » à côté du bouton, qui suffit à lui seul */
|
||||
/* Téléphone : le texte de l'éditeur se coupait en « Vous modifi… » à côté du bouton, qui suffit à lui seul.
|
||||
L'invité garde son texte court, qui tient sur une ligne. */
|
||||
@media (max-width: 480px) {
|
||||
.edit-mode-toast--with-submit .edit-mode-toast-text { display: none; }
|
||||
.edit-mode-toast--with-submit:not(.edit-mode-toast--contrib) .edit-mode-toast-text { display: none; }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
|
||||
@@ -11,8 +11,9 @@ function EditSessionBar({ active, hasDraft, role = 'contributor', onDeactivate,
|
||||
), [isAdmin])
|
||||
|
||||
// Libellés courts : ils doivent tenir sur un téléphone à côté du bouton
|
||||
const toastLabel = isAdmin ? t("Vous modifiez l'arbre") : t('Vos propositions')
|
||||
const submitLabel = isAdmin ? t("Mettre à jour l'arbre") : t('Envoyer mes ajouts')
|
||||
// Invité : « Vous proposez » sur téléphone (une seule ligne), la phrase complète sur ordinateur
|
||||
const toastLabel = isAdmin ? t("Vous modifiez l'arbre") : null
|
||||
const submitLabel = isAdmin ? t("Mettre à jour l'arbre") : t('Envoyer')
|
||||
// La famille ne voit le bouton d'envoi que lorsqu'il y a quelque chose à envoyer
|
||||
const showSubmit = Boolean(onSubmit) && (isAdmin || hasDraft)
|
||||
|
||||
@@ -22,9 +23,16 @@ function EditSessionBar({ active, hasDraft, role = 'contributor', onDeactivate,
|
||||
<>
|
||||
<div className={borderClass} aria-hidden="true" />
|
||||
|
||||
<div className={`edit-mode-toast${isAdmin ? ' edit-mode-toast--admin' : ''}${showSubmit ? ' edit-mode-toast--with-submit' : ''}`} role="status" aria-live="polite">
|
||||
<div className={`edit-mode-toast${isAdmin ? ' edit-mode-toast--admin' : ' edit-mode-toast--contrib'}${showSubmit ? ' edit-mode-toast--with-submit' : ''}`} role="status" aria-live="polite">
|
||||
<span className="edit-mode-toast-dot" aria-hidden="true" />
|
||||
<span className="edit-mode-toast-text">{toastLabel}</span>
|
||||
{isAdmin ? (
|
||||
<span className="edit-mode-toast-text">{toastLabel}</span>
|
||||
) : (
|
||||
<span className="edit-mode-toast-text">
|
||||
<span className="edit-mode-toast-long">{t('Vous proposez des changements')}</span>
|
||||
<span className="edit-mode-toast-short">{t('Vous proposez')}</span>
|
||||
</span>
|
||||
)}
|
||||
|
||||
{showSubmit && (
|
||||
<button
|
||||
|
||||
@@ -160,6 +160,13 @@ function ContextualNavbar({
|
||||
const isFamily = (navbarType === 'contributor_anon' || navbarType === 'contributor_auth') && Boolean(onAddSouvenirClick)
|
||||
const renderFamilyButtons = () => (
|
||||
<>
|
||||
{/* Le même crayon que le propriétaire : proposer des changements sans passer par « Plus » */}
|
||||
<NavButton
|
||||
icon={<Edit3 size={20} strokeWidth={2} />}
|
||||
label={t('Proposer des changements')}
|
||||
onClick={onEditClick}
|
||||
active={editModeActive}
|
||||
/>
|
||||
<button type="button" className="nav-family-btn nav-family-btn--primary" onClick={onAddSouvenirClick}>
|
||||
<ImagePlus size={20} strokeWidth={2} aria-hidden="true" />
|
||||
<span>{t('Ajouter un souvenir')}</span>
|
||||
@@ -239,7 +246,7 @@ function ContextualNavbar({
|
||||
<>
|
||||
<NavButton
|
||||
icon={<Edit3 size={20} strokeWidth={2} />}
|
||||
label={t('Contribuer')}
|
||||
label={t('Proposer des changements')}
|
||||
onClick={onEditClick}
|
||||
active={editModeActive}
|
||||
/>
|
||||
@@ -258,7 +265,7 @@ function ContextualNavbar({
|
||||
<>
|
||||
<NavButton
|
||||
icon={<Edit3 size={20} strokeWidth={2} />}
|
||||
label={t("Contribuer à l'arbre")}
|
||||
label={t('Proposer des changements')}
|
||||
onClick={onEditClick}
|
||||
active={editModeActive}
|
||||
/>
|
||||
|
||||
@@ -190,8 +190,6 @@ export default {
|
||||
"Le mode d'emploi": "User guide",
|
||||
"Modifier l'arbre": "Edit the tree",
|
||||
"Contributions": "Contributions",
|
||||
"Contribuer": "Contribute",
|
||||
"Contribuer à l'arbre": "Contribute to the tree",
|
||||
"Contribuer (mot de passe contribution requis)": "Contribute (contribution password required)",
|
||||
"Modifier la démo": "Edit the demo",
|
||||
"Quitter l'édition": "Exit edit mode",
|
||||
|
||||
@@ -176,9 +176,10 @@ export default {
|
||||
'Envoyer les modifications': 'Send changes',
|
||||
'Aucune modification à soumettre': 'No changes to submit',
|
||||
"Vous modifiez l'arbre": "You're editing the tree",
|
||||
'Vos propositions': 'Your suggestions',
|
||||
'Vous proposez des changements': 'You are suggesting changes',
|
||||
'Vous proposez': 'You are suggesting',
|
||||
'Proposer des changements': 'Suggest changes',
|
||||
"Mettre à jour l'arbre": 'Update the tree',
|
||||
'Envoyer mes ajouts': 'Send my additions',
|
||||
"Aucune modification à envoyer pour l'instant": 'Nothing to send yet',
|
||||
'Quitter le mode édition': 'Exit edit mode',
|
||||
|
||||
|
||||
Reference in new issue
Block a user