diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index e6ba106..cdf0b2a 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -3057,8 +3057,8 @@ function App() { activeTreeId={tree.treeContext.treeId} onEditClick={handleEditToggle} onAddPersonClick={handleOpenAddPerson} - onAddSouvenirClick={isFamilyVisitor ? handleOpenSouvenirPicker : undefined} - helpUrl={isFamilyVisitor ? HELP_URL : ''} + onAddSouvenirClick={isFamilyVisitor || userRole.isAdmin ? handleOpenSouvenirPicker : undefined} + helpUrl={HELP_URL} onShareClick={userRole.isAdmin ? handleOpenContributionPanel : undefined} onTreeSelect={handleOpenTreeFromAccount} onCreateTree={handleOpenTreeWizard} diff --git a/frontend/src/components/ContributionPanel.jsx b/frontend/src/components/ContributionPanel.jsx index 409762b..89eb67d 100644 --- a/frontend/src/components/ContributionPanel.jsx +++ b/frontend/src/components/ContributionPanel.jsx @@ -434,7 +434,7 @@ const ContributionPanel = ({ {/* ── En-tête sessions ── */}
-

{t('Propositions à relire')}

+

{t('Propositions à relire')}

{t('Acceptez ou refusez chaque modification, puis appliquez vos choix.')}

diff --git a/frontend/src/components/navbar/AvatarMenu.jsx b/frontend/src/components/navbar/AvatarMenu.jsx index 9da46e9..c72cdfa 100644 --- a/frontend/src/components/navbar/AvatarMenu.jsx +++ b/frontend/src/components/navbar/AvatarMenu.jsx @@ -24,6 +24,7 @@ function AvatarMenu({ isOwner = false, pendingContributions = 0, onContributionsClick, + onShareClick, helpUrl = '', onAccountClick, onSelectTree, @@ -106,6 +107,10 @@ function AvatarMenu({ } label={t('Créer un nouvel arbre')} onSelect={() => { onClose(); onCreateTree?.() }} /> + {isOwner && onShareClick && ( + } label={t("Partager l'arbre")} onSelect={() => { onClose(); onShareClick() }} /> + )} + {isOwner && ( } label={t("Paramètres de l'arbre")} onSelect={() => { onClose(); onSettings?.() }} /> )} diff --git a/frontend/src/components/navbar/ContextualNavbar.jsx b/frontend/src/components/navbar/ContextualNavbar.jsx index 26b2979..7ab6058 100644 --- a/frontend/src/components/navbar/ContextualNavbar.jsx +++ b/frontend/src/components/navbar/ContextualNavbar.jsx @@ -126,6 +126,17 @@ function ContextualNavbar({ } const closeMenus = () => setOpenMenu(null) + + // « Propositions à relire » ouvre la fenêtre de partage, positionnée sur la section des propositions + const openProposals = () => { + onShareClick?.() + const scrollWhenReady = (retries) => { + const section = document.getElementById('contrib-propositions') + if (section) section.scrollIntoView({ block: 'start' }) + else if (retries > 0) setTimeout(() => scrollWhenReady(retries - 1), 100) + } + scrollWhenReady(20) + } // Chaque action ferme le menu avant de se lancer const run = (action) => () => { closeMenus() @@ -188,7 +199,7 @@ function ContextualNavbar({ }] } else { const addItems = [] - if (isFamily) { + if (onAddSouvenirClick) { addItems.push({ key: 'souvenir', icon: , label: t('Un souvenir'), sub: t('photo, vidéo, voix, document'), onSelect: onAddSouvenirClick }) } if (isFamily || isOwner || isDemo) { @@ -389,7 +400,8 @@ function ContextualNavbar({ activeTreeName={activeTreeName} isOwner={isOwner} pendingContributions={pendingContributions} - onContributionsClick={onShareClick} + onContributionsClick={openProposals} + onShareClick={onShareClick} helpUrl={helpUrl} onAccountClick={onAccountClick} onSelectTree={onTreeSelect} diff --git a/frontend/src/i18n/en/compte.js b/frontend/src/i18n/en/compte.js index fcd8fdf..356c50f 100644 --- a/frontend/src/i18n/en/compte.js +++ b/frontend/src/i18n/en/compte.js @@ -233,4 +233,5 @@ export default { "Terminer la modification": "Finish editing", "Aide": "Help", "Se déconnecter": "Sign out", + "Partager l'arbre": "Share the tree", } diff --git a/frontend/src/styles/pz.css b/frontend/src/styles/pz.css index d62a4b2..ef32ef0 100644 --- a/frontend/src/styles/pz.css +++ b/frontend/src/styles/pz.css @@ -261,6 +261,5 @@ button:disabled:has(.pz-busy.is-busy) { opacity: 1; cursor: progress; } .pz-lang-row-label { display: inline-flex; align-items: center; gap: 10px; } .pz-lang-row-label svg { color: var(--pz-muted); flex: none; } /* Dans la barre d'actions, séparé des boutons par un filet */ -.pz-lang--nav { margin-left: 4px; padding: 0 4px 0 8px; border-left: 1px solid var(--pz-line); align-self: stretch; } /* Sous les écrans d'accès et de connexion */ .pz-lang--screen { justify-self: center; }